GnuCOBOL  2.0
A free COBOL compiler
ishelper.c File Reference
#include "isinternal.h"
Include dependency graph for ishelper.c:

Go to the source code of this file.

Functions

int iscluster (const int ihandle, struct keydesc *pskeydesc)
 
int iserase (char *pcfilename)
 
int isflush (const int ihandle)
 
int islock (const int ihandle)
 
int isrelcurr (const int ihandle)
 
int isrelease (const int ihandle)
 
int isrelrec (const int ihandle, const long long trownumber)
 
int isrename (char *pcoldname, char *pcnewname)
 
int issetunique (const int ihandle, const long long tuniqueid)
 
int isuniqueid (const int ihandle, long long *ptuniqueid)
 
int isunlock (const int ihandle)
 
char * isdi_name (const int ihandle)
 
int isdi_datlen (const int ihandle)
 
int isdi_idxfd (const int ihandle)
 
int isdi_datfd (const int ihandle)
 
int isdi_curidx (const int ihandle)
 
struct keydesc * isdi_kdsc (const int ihandle)
 
void ldchar (char *pcsource, int ilength, char *pcdestination)
 
void stchar (char *pcsource, char *pcdestination, int ilength)
 
int ldint (void *pclocation)
 
void stint (int ivalue, void *pclocation)
 
int ldlong (void *pclocation)
 
void stlong (int lvalue, void *pclocation)
 
double ldfloat (void *pclocation)
 
void stfloat (double dsource, void *pcdestination)
 
double ldfltnull (void *pclocation, short *pinullflag)
 
void stfltnull (double dsource, void *pcdestination, int inullflag)
 
double lddbl (void *pclocation)
 
void stdbl (double dsource, void *pcdestination)
 
double lddblnull (void *pclocation, short *pinullflag)
 
void stdblnull (double dsource, void *pcdestination, int inullflag)
 

Function Documentation

int iscluster ( const int  ihandle,
struct keydesc *  pskeydesc 
)

Definition at line 25 of file ishelper.c.

References iserrno, and ivbmaxusedhandle.

26 {
27  /* BUG Write iscluster() and don't forget to call ivbtranscluster */
28  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
29  iserrno = EBADARG;
30  return -1;
31  }
32  return 0;
33 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iserrno
Definition: vbmemio.c:27
int isdi_curidx ( const int  ihandle)

Definition at line 341 of file ishelper.c.

References DICTINFO::iactivekey, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, psvbfile, and unlikely.

342 {
343  struct DICTINFO *psvbptr;
344 
345  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
346  iserrno = EBADARG;
347  return -1;
348  }
349  psvbptr = psvbfile[ihandle];
350  if (!psvbptr || psvbptr->iisopen) {
351  iserrno = ENOTOPEN;
352  return -1;
353  }
354  return psvbptr->iactivekey;
355 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iactivekey
Definition: isinternal.h:401
int iserrno
Definition: vbmemio.c:27
int isdi_datfd ( const int  ihandle)

Definition at line 324 of file ishelper.c.

References DICTINFO::idatahandle, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, psvbfile, and unlikely.

325 {
326  struct DICTINFO *psvbptr;
327 
328  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
329  iserrno = EBADARG;
330  return -1;
331  }
332  psvbptr = psvbfile[ihandle];
333  if (!psvbptr || psvbptr->iisopen) {
334  iserrno = ENOTOPEN;
335  return -1;
336  }
337  return psvbptr->idatahandle;
338 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int idatahandle
Definition: isinternal.h:405
int iserrno
Definition: vbmemio.c:27
int isdi_datlen ( const int  ihandle)

Definition at line 290 of file ishelper.c.

References DICTINFO::iisopen, DICTINFO::imaxrowlength, iserrno, ivbmaxusedhandle, psvbfile, and unlikely.

291 {
292  struct DICTINFO *psvbptr;
293 
294  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
295  iserrno = EBADARG;
296  return -1;
297  }
298  psvbptr = psvbfile[ihandle];
299  if (!psvbptr || psvbptr->iisopen) {
300  iserrno = ENOTOPEN;
301  return -1;
302  }
303  return psvbptr->imaxrowlength;
304 }
int imaxrowlength
Definition: isinternal.h:404
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iserrno
Definition: vbmemio.c:27
int isdi_idxfd ( const int  ihandle)

Definition at line 307 of file ishelper.c.

References DICTINFO::iindexhandle, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, psvbfile, and unlikely.

