Skip to content

Commit 437fadf

Browse files
author
David Berry
committed
Need this file for the previosu commit
1 parent 53e3994 commit 437fadf

File tree

1 file changed

+84
-0
lines changed

1 file changed

+84
-0
lines changed

dat1emsSetHdsdim.c

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
#include <stdlib.h>
3+
#include <string.h>
4+
#include <stdio.h>
5+
6+
#include "dat_err.h"
7+
#include "hds1.h"
8+
#include "ems.h"
9+
#include "star/mem.h"
10+
11+
/*
12+
*+
13+
* Name:
14+
* dat1emsSetHdsdim
15+
16+
* Purpose:
17+
* Set message token for hdsdim integer.
18+
19+
* Invocation:
20+
* dat1emsSetHdsdim( const char * token, HDS_PTYPE value );
21+
22+
* Description :
23+
* Version of emsSetu suitable for the hdsdim HDS type.
24+
25+
* Parameters :
26+
* token = const char * (Given)
27+
* Message token to use.
28+
* value = hdsdim (Given)
29+
* Value to store in token.
30+
31+
* Notes:
32+
* This routine should be called instead of emsSetu (or related)
33+
* if an hdsdim is to be stored in a token.
34+
35+
* Authors
36+
* TIMJ: Tim Jenness (JAC, Hawaii)
37+
* {enter_new_authors_here}
38+
39+
* History :
40+
* 11-JUL-2006 (TIMJ):
41+
* Copy from dat1emsSetBigu
42+
* {enter_further_changes_here}
43+
44+
* Copyright:
45+
* Copyright (C) 2006 Particle Physics and Astronomy Research Council.
46+
* All Rights Reserved.
47+
48+
* Licence:
49+
* This program is free software; you can redistribute it and/or
50+
* modify it under the terms of the GNU General Public License as
51+
* published by the Free Software Foundation; either version 2 of
52+
* the License, or (at your option) any later version.
53+
*
54+
* This program is distributed in the hope that it will be
55+
* useful, but WITHOUT ANY WARRANTY; without even the implied
56+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
57+
* PURPOSE. See the GNU General Public License for more details.
58+
*
59+
* You should have received a copy of the GNU General Public
60+
* License along with this program; if not, write to the Free
61+
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
62+
* MA 02110-1301, USA
63+
64+
* Bugs:
65+
* {note_any_bugs_here}
66+
67+
*-
68+
*/
69+
70+
#define BUFSIZE 64
71+
72+
void
73+
dat1emsSetHdsdim( const char * token, hdsdim value )
74+
{
75+
/* simplest approach is to format the number our selves and then
76+
store that using emsSetc */
77+
char buffer[BUFSIZE];
78+
int nfmt;
79+
80+
nfmt = snprintf(buffer, BUFSIZE, "%" HDS_DIM_FORMAT, value );
81+
if (nfmt < BUFSIZE) emsSetc( token, buffer );
82+
return;
83+
}
84+

0 commit comments

Comments
 (0)