308 {
309  struct DICTINFO *psvbptr;
310 
311  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
312  iserrno = EBADARG;
313  return -1;
314  }
315  psvbptr = psvbfile[ihandle];
316  if (!psvbptr || psvbptr->iisopen) {
317  iserrno = ENOTOPEN;
318  return -1;
319  }
320  return psvbptr->iindexhandle;
321 }
int iindexhandle
Definition: isinternal.h:406
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iserrno
Definition: vbmemio.c:27
struct keydesc* isdi_kdsc ( const int  ihandle)

Definition at line 358 of file ishelper.c.

References DICTINFO::iactivekey, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, NULL, DICTINFO::pskeydesc, psvbfile, pvvbmalloc(), and unlikely.

359 {
360  struct DICTINFO *psvbptr;
361  struct keydesc *keydptr;
362 
363  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
364  iserrno = EBADARG;
365  return NULL;
366  }
367  psvbptr = psvbfile[ihandle];
368  if (!psvbptr || psvbptr->iisopen) {
369  iserrno = ENOTOPEN;
370  return NULL;
371  }
372  keydptr = pvvbmalloc (sizeof(struct keydesc));
373  if (keydptr) {
374  memcpy (keydptr, psvbptr->pskeydesc[psvbptr->iactivekey],
375  sizeof(struct keydesc));
376  }
377  return keydptr;
378 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
Definition: exception.def:95
void * pvvbmalloc(const size_t size)
Definition: vbmemio.c:45
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iactivekey
Definition: isinternal.h:401
struct keydesc * pskeydesc[32]
Definition: isinternal.h:445
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

char* isdi_name ( const int  ihandle)

Definition at line 273 of file ishelper.c.

References DICTINFO::cfilename, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, NULL, psvbfile, and unlikely.

274 {
275  struct DICTINFO *psvbptr;
276 
277  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
278  iserrno = EBADARG;
279  return NULL;
280  }
281  psvbptr = psvbfile[ihandle];
282  if (!psvbptr || psvbptr->iisopen) {
283  iserrno = ENOTOPEN;
284  return NULL;
285  }
286  return strdup (psvbptr->cfilename);
287 }
char * cfilename
Definition: isinternal.h:422
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
Definition: exception.def:95
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iserrno
Definition: vbmemio.c:27
int iserase ( char *  pcfilename)

Definition at line 36 of file ishelper.c.

References DICTINFO::cfilename, isclose(), ivbclose3(), ivbmaxusedhandle, ivbtranserase(), NULL, and psvbfile.

Referenced by indexed_open(), and ircvfileerase().

37 {
38  int ihandle;
39  char cbuffer[1024];
40 
41  for (ihandle = 0; ihandle <= ivbmaxusedhandle; ihandle++) {
42  if (psvbfile[ihandle] != NULL) {
43  if (!strcmp (psvbfile[ihandle]->cfilename, pcfilename)) {
44  isclose (ihandle);
45  ivbclose3 (ihandle);
46  break;
47  }
48  }
49  }
50  sprintf (cbuffer, "%s.idx", pcfilename);
51  unlink (cbuffer);
52  sprintf (cbuffer, "%s.dat", pcfilename);
53  unlink (cbuffer);
54  return ivbtranserase (pcfilename);
55 }
int ivbtranserase(const char *pcfilename)
Definition: istrans.c:777
char * cfilename
Definition: isinternal.h:422
void ivbclose3(const int ihandle)
Definition: isopen.c:125
int ivbmaxusedhandle
Definition: vblocking.c:26
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
Definition: exception.def:95
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int isclose(const int ihandle)
Definition: isopen.c:182

Here is the call graph for this function:

Here is the caller graph for this function:

int isflush ( const int  ihandle)

Definition at line 58 of file ishelper.c.

References DICTINFO::idatahandle, DICTINFO::iindexhandle, DICTINFO::iisopen, iserrno, ivbmaxusedhandle, and psvbfile.

Referenced by cob_sync().

59 {
60  struct DICTINFO *psvbptr;
61 
62  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
63  iserrno = EBADARG;
64  return -1;
65  }
66  psvbptr = psvbfile[ihandle];
67  if (!psvbptr || psvbptr->iisopen) {
68  iserrno = ENOTOPEN;
69  return -1;
70  }
71  if (psvbptr->iindexhandle >= 0) {
72  fsync (psvbptr->iindexhandle);
73  }
74  if (psvbptr->idatahandle >= 0) {
75  fsync (psvbptr->idatahandle);
76  }
77  return 0;
78 }
int iindexhandle
Definition: isinternal.h:406
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int idatahandle
Definition: isinternal.h:405
int iserrno
Definition: vbmemio.c:27

Here is the caller graph for this function:

int islock ( const int  ihandle)

Definition at line 81 of file ishelper.c.

References DICTINFO::iisopen, iserrno, ivbdatalock(), ivbmaxusedhandle, psvbfile, and VBWRLOCK.

82 {
83  struct DICTINFO *psvbptr;
84 
85  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
86  iserrno = EBADARG;
87  return -1;
88  }
89  psvbptr = psvbfile[ihandle];
90  if (!psvbptr || psvbptr->iisopen) {
91  iserrno = ENOTOPEN;
92  return -1;
93  }
94  return ivbdatalock (ihandle, VBWRLOCK, (off_t)0);
95 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
int ivbdatalock(const int ihandle, const int imode, const off_t trownumber)
Definition: vblocking.c:432
#define VBWRLOCK
Definition: isinternal.h:297
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

int isrelcurr ( const int  ihandle)

Definition at line 98 of file ishelper.c.

References DICTINFO::iisopen, iserrno, ivbdatalock(), ivbintrans, ivbmaxusedhandle, psvbfile, DICTINFO::trownumber, VBNOTRANS, and VBUNLOCK.

99 {
100  struct DICTINFO *psvbptr;
101 
102  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
103  iserrno = EBADARG;
104  return -1;
105  }
106  psvbptr = psvbfile[ihandle];
107  if (!psvbptr || psvbptr->iisopen) {
108  iserrno = ENOTOPEN;
109  return -1;
110  }
111  if (ivbintrans != VBNOTRANS) {
112  return 0;
113  }
114  if (!psvbptr->trownumber) {
115  iserrno = ENOREC;
116  return -1;
117  }
118  iserrno = ivbdatalock (ihandle, VBUNLOCK, psvbptr->trownumber);
119  if (iserrno) {
120  return -1;
121  }
122  return 0;
123 }
#define VBNOTRANS
Definition: isinternal.h:306
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
int ivbdatalock(const int ihandle, const int imode, const off_t trownumber)
Definition: vblocking.c:432
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
#define VBUNLOCK
Definition: isinternal.h:294
off_t trownumber
Definition: isinternal.h:416
int iserrno
Definition: vbmemio.c:27
int ivbintrans
Definition: istrans.c:23

Here is the call graph for this function:

int isrelease ( const int  ihandle)

Definition at line 126 of file ishelper.c.

References DICTINFO::iisopen, iserrno, ivbdatalock(), ivbintrans, ivbmaxusedhandle, psvbfile, VBNOTRANS, and VBUNLOCK.

Referenced by cob_file_unlock(), indexed_read(), indexed_read_next(), indexed_rewrite(), ircvcommit(), isread(), isstart(), and ivbclose2().

127 {
128  struct DICTINFO *psvbptr;
129 
130  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
131  iserrno = EBADARG;
132  return -1;
133  }
134  psvbptr = psvbfile[ihandle];
135  if (!psvbptr || psvbptr->iisopen) {
136  iserrno = ENOTOPEN;
137  return -1;
138  }
139  if (ivbintrans != VBNOTRANS) {
140  return 0;
141  }
142  ivbdatalock (ihandle, VBUNLOCK, (off_t)0); /* Ignore the return */
143  return 0;
144 }
#define VBNOTRANS
Definition: isinternal.h:306
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
int ivbdatalock(const int ihandle, const int imode, const off_t trownumber)
Definition: vblocking.c:432
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
#define VBUNLOCK
Definition: isinternal.h:294
int iserrno
Definition: vbmemio.c:27
int ivbintrans
Definition: istrans.c:23

Here is the call graph for this function:

Here is the caller graph for this function:

int isrelrec ( const int  ihandle,
const long long  trownumber 
)

Definition at line 147 of file ishelper.c.

References DICTINFO::iisopen, iserrno, ivbdatalock(), ivbmaxusedhandle, psvbfile, and VBUNLOCK.

148 {
149  struct DICTINFO *psvbptr;
150 
151  if (ihandle < 0 || ihandle > ivbmaxusedhandle) {
152  iserrno = EBADARG;
153  return -1;
154  }
155  psvbptr = psvbfile[ihandle];
156  if (!psvbptr || psvbptr->iisopen) {
157  iserrno = ENOTOPEN;
158  return -1;
159  }
160  iserrno = ivbdatalock (ihandle, VBUNLOCK, trownumber);
161  if (iserrno) {
162  return -1;
163  }
164  return 0;
165 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
int ivbdatalock(const int ihandle, const int imode, const off_t trownumber)
Definition: vblocking.c:432
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
#define VBUNLOCK
Definition: isinternal.h:294
off_t trownumber
Definition: isinternal.h:416
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

int isrename ( char *  pcoldname,
char *  pcnewname 
)

Definition at line 168 of file ishelper.c.

References iserrno, and ivbtransrename().

Referenced by ircvfilerename().

169 {
170  int iresult;
171  char cbuffer[2][1024];
172 
173  sprintf (cbuffer[0], "%s.idx", pcoldname);
174  sprintf (cbuffer[1], "%s.idx", pcnewname);
175  iresult = rename (cbuffer[0], cbuffer[1]);
176  if (iresult == -1) {
177  goto renameexit;
178  }
179  sprintf (cbuffer[0], "%s.dat", pcoldname);
180  sprintf (cbuffer[1], "%s.dat", pcnewname);
181  iresult = rename (cbuffer[0], cbuffer[1]);
182  if (iresult == -1) {
183  sprintf (cbuffer[0], "%s.idx", pcoldname);
184  sprintf (cbuffer[1], "%s.idx", pcnewname);
185  rename (cbuffer[1], cbuffer[0]);
186  goto renameexit;
187  }
188  return ivbtransrename (pcoldname, pcnewname);
189 renameexit:
190  iserrno = errno;
191  return -1;
192 }
int ivbtransrename(char *pcoldname, char *pcnewname)
Definition: istrans.c:914
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

Here is the caller graph for this function:

int issetunique ( const int  ihandle,
const long long  tuniqueid 
)

Definition at line 195 of file ishelper.c.

References DICTNODE::cuniqueid, DICTINFO::iisdictlocked, inl_ldquad(), inl_stquad(), iserrno, ivbenter(), ivbexit(), ivbtranssetunique(), psvbfile, and DICTINFO::sdictnode.

Referenced by ircvsetunique().

196 {
197  struct DICTINFO *psvbptr;
198  off_t tvalue;
199  int iresult, iresult2;
200 
201  if (ivbenter (ihandle, 1, 0)) {
202  return -1;
203  }
204  psvbptr = psvbfile[ihandle];
205  iserrno = 0;
206  if (!psvbptr->iisdictlocked) {
207  iserrno = EBADARG;
208  return -1;
209  }
210  tvalue = inl_ldquad (psvbptr->sdictnode.cuniqueid);
211  if (tuniqueid > tvalue) {
212  inl_stquad (tuniqueid, psvbptr->sdictnode.cuniqueid);
213  psvbptr->iisdictlocked |= 0x02;
214  }
215 
216  iresult = ivbtranssetunique (ihandle, tuniqueid);
217  psvbptr->iisdictlocked |= 0x02;
218  iresult2 = ivbexit (ihandle);
219  if (iresult) {
220  return -1;
221  }
222  return iresult2;
223 }
int ivbtranssetunique(const int ihandle, const off_t tuniqueid)
Definition: istrans.c:948
char cuniqueid[8]
Definition: isinternal.h:378
int ivbenter(const int ihandle, const unsigned int imodifying, const unsigned int ispecial)
Definition: vblocking.c:178
unsigned char iisdictlocked
Definition: isinternal.h:427
struct DICTNODE sdictnode
Definition: isinternal.h:444
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int ivbexit(const int ihandle)
Definition: vblocking.c:290
static void inl_stquad(off_t tvalue, void *pclocation)
Definition: isinternal.h:260
static off_t inl_ldquad(void *pclocation)
Definition: isinternal.h:238
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

Here is the caller graph for this function:

int isuniqueid ( const int  ihandle,
long long *  ptuniqueid 
)

Definition at line 226 of file ishelper.c.

References DICTNODE::cuniqueid, DICTINFO::iisdictlocked, inl_ldquad(), inl_stquad(), iserrno, ivbenter(), ivbexit(), ivbtransuniqueid(), psvbfile, and DICTINFO::sdictnode.

Referenced by ircvuniqueid().

227 {
228  struct DICTINFO *psvbptr;
229  off_t tvalue;
230  int iresult;
231  int iresult2;
232 
233  if (ivbenter (ihandle, 1, 0)) {
234  return -1;
235  }
236 
237  psvbptr = psvbfile[ihandle];
238  iserrno = 0;
239  if (!psvbptr->iisdictlocked) {
240  iserrno = EBADARG;
241  return -1;
242  }
243  tvalue = inl_ldquad (psvbptr->sdictnode.cuniqueid);
244  inl_stquad (tvalue + 1, psvbptr->sdictnode.cuniqueid);
245  psvbptr->iisdictlocked |= 0x02;
246  iresult = ivbtransuniqueid (ihandle, tvalue);
247  iresult2 = ivbexit (ihandle);
248  if (iresult) {
249  return -1;
250  }
251  *ptuniqueid = tvalue;
252  return iresult2;
253 }
char cuniqueid[8]
Definition: isinternal.h:378
int ivbenter(const int ihandle, const unsigned int imodifying, const unsigned int ispecial)
Definition: vblocking.c:178
unsigned char iisdictlocked
Definition: isinternal.h:427
struct DICTNODE sdictnode
Definition: isinternal.h:444
int ivbtransuniqueid(const int ihandle, const off_t tuniqueid)
Definition: istrans.c:981
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
int ivbexit(const int ihandle)
Definition: vblocking.c:290
static void inl_stquad(off_t tvalue, void *pclocation)
Definition: isinternal.h:260
static off_t inl_ldquad(void *pclocation)
Definition: isinternal.h:238
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

Here is the caller graph for this function:

int isunlock ( const int  ihandle)

Definition at line 256 of file ishelper.c.

References DICTINFO::iisopen, iserrno, ivbdatalock(), ivbmaxusedhandle, psvbfile, unlikely, and VBUNLOCK.

257 {
258  struct DICTINFO *psvbptr;
259 
260  if (unlikely(ihandle < 0 || ihandle > ivbmaxusedhandle)) {
261  iserrno = EBADARG;
262  return -1;
263  }
264  psvbptr = psvbfile[ihandle];
265  if (!psvbptr || psvbptr->iisopen) {
266  iserrno = ENOTOPEN;
267  return -1;
268  }
269  return ivbdatalock (ihandle, VBUNLOCK, (off_t)0);
270 }
int ivbmaxusedhandle
Definition: vblocking.c:26
int iisopen
Definition: isinternal.h:407
#define unlikely(x)
Definition: common.h:437
int ivbdatalock(const int ihandle, const int imode, const off_t trownumber)
Definition: vblocking.c:432
struct DICTINFO * psvbfile[128+1]
Definition: vblowlevel.c:23
#define VBUNLOCK
Definition: isinternal.h:294
int iserrno
Definition: vbmemio.c:27

Here is the call graph for this function:

void ldchar ( char *  pcsource,
int  ilength,
char *  pcdestination 
)

Definition at line 381 of file ishelper.c.

382 {
383  char *pcdst;
384 
385  memcpy ((void *)pcdestination, (void *)pcsource, (size_t)ilength);
386  for (pcdst = pcdestination + ilength - 1; pcdst >= (char *)pcdestination; pcdst--) {
387  if (*pcdst != ' ') {
388  pcdst++;
389  *pcdst = 0;
390  return;
391  }
392  }
393  *(++pcdst) = 0;
394 }
double lddbl ( void *  pclocation)

Definition at line 504 of file ishelper.c.

Referenced by ivbkeycompare(), and lddblnull().

505 {
506  double ddouble;
507 
508  memcpy (&ddouble, pclocation, DOUBLESIZE);
509  return ddouble;
510 }

Here is the caller graph for this function:

double lddblnull ( void *  pclocation,
short *  pinullflag 
)

Definition at line 519 of file ishelper.c.

References lddbl().

520 {
521  *pinullflag = 0;
522  return (lddbl (pclocation));
523 }
double lddbl(void *pclocation)
Definition: ishelper.c:504

Here is the call graph for this function:

double ldfloat ( void *  pclocation)

Definition at line 465 of file ishelper.c.

Referenced by ivbkeycompare(), and ldfltnull().

466 {
467  float ffloat;
468  double ddouble;
469 
470  memcpy (&ffloat, pclocation, FLOATSIZE);
471  ddouble = ffloat;
472  return (double)ddouble;
473 }

Here is the caller graph for this function:

double ldfltnull ( void *  pclocation,
short *  pinullflag 
)

Definition at line 485 of file ishelper.c.

References ldfloat().

486 {
487  double dvalue;
488 
489  *pinullflag = 0;
490  dvalue = ldfloat (pclocation);
491  return (double)dvalue;
492 }
double ldfloat(void *pclocation)
Definition: ishelper.c:465

Here is the call graph for this function:

int ldint ( void *  pclocation)

Definition at line 413 of file ishelper.c.

References VB_BSWAP_16.

414 {
415 #ifndef WORDS_BIGENDIAN
416  return (int)VB_BSWAP_16 (*(unsigned short *)pclocation);
417 #else
418  short ivalue = 0;
419  unsigned char *pctemp = (unsigned char *)&ivalue;
420  unsigned char *pctemp2 = (unsigned char *)pclocation;
421 
422  *(pctemp + 0) = *(pctemp2 + 0);
423  *(pctemp + 1) = *(pctemp2 + 1);
424  return (int)ivalue;
425 #endif
426 }
#define VB_BSWAP_16(val)
Definition: byteswap.h:184
int ldlong ( void *  pclocation)

Definition at line 442 of file ishelper.c.

References VB_BSWAP_32.

443 {
444 #ifndef WORDS_BIGENDIAN
445  return VB_BSWAP_32 (*(unsigned int *)pclocation);
446 #else
447  int lvalue;
448 
449  memcpy ((unsigned char *)&lvalue, (unsigned char *)pclocation, 4);
450  return lvalue;
451 #endif
452 }
#define VB_BSWAP_32(val)
Definition: byteswap.h:185
void stchar ( char *  pcsource,
char *  pcdestination,
int  ilength 
)

Definition at line 397 of file ishelper.c.

398 {
399  char *pcsrc, *pcdst;
400  int icount;
401 
402  pcsrc = pcsource;
403  pcdst = pcdestination;
404  for (icount = ilength; icount && *pcsrc; icount--, pcsrc++, pcdst++) {
405  *pcdst = *pcsrc;
406  }
407  for (; icount; icount--, pcdst++) {
408  *pcdst = ' ';
409  }
410 }
void stdbl ( double  dsource,
void *  pcdestination 
)

Definition at line 513 of file ishelper.c.

Referenced by stdblnull(), and vvbkeyvalueset().

514 {
515  memcpy (pcdestination, &dsource, DOUBLESIZE);
516 }

Here is the caller graph for this function:

void stdblnull ( double  dsource,
void *  pcdestination,
int  inullflag 
)

Definition at line 526 of file ishelper.c.

References stdbl().

527 {
528  if (inullflag) {
529  dsource = 0;
530  }
531  stdbl (dsource, pcdestination);
532 }
void stdbl(double dsource, void *pcdestination)
Definition: ishelper.c:513

Here is the call graph for this function:

void stfloat ( double  dsource,
void *  pcdestination 
)

Definition at line 476 of file ishelper.c.

Referenced by stfltnull(), and vvbkeyvalueset().

477 {
478  float ffloat;
479 
480  ffloat = dsource;
481  memcpy (pcdestination, &ffloat, FLOATSIZE);
482 }

Here is the caller graph for this function:

void stfltnull ( double  dsource,
void *  pcdestination,
int  inullflag 
)

Definition at line 495 of file ishelper.c.

References stfloat().

496 {
497  if (inullflag) {
498  dsource = 0;
499  }
500  stfloat (dsource, pcdestination);
501 }
void stfloat(double dsource, void *pcdestination)
Definition: ishelper.c:476

Here is the call graph for this function:

void stint ( int  ivalue,
void *  pclocation 
)

Definition at line 429 of file ishelper.c.

References VB_BSWAP_16.

430 {
431 #ifndef WORDS_BIGENDIAN
432  *(unsigned short *)pclocation = VB_BSWAP_16 ((unsigned short)ivalue);
433 #else
434  unsigned char *pctemp = (unsigned char *)&ivalue;
435 
436  *((unsigned char *)pclocation + 0) = *(pctemp + 0 + INTSIZE);
437  *((unsigned char *)pclocation + 1) = *(pctemp + 1 + INTSIZE);
438 #endif
439 }
#define VB_BSWAP_16(val)
Definition: byteswap.h:184
void stlong ( int  lvalue,
void *  pclocation 
)

Definition at line 455 of file ishelper.c.

References VB_BSWAP_32.

456 {
457 #ifndef WORDS_BIGENDIAN
458  *(unsigned int *)pclocation = VB_BSWAP_32 ((unsigned int)lvalue);
459 #else
460  memcpy ((unsigned char *)pclocation, (unsigned char *)&lvalue, 4);
461 #endif
462 }
#define VB_BSWAP_32(val)
Definition: byteswap.h:185