GnuCOBOL  2.0
A free COBOL compiler
common.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2012, 2014-2016 Free Software Foundation, Inc.
3  Written by Keisuke Nishida, Roger While, Simon Sobisch, Ron Norman
4 
5  This file is part of GnuCOBOL.
6 
7  The GnuCOBOL runtime library is free software: you can redistribute it
8  and/or modify it under the terms of the GNU Lesser General Public License
9  as published by the Free Software Foundation, either version 3 of the
10  License, or (at your option) any later version.
11 
12  GnuCOBOL is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GnuCOBOL. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef COB_COMMON_H
22 #define COB_COMMON_H
23 
24 /* General type defines */
25 #define cob_c8_t char
26 #define cob_s8_t signed char
27 #define cob_u8_t unsigned char
28 #define cob_s16_t short
29 #define cob_u16_t unsigned short
30 #define cob_s32_t int
31 #define cob_u32_t unsigned int
32 #define cob_sli_t long int
33 #define cob_uli_t unsigned long int
34 
35 #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__)
36 
37 #define cob_s64_t __int64
38 #define cob_u64_t unsigned __int64
39 
40 #define COB_S64_C(x) x ## I64
41 #define COB_U64_C(x) x ## UI64
42 #define CB_FMT_LLD "%I64d"
43 #define CB_FMT_LLU "%I64u"
44 #define CB_FMT_PLLD "%+*.*I64d"
45 #define CB_FMT_PLLU "%*.*I64u"
46 #define CB_FMT_LLD_F "%I64dI64"
47 #define CB_FMT_LLU_F "%I64uUI64"
48 
49 #else
50 
51 #define cob_s64_t long long
52 #define cob_u64_t unsigned long long
53 
54 #define COB_S64_C(x) x ## LL
55 #define COB_U64_C(x) x ## ULL
56 #define CB_FMT_LLD "%lld"
57 #define CB_FMT_LLU "%llu"
58 #define CB_FMT_PLLD "%+*.*lld"
59 #define CB_FMT_PLLU "%*.*llu"
60 #define CB_FMT_LLD_F "%lldLL"
61 #define CB_FMT_LLU_F "%lluULL"
62 
63 #endif
64 
65 #define cob_c8_ptr cob_c8_t *
66 #define cob_u8_ptr cob_u8_t *
67 #define cob_s8_ptr cob_s8_t *
68 #define cob_u16_ptr cob_u16_t *
69 #define cob_s16_ptr cob_s16_t *
70 #define cob_u32_ptr cob_u32_t *
71 #define cob_s32_ptr cob_s32_t *
72 #define cob_u64_ptr cob_u64_t *
73 #define cob_s64_ptr cob_s64_t *
74 
75 #define cob_void_ptr void *
76 #define cob_field_ptr cob_field *
77 #define cob_file_ptr cob_file *
78 #define cob_module_ptr cob_module *
79 #define cob_screen_ptr cob_screen *
80 #define cob_file_key_ptr cob_file_key *
81 
82 /* Readable compiler version defines */
83 
84 #if defined(_MSC_VER)
85 #if _MSC_VER >= 1400
86 #define COB_USE_VC2005_OR_GREATER 1
87 #else
88 #define COB_USE_VC2005_OR_GREATER 0
89 #endif
90 
91 #if _MSC_VER >= 1500
92 #define COB_USE_VC2008_OR_GREATER 1
93 #else
94 #define COB_USE_VC2008_OR_GREATER 0
95 #endif
96 
97 #if _MSC_VER >= 1800
98 #define COB_USE_VC2013_OR_GREATER 1
99 #else
100 #define COB_USE_VC2013_OR_GREATER 0
101 #endif
102 #endif
103 
104 /* Byte swap functions */
105 
106 /*
107  The original idea for the byteswap routines was taken from GLib.
108  (Specifically glib/gtypes.h)
109  GLib is licensed under the GNU Lesser General Public License.
110 */
111 
112 /* Generic swapping functions */
113 
114 #undef COB_BSWAP_16_CONSTANT
115 #undef COB_BSWAP_32_CONSTANT
116 #undef COB_BSWAP_64_CONSTANT
117 #undef COB_BSWAP_16
118 #undef COB_BSWAP_32
119 #undef COB_BSWAP_64
120 
121 #define COB_BSWAP_16_CONSTANT(val) ((cob_u16_t) ( \
122  (((cob_u16_t)(val) & (cob_u16_t) 0x00FFU) << 8) | \
123  (((cob_u16_t)(val) & (cob_u16_t) 0xFF00U) >> 8)))
124 
125 #define COB_BSWAP_32_CONSTANT(val) ((cob_u32_t) ( \
126  (((cob_u32_t) (val) & (cob_u32_t) 0x000000FFU) << 24) | \
127  (((cob_u32_t) (val) & (cob_u32_t) 0x0000FF00U) << 8) | \
128  (((cob_u32_t) (val) & (cob_u32_t) 0x00FF0000U) >> 8) | \
129  (((cob_u32_t) (val) & (cob_u32_t) 0xFF000000U) >> 24)))
130 
131 #define COB_BSWAP_64_CONSTANT(val) ((cob_u64_t) ( \
132  (((cob_u64_t) (val) & \
133  (cob_u64_t) COB_U64_C(0x00000000000000FF)) << 56) | \
134  (((cob_u64_t) (val) & \
135  (cob_u64_t) COB_U64_C(0x000000000000FF00)) << 40) | \
136  (((cob_u64_t) (val) & \
137  (cob_u64_t) COB_U64_C(0x0000000000FF0000)) << 24) | \
138  (((cob_u64_t) (val) & \
139  (cob_u64_t) COB_U64_C(0x00000000FF000000)) << 8) | \
140  (((cob_u64_t) (val) & \
141  (cob_u64_t) COB_U64_C(0x000000FF00000000)) >> 8) | \
142  (((cob_u64_t) (val) & \
143  (cob_u64_t) COB_U64_C(0x0000FF0000000000)) >> 24) | \
144  (((cob_u64_t) (val) & \
145  (cob_u64_t) COB_U64_C(0x00FF000000000000)) >> 40) | \
146  (((cob_u64_t) (val) & \
147  (cob_u64_t) COB_U64_C(0xFF00000000000000)) >> 56)))
148 
149 /* Machine/OS specific overrides */
150 
151 #ifdef __GNUC__
152 
153 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
154 
155 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
156 #define COB_BSWAP_32(val) (__builtin_bswap32 (val))
157 #define COB_BSWAP_64(val) (__builtin_bswap64 (val))
158 
159 #elif defined(__i386__)
160 
161 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
162 #define COB_BSWAP_32(val) \
163  (__extension__ \
164  ({ register cob_u32_t __v, \
165  __x = ((cob_u32_t) (val)); \
166  if (__builtin_constant_p (__x)) \
167  __v = COB_BSWAP_32_CONSTANT (__x); \
168  else \
169  __asm__ ("bswap %0" \
170  : "=r" (__v) \
171  : "0" (__x)); \
172  __v; }))
173 #define COB_BSWAP_64(val) \
174  (__extension__ \
175  ({ union { cob_u64_t __ll; \
176  cob_u32_t __l[2]; } __w, __r; \
177  __w.__ll = ((cob_u64_t) (val)); \
178  if (__builtin_constant_p (__w.__ll)) \
179  __r.__ll = COB_BSWAP_64_CONSTANT (__w.__ll); \
180  else \
181  { \
182  __r.__l[0] = COB_BSWAP_32 (__w.__l[1]); \
183  __r.__l[1] = COB_BSWAP_32 (__w.__l[0]); \
184  } \
185  __r.__ll; }))
186 
187 #elif defined (__ia64__)
188 
189 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
190 #define COB_BSWAP_32(val) \
191  (__extension__ \
192  ({ register cob_u32_t __v, \
193  __x = ((cob_u32_t) (val)); \
194  if (__builtin_constant_p (__x)) \
195  __v = COB_BSWAP_32_CONSTANT (__x); \
196  else \
197  __asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
198  "mux1 %0 = %0, @rev ;;" \
199  : "=r" (__v) \
200  : "r" (__x)); \
201  __v; }))
202 #define COB_BSWAP_64(val) \
203  (__extension__ \
204  ({ register cob_u64_t __v, \
205  __x = ((cob_u64_t) (val)); \
206  if (__builtin_constant_p (__x)) \
207  __v = COB_BSWAP_64_CONSTANT (__x); \
208  else \
209  __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
210  : "=r" (__v) \
211  : "r" (__x)); \
212  __v; }))
213 
214 #elif defined (__x86_64__)
215 
216 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
217 #define COB_BSWAP_32(val) \
218  (__extension__ \
219  ({ register cob_u32_t __v, \
220  __x = ((cob_u32_t) (val)); \
221  if (__builtin_constant_p (__x)) \
222  __v = COB_BSWAP_32_CONSTANT (__x); \
223  else \
224  __asm__ ("bswapl %0" \
225  : "=r" (__v) \
226  : "0" (__x)); \
227  __v; }))
228 #define COB_BSWAP_64(val) \
229  (__extension__ \
230  ({ register cob_u64_t __v, \
231  __x = ((cob_u64_t) (val)); \
232  if (__builtin_constant_p (__x)) \
233  __v = COB_BSWAP_64_CONSTANT (__x); \
234  else \
235  __asm__ ("bswapq %0" \
236  : "=r" (__v) \
237  : "0" (__x)); \
238  __v; }))
239 
240 #else /* Generic gcc */
241 
242 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
243 #define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val))
244 #define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val))
245 
246 #endif
247 
248 #elif defined(_MSC_VER) && COB_USE_VC2005_OR_GREATER
249 
250 #define COB_BSWAP_16(val) (_byteswap_ushort (val))
251 #define COB_BSWAP_32(val) (_byteswap_ulong (val))
252 #define COB_BSWAP_64(val) (_byteswap_uint64 (val))
253 
254 #else /* Generic */
255 
256 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val))
257 #define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val))
258 #define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val))
259 
260 #endif
261 
262 /* End byte swap functions */
263 
264 /* Compiler characteristics */
265 
266 #ifdef _MSC_VER
267 
268 #ifndef _CRT_SECURE_NO_DEPRECATE
269 #define _CRT_SECURE_NO_DEPRECATE 1
270 #endif
271 #include <malloc.h>
272 #include <io.h>
273 #include <fcntl.h>
274 
275 /* Disable certain warnings */
276 /* Deprecated functions */
277 #pragma warning(disable: 4996)
278 /* Function declarations without parameter list */
279 #pragma warning(disable: 4255)
280 
281 #define strncasecmp _strnicmp
282 #define strcasecmp _stricmp
283 #define snprintf _snprintf
284 #define getpid _getpid
285 #define access _access
286 #if defined COB_USE_VC2005_OR_GREATER
287 /* remark: _putenv_s always overwrites, add a check for overwrite = 1 if necessary later*/
288 #define setenv(name,value,overwrite) _putenv_s(name,value)
289 #define unsetenv(name) _putenv_s(name,"")
290 #endif
291 #if defined COB_USE_VC2013_OR_GREATER
292 #define timezone _timezone
293 #endif
294 
295 #define __attribute__(x)
296 
297 #ifdef S_ISDIR
298 #undef S_ISDIR
299 #endif
300 #define S_ISDIR(x) (((x) & _S_IFMT) == _S_IFDIR)
301 
302 #ifdef S_ISREG
303 #undef S_ISREG
304 #endif
305 #define S_ISREG(x) (((x) & _S_IFMT) == _S_IFREG)
306 
307 #ifndef _M_IA64
308 #ifdef _WIN64
309 #define __x86_64__
310 #else
311 #define __i386__
312 #endif
313 #endif
314 
315 #endif
316 
317 #ifdef __BORLANDC__
318 #include <io.h>
319 #define _timeb timeb
320 #define _ftime(a) ftime(a)
321 #define strncasecmp strnicmp
322 #define strcasecmp stricmp
323 #define _setmode setmode
324 #define _chdir chdir
325 #endif
326 
327 #include <setjmp.h>
328 
329 #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__clang__)
330 #ifdef COB_LIB_EXPIMP
331  #define COB_EXPIMP __declspec(dllexport) extern
332 #else
333  #define COB_EXPIMP __declspec(dllimport) extern
334 #endif
335 #else
336  #define COB_EXPIMP extern
337 #endif
338 
339 #if defined(__370__) || defined(_MSC_VER) || defined(__DECC) || \
340  defined(__BORLANDC__) || defined(__WATCOMC__)
341  #define COB_INLINE __inline
342 #elif defined(__INTEL_COMPILER)
343  /* icc */
344  #define COB_INLINE inline
345 #elif defined(__GNUC__)
346  /* gcc */
347  #define COB_INLINE __inline__
348 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 199900L
349  /* C99 and C++ */
350  #define COB_INLINE inline
351 #elif defined(COB_KEYWORD_INLINE)
352  #define COB_INLINE COB_KEYWORD_INLINE
353 #else
354  #define COB_INLINE
355 #endif
356 
357 /* Also OK for icc which defines __GNUC__ */
358 
359 #if defined(__GNUC__) || (defined(__xlc__) && __IBMC__ >= 700)
360 #define COB_A_NORETURN __attribute__((noreturn))
361 #define COB_A_FORMAT12 __attribute__((format(printf, 1, 2)))
362 #define COB_A_FORMAT23 __attribute__((format(printf, 2, 3)))
363 #define COB_A_FORMAT34 __attribute__((format(printf, 3, 4)))
364 #define COB_A_FORMAT45 __attribute__((format(printf, 4, 5)))
365 #else
366 #define COB_A_NORETURN
367 #define COB_A_FORMAT12
368 #define COB_A_FORMAT23
369 #define COB_A_FORMAT34
370 #define COB_A_FORMAT45
371 #endif
372 
373 #ifdef _MSC_VER
374 #define DECLNORET __declspec(noreturn)
375 #else
376 #define DECLNORET
377 #endif
378 
379 #if defined(__GNUC__)
380 #define optim_memcpy(x,y,z) __builtin_memcpy (x, y, z)
381 #else
382 #define optim_memcpy(x,y,z) memcpy (x, y, z)
383 #endif
384 
385 #if defined(__GNUC__) && (__GNUC__ >= 3)
386 #define likely(x) __builtin_expect((long int)!!(x), 1L)
387 #define unlikely(x) __builtin_expect((long int)!!(x), 0L)
388 #define COB_A_MALLOC __attribute__((malloc))
389 #define COB_HAVE_STEXPR 1
390 
391 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
392 #define COB_NOINLINE __attribute__((noinline))
393 #define COB_A_INLINE __attribute__((always_inline))
394 #else
395 #define COB_NOINLINE
396 #define COB_A_INLINE
397 #endif
398 
399 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
400 #define COB_A_COLD __attribute__((cold))
401 #else
402 #define COB_A_COLD
403 #endif
404 
405 #elif defined(__xlc__) && __IBMC__ >= 700
406 
407 #if __IBMC__ >= 900
408 #define likely(x) __builtin_expect((long int)!!(x), 1L)
409 #define unlikely(x) __builtin_expect((long int)!!(x), 0L)
410 #else
411 #define likely(x) (x)
412 #define unlikely(x) (x)
413 #endif
414 #define COB_NOINLINE __attribute__((noinline))
415 #define COB_A_INLINE __attribute__((always_inline))
416 #define COB_A_MALLOC
417 #define COB_A_COLD
418 #if __IBMC__ >= 800
419 #define COB_HAVE_STEXPR 1
420 #else
421 #undef COB_HAVE_STEXPR
422 #endif
423 
424 #elif defined(__SUNPRO_C) && __SUNPRO_C >= 0x590
425 
426 #define likely(x) (x)
427 #define unlikely(x) (x)
428 #define COB_A_MALLOC __attribute__((malloc))
429 #define COB_NOINLINE __attribute__((noinline))
430 #define COB_A_INLINE __attribute__((always_inline))
431 #define COB_A_COLD
432 #define COB_HAVE_STEXPR 1
433 
434 #else
435 
436 #define likely(x) (x)
437 #define unlikely(x) (x)
438 #define COB_A_MALLOC
439 #define COB_NOINLINE
440 #define COB_A_INLINE
441 #define COB_A_COLD
442 #undef COB_HAVE_STEXPR
443 
444 #endif
445 
446 /* Prevent unwanted verbosity when using icc */
447 #ifdef __INTEL_COMPILER
448 
449 /* Unreachable code */
450 #pragma warning ( disable : 111 )
451 /* Declared but never referenced */
452 #pragma warning ( disable : 177 )
453 /* Format conversion */
454 #pragma warning ( disable : 181 )
455 /* Enumerated type mixed with other type */
456 #pragma warning ( disable : 188 )
457 /* #undefine tested for zero */
458 #pragma warning ( disable : 193 )
459 /* Set but not used */
460 #pragma warning ( disable : 593 )
461 /* Parameter not referenced */
462 #pragma warning ( disable : 869 )
463 /* Operands are evaluated in unspecified order */
464 #pragma warning ( disable : 981 )
465 /* Missing return at end of non-void function */
466 /* Note - occurs because we have a non-returning abort call in cobc */
467 #pragma warning ( disable : 1011 )
468 /* Declaration in same source as definition */
469 #pragma warning ( disable : 1419 )
470 /* Shadowed variable - 1599 and 1944 are essentially the same */
471 #pragma warning ( disable : 1599 )
472 #pragma warning ( disable : 1944 )
473 /* Possible loss of precision */
474 #pragma warning ( disable : 2259 )
475 
476 #endif
477 
478 #if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__amd64__)
479  #define COB_NON_ALIGNED
480  /* Some DEC Alphas can only load shorts at 4-byte aligned addresses */
481  #ifdef __alpha
482  #define COB_SHORT_BORK
483  #endif
484  #if defined(_MSC_VER)
485  #define COB_ALLOW_UNALIGNED
486  #else
487  #define __unaligned
488  #endif
489 #else
490  #define COB_ALLOW_UNALIGNED
491  #define __unaligned
492 #endif
493 
494 
495 
496 #if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__)
497 #define PATHSEP_CHAR (char) ';'
498 #define PATHSEP_STR (char *) ";"
499 #else
500 #define PATHSEP_CHAR (char) ':'
501 #define PATHSEP_STR (char *) ":"
502 #endif
503 
504 #ifndef _WIN32
505 #define SLASH_CHAR (char) '/'
506 #define SLASH_STR (char *) "/"
507 #else
508 #define SLASH_CHAR (char) '\\'
509 #define SLASH_STR (char *) "\\"
510 #endif
511 
512 /* End compiler stuff */
513 
514 /* EBCDIC determination */
515 
516 #if ' ' == 0x40
517 #define COB_EBCDIC_MACHINE
518 #else
519 #undef COB_EBCDIC_MACHINE
520 #endif
521 
522 /* Macro to prevent compiler warning "conditional expression is constant" */
523 #if defined (_MSC_VER) && _MSC_VER >= 1500
524 #define ONCE_COB \
525 __pragma( warning(push) ) \
526 __pragma( warning(disable:4127) ) \
527 while (0) \
528 __pragma( warning(pop) )
529 #else
530 #define ONCE_COB while (0)
531 #endif
532 
533 /* Macro to prevent unused parameter warning */
534 
535 #define COB_UNUSED(z) do { (void)(z); } ONCE_COB
536 
537 /* Buffer size definitions */
538 
539 #define COB_MINI_BUFF 256
540 #define COB_SMALL_BUFF 1024
541 #define COB_NORMAL_BUFF 2048
542 #define COB_FILE_BUFF 4096
543 #define COB_MEDIUM_BUFF 8192
544 #define COB_LARGE_BUFF 16384
545 #define COB_MINI_MAX (COB_MINI_BUFF - 1)
546 #define COB_SMALL_MAX (COB_SMALL_BUFF - 1)
547 #define COB_NORMAL_MAX (COB_NORMAL_BUFF - 1)
548 #define COB_FILE_MAX (COB_FILE_BUFF - 1)
549 #define COB_MEDIUM_MAX (COB_MEDIUM_BUFF - 1)
550 #define COB_LARGE_MAX (COB_LARGE_BUFF - 1)
551 
552 /* Perform stack size */
553 #define COB_STACK_SIZE 255
554 
555 /* Maximum size of file records */
556 #define MAX_FD_RECORD 65535
557 
558 /* Maximum number of parameters, possible values: 16,36,56,76,96 */
559 #define COB_MAX_FIELD_PARAMS 36 /* ToDo: move to config.h */
560 
561 /* Maximum number of field digits */
562 #define COB_MAX_DIGITS 38
563 
564 /* Maximum digits in binary field */
565 #define COB_MAX_BINARY 39
566 
567 /* Maximum digits in binary field */
568 #define COB_MAX_FIELD_SIZE 268435456
569 
570 /* Maximum number of cob_decimal structures */
571 #define COB_MAX_DEC_STRUCT 32
572 
573 /* Maximum length of COBOL words */
574 #define COB_MAX_WORDLEN 61
575 
576 /* Memory size for sorting */
577 #define COB_SORT_MEMORY 128 * 1024 * 1024
578 #define COB_SORT_CHUNK 256 * 1024
579 
580 /* Program return types */
581 #define COB_RET_TYPE_INT 0
582 #define COB_RET_TYPE_PTR 1
583 #define COB_RET_TYPE_VOID 2
584 
585 /* Fold case types */
586 #define COB_FOLD_UPPER 1
587 #define COB_FOLD_LOWER 2
588 
589 /* Locale types */
590 #define COB_LC_COLLATE 0
591 #define COB_LC_CTYPE 1
592 #define COB_LC_MESSAGES 2
593 #define COB_LC_MONETARY 3
594 #define COB_LC_NUMERIC 4
595 #define COB_LC_TIME 5
596 #define COB_LC_ALL 6
597 #define COB_LC_USER 7
598 #define COB_LC_CLASS 8
599 
600 /* Field types */
601 
602 #define COB_TYPE_UNKNOWN 0x00
603 #define COB_TYPE_GROUP 0x01U
604 #define COB_TYPE_BOOLEAN 0x02U
605 
606 #define COB_TYPE_NUMERIC 0x10U
607 #define COB_TYPE_NUMERIC_DISPLAY 0x10U
608 #define COB_TYPE_NUMERIC_BINARY 0x11U
609 #define COB_TYPE_NUMERIC_PACKED 0x12U
610 #define COB_TYPE_NUMERIC_FLOAT 0x13U
611 #define COB_TYPE_NUMERIC_DOUBLE 0x14U
612 #define COB_TYPE_NUMERIC_L_DOUBLE 0x15U
613 #define COB_TYPE_NUMERIC_FP_DEC64 0x16U
614 #define COB_TYPE_NUMERIC_FP_DEC128 0x17U
615 #define COB_TYPE_NUMERIC_FP_BIN32 0x18U
616 #define COB_TYPE_NUMERIC_FP_BIN64 0x19U
617 #define COB_TYPE_NUMERIC_FP_BIN128 0x1AU
618 
619 #define COB_TYPE_NUMERIC_EDITED 0x24U
620 
621 #define COB_TYPE_ALPHANUMERIC 0x21U
622 #define COB_TYPE_ALPHANUMERIC_ALL 0x22U
623 #define COB_TYPE_ALPHANUMERIC_EDITED 0x23U
624 
625 #define COB_TYPE_NATIONAL 0x40U
626 #define COB_TYPE_NATIONAL_EDITED 0x41U
627 
628 /* Field flags */
629 
630 #define COB_FLAG_HAVE_SIGN (1U << 0) /* 0x0001 */
631 #define COB_FLAG_SIGN_SEPARATE (1U << 1) /* 0x0002 */
632 #define COB_FLAG_SIGN_LEADING (1U << 2) /* 0x0004 */
633 #define COB_FLAG_BLANK_ZERO (1U << 3) /* 0x0008 */
634 #define COB_FLAG_JUSTIFIED (1U << 4) /* 0x0010 */
635 #define COB_FLAG_BINARY_SWAP (1U << 5) /* 0x0020 */
636 #define COB_FLAG_REAL_BINARY (1U << 6) /* 0x0040 */
637 #define COB_FLAG_IS_POINTER (1U << 7) /* 0x0080 */
638 #define COB_FLAG_NO_SIGN_NIBBLE (1U << 8) /* 0x0100 */
639 #define COB_FLAG_IS_FP (1U << 9) /* 0x0200 */
640 #define COB_FLAG_REAL_SIGN (1U << 10) /* 0x0400 */
641 #define COB_FLAG_BINARY_TRUNC (1U << 11) /* 0x0800 */
642 
643 #define COB_FIELD_HAVE_SIGN(f) ((f)->attr->flags & COB_FLAG_HAVE_SIGN)
644 #define COB_FIELD_SIGN_SEPARATE(f) ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE)
645 #define COB_FIELD_SIGN_LEADING(f) ((f)->attr->flags & COB_FLAG_SIGN_LEADING)
646 #define COB_FIELD_BLANK_ZERO(f) ((f)->attr->flags & COB_FLAG_BLANK_ZERO)
647 #define COB_FIELD_JUSTIFIED(f) ((f)->attr->flags & COB_FLAG_JUSTIFIED)
648 #define COB_FIELD_BINARY_SWAP(f) ((f)->attr->flags & COB_FLAG_BINARY_SWAP)
649 #define COB_FIELD_REAL_BINARY(f) ((f)->attr->flags & COB_FLAG_REAL_BINARY)
650 #define COB_FIELD_IS_POINTER(f) ((f)->attr->flags & COB_FLAG_IS_POINTER)
651 #define COB_FIELD_NO_SIGN_NIBBLE(f) ((f)->attr->flags & COB_FLAG_NO_SIGN_NIBBLE)
652 #define COB_FIELD_IS_FP(f) ((f)->attr->flags & COB_FLAG_IS_FP)
653 #define COB_FIELD_REAL_SIGN(f) ((f)->attr->flags & COB_FLAG_REAL_SIGN)
654 #define COB_FIELD_BINARY_TRUNC(f) ((f)->attr->flags & COB_FLAG_BINARY_TRUNC)
655 
656 #define COB_FLAG_LEADSEP \
657  (COB_FLAG_SIGN_SEPARATE | COB_FLAG_SIGN_LEADING)
658 
659 #define COB_FIELD_SIGN_LEADSEP(f) \
660  (((f)->attr->flags & COB_FLAG_LEADSEP) == COB_FLAG_LEADSEP)
661 
662 #define COB_FIELD_TYPE(f) ((f)->attr->type)
663 #define COB_FIELD_DIGITS(f) ((f)->attr->digits)
664 #define COB_FIELD_SCALE(f) ((f)->attr->scale)
665 #define COB_FIELD_FLAGS(f) ((f)->attr->flags)
666 #define COB_FIELD_PIC(f) ((f)->attr->pic)
667 
668 #define COB_FIELD_DATA(f) \
669  ((f)->data + (COB_FIELD_SIGN_LEADSEP (f) ? 1 : 0))
670 
671 #define COB_FIELD_SIZE(f) \
672  (COB_FIELD_SIGN_SEPARATE (f) ? f->size - 1 : f->size)
673 
674 #define COB_FIELD_IS_NUMERIC(f) (COB_FIELD_TYPE (f) & COB_TYPE_NUMERIC)
675 #define COB_FIELD_IS_NUMDISP(f) (COB_FIELD_TYPE (f) == COB_TYPE_NUMERIC_DISPLAY)
676 #define COB_FIELD_IS_ALNUM(f) (COB_FIELD_TYPE (f) == COB_TYPE_ALPHANUMERIC)
677 #define COB_FIELD_IS_NATIONAL(f) (COB_FIELD_TYPE (f) & COB_TYPE_NATIONAL)
678 
679 
680 #define COB_DISPLAY_SIGN_ASCII 0
681 #define COB_DISPLAY_SIGN_EBCDIC 1
682 
683 #define COB_NATIONAL_SIZE 2
684 
685 #define COB_SET_FLD(v,x,y,z) (v.size = x, v.data = y, v.attr = z, &v)
686 #define COB_SET_DATA(x,z) (x.data = z, &x)
687 
688 /* Fatal error definitions */
689 
690 #define COB_FERROR_NONE 0
691 #define COB_FERROR_CANCEL 1
692 #define COB_FERROR_INITIALIZED 2
693 #define COB_FERROR_CODEGEN 3
694 #define COB_FERROR_CHAINING 4
695 #define COB_FERROR_STACK 5
696 #define COB_FERROR_GLOBAL 6
697 #define COB_FERROR_MEMORY 7
698 #define COB_FERROR_MODULE 8
699 #define COB_FERROR_RECURSIVE 9
700 #define COB_FERROR_SCR_INP 10
701 #define COB_FERROR_FILE 11
702 #define COB_FERROR_FUNCTION 12
703 #define COB_FERROR_FREE 13
704 
705 /* Exception identifier enumeration */
706 
707 #undef COB_EXCEPTION
708 #define COB_EXCEPTION(code,tag,name,critical) tag,
709 
712 #include <libcob/exception.def>
713  COB_EC_MAX
714 };
715 
716 #undef COB_EXCEPTION
717 
718 
719 /* File attributes */
720 
721 /* File version */
722 #define COB_FILE_VERSION 1
723 
724 /* Start conditions */
725 /* Note that COB_NE is disallowed */
726 #define COB_EQ 1 /* x == y */
727 #define COB_LT 2 /* x < y */
728 #define COB_LE 3 /* x <= y */
729 #define COB_GT 4 /* x > y */
730 #define COB_GE 5 /* x >= y */
731 #define COB_NE 6 /* x != y */
732 #define COB_FI 7 /* First */
733 #define COB_LA 8 /* Last */
734 
735 #define COB_ASCENDING 0
736 #define COB_DESCENDING 1
737 
738 #define COB_FILE_MODE 0666
739 
740 /* Organization */
741 
742 #define COB_ORG_SEQUENTIAL 0
743 #define COB_ORG_LINE_SEQUENTIAL 1
744 #define COB_ORG_RELATIVE 2
745 #define COB_ORG_INDEXED 3
746 #define COB_ORG_SORT 4
747 #define COB_ORG_MAX 5
748 
749 /* Access mode */
750 
751 #define COB_ACCESS_SEQUENTIAL 1
752 #define COB_ACCESS_DYNAMIC 2
753 #define COB_ACCESS_RANDOM 3
754 
755 /* SELECT features */
756 
757 #define COB_SELECT_FILE_STATUS (1U << 0)
758 #define COB_SELECT_EXTERNAL (1U << 1)
759 #define COB_SELECT_LINAGE (1U << 2)
760 #define COB_SELECT_SPLITKEY (1U << 3)
761 #define COB_SELECT_STDIN (1U << 4)
762 #define COB_SELECT_STDOUT (1U << 5)
763 #define COB_SELECT_TEMPORARY (1U << 6)
764 
765 #define COB_FILE_SPECIAL(x) \
766  ((x)->flag_select_features & (COB_SELECT_STDIN | COB_SELECT_STDOUT))
767 #define COB_FILE_STDIN(x) ((x)->flag_select_features & COB_SELECT_STDIN)
768 #define COB_FILE_STDOUT(x) ((x)->flag_select_features & COB_SELECT_STDOUT)
769 #define COB_FILE_TEMPORARY(x) ((x)->flag_select_features & COB_SELECT_TEMPORARY)
770 
771 /* Lock mode */
772 
773 #define COB_LOCK_EXCLUSIVE (1U << 0)
774 #define COB_LOCK_MANUAL (1U << 1)
775 #define COB_LOCK_AUTOMATIC (1U << 2)
776 #define COB_LOCK_MULTIPLE (1U << 3)
777 #define COB_LOCK_OPEN_EXCLUSIVE (1U << 4)
778 
779 #define COB_FILE_EXCLUSIVE (COB_LOCK_EXCLUSIVE | COB_LOCK_OPEN_EXCLUSIVE)
780 
781 /* Open mode */
782 
783 #define COB_OPEN_CLOSED 0
784 #define COB_OPEN_INPUT 1
785 #define COB_OPEN_OUTPUT 2
786 #define COB_OPEN_I_O 3
787 #define COB_OPEN_EXTEND 4
788 #define COB_OPEN_LOCKED 5
789 
790 /* Close options */
791 
792 #define COB_CLOSE_NORMAL 0
793 #define COB_CLOSE_LOCK 1
794 #define COB_CLOSE_NO_REWIND 2
795 #define COB_CLOSE_UNIT 3
796 #define COB_CLOSE_UNIT_REMOVAL 4
797 
798 /* Write options */
799 
800 #define COB_WRITE_MASK 0x0000FFFF
801 
802 #define COB_WRITE_LINES 0x00010000
803 #define COB_WRITE_PAGE 0x00020000
804 #define COB_WRITE_CHANNEL 0x00040000
805 #define COB_WRITE_AFTER 0x00100000
806 #define COB_WRITE_BEFORE 0x00200000
807 #define COB_WRITE_EOP 0x00400000
808 #define COB_WRITE_LOCK 0x00800000
809 #define COB_WRITE_NO_LOCK 0x01000000
810 
811 /* Read options */
813 #define COB_READ_NEXT (1 << 0)
814 #define COB_READ_PREVIOUS (1 << 1)
815 #define COB_READ_FIRST (1 << 2)
816 #define COB_READ_LAST (1 << 3)
817 #define COB_READ_LOCK (1 << 4)
818 #define COB_READ_NO_LOCK (1 << 5)
819 #define COB_READ_KEPT_LOCK (1 << 6)
820 #define COB_READ_WAIT_LOCK (1 << 7)
821 #define COB_READ_IGNORE_LOCK (1 << 8)
822 
823 #define COB_READ_MASK \
824  (COB_READ_NEXT | COB_READ_PREVIOUS | COB_READ_FIRST | COB_READ_LAST)
826 /* I-O status */
827 
828 #define COB_STATUS_00_SUCCESS 00
829 #define COB_STATUS_02_SUCCESS_DUPLICATE 02
830 #define COB_STATUS_04_SUCCESS_INCOMPLETE 04
831 #define COB_STATUS_05_SUCCESS_OPTIONAL 05
832 #define COB_STATUS_07_SUCCESS_NO_UNIT 07
833 #define COB_STATUS_10_END_OF_FILE 10
834 #define COB_STATUS_14_OUT_OF_KEY_RANGE 14
835 #define COB_STATUS_21_KEY_INVALID 21
836 #define COB_STATUS_22_KEY_EXISTS 22
837 #define COB_STATUS_23_KEY_NOT_EXISTS 23
838 #define COB_STATUS_24_KEY_BOUNDARY 24
839 #define COB_STATUS_30_PERMANENT_ERROR 30
840 #define COB_STATUS_31_INCONSISTENT_FILENAME 31
841 #define COB_STATUS_34_BOUNDARY_VIOLATION 34
842 #define COB_STATUS_35_NOT_EXISTS 35
843 #define COB_STATUS_37_PERMISSION_DENIED 37
844 #define COB_STATUS_38_CLOSED_WITH_LOCK 38
845 #define COB_STATUS_39_CONFLICT_ATTRIBUTE 39
846 #define COB_STATUS_41_ALREADY_OPEN 41
847 #define COB_STATUS_42_NOT_OPEN 42
848 #define COB_STATUS_43_READ_NOT_DONE 43
849 #define COB_STATUS_44_RECORD_OVERFLOW 44
850 #define COB_STATUS_46_READ_ERROR 46
851 #define COB_STATUS_47_INPUT_DENIED 47
852 #define COB_STATUS_48_OUTPUT_DENIED 48
853 #define COB_STATUS_49_I_O_DENIED 49
854 #define COB_STATUS_51_RECORD_LOCKED 51
855 #define COB_STATUS_57_I_O_LINAGE 57
856 #define COB_STATUS_61_FILE_SHARING 61
857 #define COB_STATUS_91_NOT_AVAILABLE 91
859 /* Special status */
860 /* Used by extfh handler */
861 #define COB_NOT_CONFIGURED 32768
863 /* End File attributes */
864 
865 /* Number store defines */
867 #define COB_STORE_ROUND (1 << 0)
868 #define COB_STORE_KEEP_ON_OVERFLOW (1 << 1)
869 #define COB_STORE_TRUNC_ON_OVERFLOW (1 << 2)
871 #define COB_STORE_AWAY_FROM_ZERO (1 << 4)
872 #define COB_STORE_NEAR_AWAY_FROM_ZERO (1 << 5)
873 #define COB_STORE_NEAR_EVEN (1 << 6)
874 #define COB_STORE_NEAR_TOWARD_ZERO (1 << 7)
875 #define COB_STORE_PROHIBITED (1 << 8)
876 #define COB_STORE_TOWARD_GREATER (1 << 9)
877 #define COB_STORE_TOWARD_LESSER (1 << 10)
878 #define COB_STORE_TRUNCATION (1 << 11)
879 
880 #define COB_STORE_MASK \
881  (COB_STORE_ROUND | COB_STORE_KEEP_ON_OVERFLOW | \
882  COB_STORE_TRUNC_ON_OVERFLOW)
883 
884 /* Screen attribute defines */
885 
886 #define COB_SCREEN_BLACK 0
887 #define COB_SCREEN_BLUE 1
888 #define COB_SCREEN_GREEN 2
889 #define COB_SCREEN_CYAN 3
890 #define COB_SCREEN_RED 4
891 #define COB_SCREEN_MAGENTA 5
892 #define COB_SCREEN_YELLOW 6
893 #define COB_SCREEN_WHITE 7
895 #define COB_SCREEN_LINE_PLUS (1 << 0)
896 #define COB_SCREEN_LINE_MINUS (1 << 1)
897 #define COB_SCREEN_COLUMN_PLUS (1 << 2)
898 #define COB_SCREEN_COLUMN_MINUS (1 << 3)
899 #define COB_SCREEN_AUTO (1 << 4)
900 #define COB_SCREEN_BELL (1 << 5)
901 #define COB_SCREEN_BLANK_LINE (1 << 6)
902 #define COB_SCREEN_BLANK_SCREEN (1 << 7)
903 #define COB_SCREEN_BLINK (1 << 8)
904 #define COB_SCREEN_ERASE_EOL (1 << 9)
905 #define COB_SCREEN_ERASE_EOS (1 << 10)
906 #define COB_SCREEN_FULL (1 << 11)
907 #define COB_SCREEN_HIGHLIGHT (1 << 12)
908 #define COB_SCREEN_LOWLIGHT (1 << 13)
909 #define COB_SCREEN_REQUIRED (1 << 14)
910 #define COB_SCREEN_REVERSE (1 << 15)
911 #define COB_SCREEN_SECURE (1 << 16)
912 #define COB_SCREEN_UNDERLINE (1 << 17)
913 #define COB_SCREEN_OVERLINE (1 << 18)
914 #define COB_SCREEN_PROMPT (1 << 19)
915 #define COB_SCREEN_UPDATE (1 << 20)
916 #define COB_SCREEN_INPUT (1 << 21)
917 #define COB_SCREEN_SCROLL_DOWN (1 << 22)
918 #define COB_SCREEN_INITIAL (1 << 23)
919 #define COB_SCREEN_NO_ECHO (1 << 24)
920 #define COB_SCREEN_LEFTLINE (1 << 25)
921 #define COB_SCREEN_NO_DISP (1 << 26)
922 #define COB_SCREEN_EMULATE_NL (1 << 27)
923 #define COB_SCREEN_UPPER (1 << 28)
924 #define COB_SCREEN_LOWER (1 << 29)
925 #define COB_SCREEN_GRID (1 << 30)
926 
927 #define COB_SCREEN_TYPE_GROUP 0
928 #define COB_SCREEN_TYPE_FIELD 1
929 #define COB_SCREEN_TYPE_VALUE 2
930 #define COB_SCREEN_TYPE_ATTRIBUTE 3
931 
932 /* End Screen attribute defines */
933 
934 
935 /* Structure/union declarations */
937 
938 /* Field attribute structure */
939 
940 typedef struct {
941  unsigned short type; /* Field type */
942  unsigned short digits; /* Digit count */
943  signed short scale; /* Field scale */
944  unsigned short flags; /* Field flags */
945  const char *pic; /* Pointer to picture string */
947 
948 /* Field structure */
950 typedef struct {
951  size_t size; /* Field size */
952  unsigned char *data; /* Pointer to field data */
953  const cob_field_attr *attr; /* Pointer to attribute */
954 } cob_field;
955 
956 #if 0 /* RXWRXW - Constant field */
957 /* Field structure for constants */
958 
959 typedef struct {
960  const size_t size; /* Field size */
961  const unsigned char *data; /* Pointer to field data */
962  const cob_field_attr *attr; /* Pointer to attribute */
963 } cob_const_field;
964 
966 /* Union for field constants */
967 
968 typedef union {
969  const cob_const_field cf;
970  cob_field vf;
971 } cob_fld_union;
972 #endif
974 /* Representation of 128 bit FP */
975 
976 typedef struct {
977  cob_u64_t fpval[2];
978 } cob_fp_128;
979 
980 /* Internal representation of decimal numbers */
981 /* n = value / 10 ^ scale */
982 /* Decimal structure */
983 
984 typedef struct {
985  mpz_t value; /* GMP value definition */
986  int scale; /* Decimal scale */
987 } cob_decimal;
988 
989 /* Perform stack structure */
990 struct cob_frame {
991  void *return_address_ptr; /* Return address pointer */
992  unsigned int perform_through; /* Perform number */
993  unsigned int return_address_num; /* Return address number */
994 };
995 
996 /* Call union structures */
997 
998 typedef union {
999  unsigned char data[8];
1002  int dataint;
1004 
1005 typedef union {
1006  void *(*funcptr)(); /* Function returning "void *" */
1007  void (*funcnull)(); /* Function returning nothing */
1008  cob_field *(*funcfld)(); /* Function returning "cob_field *" */
1009  int (*funcint)(); /* Function returning "int" */
1010  void *funcvoid; /* Redefine to "void *" */
1011 #ifdef _WIN32
1012  /* stdcall variants */
1013  void *(__stdcall *funcptr_std)();
1014  void (__stdcall *funcnull_std)();
1015  cob_field *(__stdcall *funcfld_std)();
1016  int (__stdcall *funcint_std)();
1017 #endif
1018 } cob_call_union;
1021  const char *cob_cstr_name; /* Call name */
1022  cob_call_union cob_cstr_call; /* Call entry */
1023  cob_call_union cob_cstr_cancel; /* Cancel entry */
1024 };
1025 
1026 /* Screen structure */
1027 typedef struct __cob_screen {
1028  struct __cob_screen *next; /* Pointer to next */
1029  struct __cob_screen *prev; /* Pointer to previous */
1030  struct __cob_screen *child; /* For COB_SCREEN_TYPE_GROUP */
1031  struct __cob_screen *parent; /* Pointer to parent */
1032  cob_field *field; /* For COB_SCREEN_TYPE_FIELD */
1033  cob_field *value; /* For COB_SCREEN_TYPE_VALUE */
1034  cob_field *line; /* LINE */
1035  cob_field *column; /* COLUMN */
1036  cob_field *foreg; /* FOREGROUND */
1037  cob_field *backg; /* BACKGROUND */
1038  cob_field *prompt; /* PROMPT */
1039  int type; /* Structure type */
1040  int occurs; /* OCCURS */
1041  int attr; /* COB_SCREEN_TYPE_ATTRIBUTE */
1042 } cob_screen;
1043 
1044 /* Module structure */
1045 
1046 typedef struct __cob_module {
1047  struct __cob_module *next; /* Next pointer */
1048  cob_field **cob_procedure_params; /* Arguments */
1049  const char *module_name; /* Module name */
1050  const char *module_formatted_date; /* Module full date */
1051  const char *module_source; /* Module source */
1052  cob_call_union module_entry; /* Module entry */
1053  cob_call_union module_cancel; /* Module cancel */
1054  const unsigned char *collating_sequence; /* COLLATING */
1055  cob_field *crt_status; /* CRT STATUS */
1056  cob_field *cursor_pos; /* CURSOR */
1057  unsigned int *module_ref_count; /* Module ref count */
1058  const char **module_path; /* Module path */
1059 
1060  unsigned int module_active; /* Module is active */
1061  unsigned int module_date; /* Module num date */
1062  unsigned int module_time; /* Module num time */
1063  unsigned int module_type; /* Module type */
1064  unsigned int module_param_cnt; /* Module param count */
1065  unsigned int module_returning; /* Module return type */
1066  int module_num_params; /* Module arg count */
1067 
1068  unsigned char ebcdic_sign; /* DISPLAY SIGN */
1069  unsigned char decimal_point; /* DECIMAL POINT */
1070  unsigned char currency_symbol; /* CURRENCY */
1071  unsigned char numeric_separator; /* Separator */
1072 
1073  unsigned char flag_filename_mapping; /* Mapping */
1074  unsigned char flag_binary_truncate; /* Truncation */
1075  unsigned char flag_pretty_display; /* Pretty display */
1076  unsigned char flag_host_sign; /* Host sign */
1077 
1078  unsigned char flag_no_phys_canc; /* No physical cancel */
1079  unsigned char flag_main; /* Main module */
1080  unsigned char flag_fold_call; /* Fold case */
1081  unsigned char flag_exit_program; /* Exit after CALL */
1082 } cob_module;
1083 
1085 /* User function structure */
1086 
1091  unsigned char **data;
1095 };
1097 /* File connector */
1098 
1099 /* Key structure */
1101 typedef struct {
1102  cob_field *field; /* Key field */
1103  int flag; /* WITH DUPLICATES (for RELATIVE/INDEXED) */
1104  /* ASCENDING/DESCENDING (for SORT) */
1105  unsigned int offset; /* Offset of field */
1106 } cob_file_key;
1107 
1108 
1109 /* File structure */
1110 
1111 typedef struct {
1112  const char *select_name; /* Name in SELECT */
1113  unsigned char *file_status; /* FILE STATUS */
1114  cob_field *assign; /* ASSIGN TO */
1115  cob_field *record; /* Record area */
1116  cob_field *variable_record; /* Record size variable */
1117  cob_file_key *keys; /* ISAM/RANDOM/SORT keys */
1118  void *file; /* File specific pointer */
1119  void *linorkeyptr; /* LINAGE or SPLIT KEY */
1120  const unsigned char *sort_collating; /* SORT collating */
1121  void *extfh_ptr; /* For EXTFH usage */
1122  size_t record_min; /* Record min size */
1123  size_t record_max; /* Record max size */
1124  size_t nkeys; /* Number of keys */
1125  int fd; /* File descriptor */
1126 
1127  unsigned char organization; /* ORGANIZATION */
1128  unsigned char access_mode; /* ACCESS MODE */
1129  unsigned char lock_mode; /* LOCK MODE */
1130  unsigned char open_mode; /* OPEN MODE */
1131  unsigned char flag_optional; /* OPTIONAL */
1132  unsigned char last_open_mode; /* Mode given by OPEN */
1133  unsigned char flag_operation; /* File type specific */
1134  unsigned char flag_nonexistent; /* Nonexistent file */
1135 
1136  unsigned char flag_end_of_file; /* Reached end of file */
1137  unsigned char flag_begin_of_file; /* Reached start of file */
1138  unsigned char flag_first_read; /* OPEN/START read flag */
1139  unsigned char flag_read_done; /* READ successful */
1140  unsigned char flag_select_features; /* SELECT features */
1141  unsigned char flag_needs_nl; /* Needs NL at close */
1142  unsigned char flag_needs_top; /* Linage needs top */
1143  unsigned char file_version; /* File I/O version */
1144 
1145 } cob_file;
1147 
1148 /* Linage structure */
1149 
1150 typedef struct {
1151  cob_field *linage; /* LINAGE */
1152  cob_field *linage_ctr; /* LINAGE-COUNTER */
1153  cob_field *latfoot; /* LINAGE FOOTING */
1154  cob_field *lattop; /* LINAGE AT TOP */
1155  cob_field *latbot; /* LINAGE AT BOTTOM */
1156  int lin_lines; /* Current Linage */
1157  int lin_foot; /* Current Footage */
1158  int lin_top; /* Current Top */
1159  int lin_bot; /* Current Bottom */
1160 } cob_linage;
1161 
1163 /* Report structure */
1164 
1165 typedef struct {
1166  const char *report_name; /* Report name */
1167  cob_file *report_file; /* Report file */
1168  cob_field *page_counter; /* PAGE-COUNTER */
1169  cob_field *line_counter; /* LINE-COUNTER */
1170  int def_lines; /* Default lines */
1171  int def_cols; /* Default columns */
1172  int def_heading; /* Default heading */
1173  int def_first_detail; /* Default first detail */
1174  int def_last_control; /* Default last control */
1175  int def_last_detail; /* Default last detail */
1176  int def_footing; /* Default footing */
1177  int curr_page; /* Current page */
1178  int curr_lines; /* Current lines */
1179  int curr_cols; /* Current columns */
1180  int curr_status; /* Current status */
1181 } cob_report;
1182 
1184 /* Global variable structure */
1185 
1186 typedef struct __cob_global {
1187  cob_file *cob_error_file; /* Last error file */
1188  cob_module *cob_current_module; /* Current module */
1189  const char *cob_orig_statement; /* Statement */
1190  const char *cob_orig_program_id; /* Program ID */
1191  const char *cob_orig_section; /* Section */
1192  const char *cob_orig_paragraph; /* Paragraph */
1193  const char *cob_main_argv0; /* Main program */
1194  char *cob_locale; /* Program locale */
1195  char *cob_locale_orig; /* Initial locale */
1196  char *cob_locale_ctype; /* Initial locale */
1197  char *cob_locale_collate; /* Initial locale */
1198  char *cob_locale_messages; /* Initial locale */
1199  char *cob_locale_monetary; /* Initial locale */
1200  char *cob_locale_numeric; /* Initial locale */
1201  char *cob_locale_time; /* Initial locale */
1202 
1203  int cob_exception_code; /* Last exception code */
1204  int cob_call_params; /* Current arguments */
1205  int cob_initial_external; /* First external ref */
1206  unsigned int cob_orig_line; /* Program source line */
1207  unsigned int cob_got_exception; /* Exception active */
1208  unsigned int cob_screen_initialized; /* Screen initialized */
1209  unsigned int cob_physical_cancel; /* Unloading of modules */
1210 
1211  /* Library routine variables */
1213  /* screenio / termio */
1214  unsigned char *cob_term_buff; /* Screen I/O buffer */
1215  int cob_accept_status; /* ACCEPT STATUS */
1217  int cob_max_y; /* Screen max y */
1218  int cob_max_x; /* Screen max x */
1219 
1221 
1222 /* File I/O function pointer structure */
1224  int (*open) (cob_file *, char *, const int, const int);
1225  int (*close) (cob_file *, const int);
1226  int (*start) (cob_file *, const int, cob_field *);
1227  int (*read) (cob_file *, cob_field *, const int);
1228  int (*read_next) (cob_file *, const int);
1229  int (*write) (cob_file *, const int);
1230  int (*rewrite) (cob_file *, const int);
1231  int (*fdelete) (cob_file *);
1232 };
1233 
1234 /* Low level jump structure */
1235 struct cobjmp_buf {
1236  int cbj_int[4];
1237  void *cbj_ptr[4];
1238  jmp_buf cbj_jmp_buf;
1239  void *cbj_ptr_rest[2];
1240 };
1241 
1242 /*******************************/
1244 /* Function declarations */
1245 
1246 /*******************************/
1247 /* Functions in common.c */
1248 COB_EXPIMP void print_info(void);
1249 COB_EXPIMP void print_version(void);
1250 COB_EXPIMP int cob_load_config(void);
1252 
1253 void cob_set_exception(const int);
1254 
1255 char* cob_int_to_string(int, char*);
1256 char* cob_int_to_formatted_bytestring(int, char*);
1257 char* cob_strcat(char*, char*);
1258 char* cob_strjoin(char**, int, char*);
1260 /* General functions */
1261 
1264 COB_EXPIMP void cob_init (const int, char **);
1266  const int);
1268 
1270 DECLNORET COB_EXPIMP void cob_fatal_error (const int) COB_A_NORETURN;
1272 COB_EXPIMP void *cob_malloc (const size_t) COB_A_MALLOC;
1273 COB_EXPIMP void *cob_realloc (void *, const size_t, const size_t) COB_A_MALLOC;
1274 COB_EXPIMP void cob_free (void *);
1275 COB_EXPIMP void *cob_fast_malloc (const size_t) COB_A_MALLOC;
1276 COB_EXPIMP void *cob_cache_malloc (const size_t) COB_A_MALLOC;
1277 COB_EXPIMP void *cob_cache_realloc (void *, const size_t);
1278 COB_EXPIMP void cob_cache_free (void *);
1279 COB_EXPIMP void cob_set_locale (cob_field *, const int);
1281 COB_EXPIMP char *cob_expand_env_string(char *);
1282 
1283 COB_EXPIMP void cob_check_version (const char *, const char *,
1284  const int);
1285 
1286 COB_EXPIMP void *cob_save_func (cob_field **, const int,
1287  const int, ...);
1289 
1290 COB_EXPIMP void cob_accept_arg_number (cob_field *);
1291 COB_EXPIMP void cob_accept_arg_value (cob_field *);
1293 COB_EXPIMP void cob_accept_date (cob_field *);
1294 COB_EXPIMP void cob_accept_date_yyyymmdd (cob_field *);
1295 COB_EXPIMP void cob_accept_day (cob_field *);
1297 COB_EXPIMP void cob_accept_day_of_week (cob_field *);
1298 COB_EXPIMP void cob_accept_environment (cob_field *);
1299 COB_EXPIMP void cob_accept_exception_status (cob_field *);
1300 COB_EXPIMP void cob_accept_time (cob_field *);
1301 COB_EXPIMP void cob_accept_user_name (cob_field *);
1302 COB_EXPIMP void cob_display_command_line (cob_field *);
1303 COB_EXPIMP void cob_display_environment (const cob_field *);
1304 COB_EXPIMP void cob_display_env_value (const cob_field *);
1305 COB_EXPIMP void cob_display_arg_number (cob_field *);
1306 COB_EXPIMP void cob_get_environment (const cob_field *, cob_field *);
1307 COB_EXPIMP void cob_set_environment (const cob_field *,
1308  const cob_field *);
1309 COB_EXPIMP void cob_chain_setup (void *, const size_t,
1310  const size_t);
1311 COB_EXPIMP void cob_allocate (unsigned char **, cob_field *,
1312  cob_field *, cob_field *);
1313 COB_EXPIMP void cob_free_alloc (unsigned char **, unsigned char *);
1314 COB_EXPIMP int cob_extern_init (void);
1315 COB_EXPIMP int cob_tidy (void);
1316 COB_EXPIMP void *cob_command_line (int, int *, char ***,
1317  char ***, char **);
1318 COB_EXPIMP char *cob_getenv (const char *);
1319 COB_EXPIMP int cob_putenv (char *);
1322 COB_EXPIMP void cob_temp_name (char *, const char *);
1323 
1324 #define cobgetenv(x) cob_getenv (x)
1325 #define cobputenv(x) cob_putenv (x)
1326 #define cobtidy() cob_tidy ()
1327 #define cobinit() cob_extern_init ()
1328 #define cobexit(x) cob_stop_run (x)
1329 #define cobcommandline(v,w,x,y,z) cob_command_line (v,w,x,y,z)
1330 
1331 /* System routines */
1332 COB_EXPIMP int cob_sys_exit_proc (const void *, const void *);
1333 COB_EXPIMP int cob_sys_error_proc (const void *, const void *);
1334 COB_EXPIMP int cob_sys_system (const void *);
1335 /**
1336  * Return some hosted C variables, argc, argv, stdin, stdout, stderr.
1337  */
1338 COB_EXPIMP int cob_sys_hosted (void *, const void *);
1339 COB_EXPIMP int cob_sys_and (const void *, void *, const int);
1340 COB_EXPIMP int cob_sys_or (const void *, void *, const int);
1341 COB_EXPIMP int cob_sys_nor (const void *, void *, const int);
1342 COB_EXPIMP int cob_sys_xor (const void *, void *, const int);
1343 COB_EXPIMP int cob_sys_imp (const void *, void *, const int);
1344 COB_EXPIMP int cob_sys_nimp (const void *, void *, const int);
1345 COB_EXPIMP int cob_sys_eq (const void *, void *, const int);
1346 COB_EXPIMP int cob_sys_not (void *, const int);
1347 COB_EXPIMP int cob_sys_xf4 (void *, const void *);
1348 COB_EXPIMP int cob_sys_xf5 (const void *, void *);
1349 COB_EXPIMP int cob_sys_x91 (void *, const void *, void *);
1350 COB_EXPIMP int cob_sys_toupper (void *, const int);
1351 COB_EXPIMP int cob_sys_tolower (void *, const int);
1352 COB_EXPIMP int cob_sys_oc_nanosleep (const void *);
1353 COB_EXPIMP int cob_sys_getpid (void);
1355 COB_EXPIMP int cob_sys_parameter_size (void *);
1356 
1357 /*
1358  * cob_sys_getopt_long_long
1359  */
1360 COB_EXPIMP int cob_sys_getopt_long_long (void*, void*, void*, const int, void*, void*);
1361 typedef struct longoption_def {
1362  char name[25];
1364  char return_value_pointer[sizeof(char*)];
1365  char return_value[4];
1366 } longoption_def;
1367 
1368 
1369 COB_EXPIMP int cob_sys_sleep (const void *);
1370 COB_EXPIMP int cob_sys_calledby (void *);
1371 COB_EXPIMP int cob_sys_justify (void *, ...);
1372 COB_EXPIMP int cob_sys_printable (void *, ...);
1373 
1374 /* Utilities */
1375 
1376 COB_EXPIMP void cob_set_location (const char *, const unsigned int,
1377  const char *, const char *,
1378  const char *);
1379 COB_EXPIMP void cob_trace_section (const char *, const char *, const int);
1380 
1381 COB_EXPIMP void *cob_external_addr (const char *, const int);
1382 COB_EXPIMP unsigned char *cob_get_pointer (const void *);
1383 COB_EXPIMP void *cob_get_prog_pointer (const void *);
1384 COB_EXPIMP void cob_ready_trace (void);
1385 COB_EXPIMP void cob_reset_trace (void);
1386 
1387 
1388 /* Registration of external handlers */
1389 COB_EXPIMP void cob_reg_sighnd (void (*sighnd) (int));
1390 
1391 /* Switch */
1392 
1393 COB_EXPIMP int cob_get_switch (const int);
1394 COB_EXPIMP void cob_set_switch (const int, const int);
1395 
1396 /* Comparison */
1397 
1398 COB_EXPIMP int cob_cmp (cob_field *, cob_field *);
1399 
1400 /* Class check */
1401 
1402 COB_EXPIMP int cob_is_omitted (const cob_field *);
1403 COB_EXPIMP int cob_is_numeric (const cob_field *);
1404 COB_EXPIMP int cob_is_alpha (const cob_field *);
1405 COB_EXPIMP int cob_is_upper (const cob_field *);
1406 COB_EXPIMP int cob_is_lower (const cob_field *);
1407 
1408 /* Table sort */
1409 
1410 COB_EXPIMP void cob_table_sort_init (const size_t, const unsigned char *);
1411 COB_EXPIMP void cob_table_sort_init_key (cob_field *, const int,
1412  const unsigned int);
1413 COB_EXPIMP void cob_table_sort (cob_field *, const int);
1414 
1415 /* Run-time error checking */
1416 
1417 COB_EXPIMP void cob_check_numeric (const cob_field *, const char *);
1418 COB_EXPIMP void cob_correct_numeric (cob_field *);
1419 COB_EXPIMP void cob_check_based (const unsigned char *,
1420  const char *);
1421 COB_EXPIMP void cob_check_linkage (const unsigned char *,
1422  const char *, const int);
1423 COB_EXPIMP void cob_check_odo (const int, const int,
1424  const int, const char *);
1425 COB_EXPIMP void cob_check_subscript (const int, const int,
1426  const int, const char *);
1427 COB_EXPIMP void cob_check_ref_mod (const int, const int,
1428  const int, const char *);
1429 
1430 /* Comparison functions */
1431 COB_EXPIMP int cob_numeric_cmp (cob_field *, cob_field *);
1432 
1433 /*******************************/
1434 /* Functions in strings.c */
1435 
1436 COB_EXPIMP void cob_inspect_init (cob_field *, const cob_u32_t);
1437 COB_EXPIMP void cob_inspect_start (void);
1438 COB_EXPIMP void cob_inspect_before (const cob_field *);
1439 COB_EXPIMP void cob_inspect_after (const cob_field *);
1440 COB_EXPIMP void cob_inspect_characters (cob_field *);
1441 COB_EXPIMP void cob_inspect_all (cob_field *, cob_field *);
1442 COB_EXPIMP void cob_inspect_leading (cob_field *, cob_field *);
1443 COB_EXPIMP void cob_inspect_first (cob_field *, cob_field *);
1444 COB_EXPIMP void cob_inspect_trailing (cob_field *, cob_field *);
1445 COB_EXPIMP void cob_inspect_converting (const cob_field *, const cob_field *);
1446 COB_EXPIMP void cob_inspect_finish (void);
1447 
1448 COB_EXPIMP void cob_string_init (cob_field *, cob_field *);
1449 COB_EXPIMP void cob_string_delimited (cob_field *);
1450 COB_EXPIMP void cob_string_append (cob_field *);
1451 COB_EXPIMP void cob_string_finish (void);
1452 
1453 COB_EXPIMP void cob_unstring_init (cob_field *, cob_field *, const size_t);
1454 COB_EXPIMP void cob_unstring_delimited (cob_field *, const cob_u32_t);
1455 COB_EXPIMP void cob_unstring_into (cob_field *, cob_field *, cob_field *);
1456 COB_EXPIMP void cob_unstring_tallying (cob_field *);
1457 COB_EXPIMP void cob_unstring_finish (void);
1458 
1459 /*******************************/
1460 /* Functions in move.c */
1461 
1462 COB_EXPIMP void cob_move (cob_field *, cob_field *);
1463 COB_EXPIMP void cob_set_int (cob_field *, const int);
1464 COB_EXPIMP int cob_get_int (cob_field *);
1465 COB_EXPIMP cob_s64_t cob_get_llint (cob_field *);
1466 
1467 /*******************************/
1468 /* Functions in numeric.c */
1469 
1472 COB_EXPIMP void cob_decimal_set_field (cob_decimal *, cob_field *);
1473 COB_EXPIMP int cob_decimal_get_field (cob_decimal *, cob_field *, const int);
1480 
1481 COB_EXPIMP void cob_add (cob_field *, cob_field *, const int);
1482 COB_EXPIMP void cob_sub (cob_field *, cob_field *, const int);
1483 COB_EXPIMP void cob_mul (cob_field *, cob_field *, const int);
1484 COB_EXPIMP void cob_div (cob_field *, cob_field *, const int);
1485 COB_EXPIMP int cob_add_int (cob_field *, const int, const int);
1486 COB_EXPIMP int cob_sub_int (cob_field *, const int, const int);
1487 COB_EXPIMP void cob_div_quotient (cob_field *, cob_field *,
1488  cob_field *, const int);
1489 COB_EXPIMP void cob_div_remainder (cob_field *, const int);
1490 
1491 COB_EXPIMP int cob_cmp_int (cob_field *, const int);
1492 COB_EXPIMP int cob_cmp_uint (cob_field *, const unsigned int);
1493 COB_EXPIMP int cob_cmp_llint (cob_field *, const cob_s64_t);
1494 COB_EXPIMP int cob_cmp_packed (cob_field *, const cob_s64_t);
1495 COB_EXPIMP int cob_cmp_numdisp (const unsigned char *,
1496  const size_t, const cob_s64_t,
1497  const cob_u32_t);
1498 COB_EXPIMP int cob_cmp_float (cob_field *, cob_field *);
1499 COB_EXPIMP void cob_set_packed_zero (cob_field *);
1500 COB_EXPIMP void cob_set_packed_int (cob_field *, const int);
1501 
1502 COB_EXPIMP void cob_decimal_alloc (const cob_u32_t, ...);
1503 COB_EXPIMP void cob_decimal_push (const cob_u32_t, ...);
1504 COB_EXPIMP void cob_decimal_pop (const cob_u32_t, ...);
1505 
1506 COB_EXPIMP void cob_gmp_free (void *);
1507 
1508 
1509 /*******************************/
1510 /* Functions in call.c */
1511 
1512 DECLNORET COB_EXPIMP void cob_call_error (void) COB_A_NORETURN;
1513 
1515 COB_EXPIMP void *cob_resolve (const char *);
1516 COB_EXPIMP void *cob_resolve_cobol (const char *, const int,
1517  const int);
1518 COB_EXPIMP void *cob_resolve_func (const char *);
1519 COB_EXPIMP const char *cob_resolve_error (void);
1520 COB_EXPIMP void *cob_call_field (const cob_field *,
1521  const struct cob_call_struct *,
1522  const unsigned int,
1523  const int);
1524 COB_EXPIMP void cob_cancel_field (const cob_field *,
1525  const struct cob_call_struct *);
1526 COB_EXPIMP void cob_cancel (const char *);
1527 COB_EXPIMP int cob_call (const char *, const int, void **);
1528 COB_EXPIMP int cob_func (const char *, const int, void **);
1529 COB_EXPIMP void *cob_savenv (struct cobjmp_buf *);
1530 COB_EXPIMP void *cob_savenv2 (struct cobjmp_buf *, const int);
1531 COB_EXPIMP void cob_longjmp (struct cobjmp_buf *);
1532 
1533 #define cobsetjmp(x) setjmp (cob_savenv (x))
1534 #define coblongjmp(x) cob_longjmp (x)
1535 #define cobsavenv(x) cob_savenv (x)
1536 #define cobsavenv2(x,z) cob_savenv2 (x, z)
1537 #define cobfunc(x,y,z) cob_func (x, y, z)
1538 #define cobcall(x,y,z) cob_call (x, y, z)
1539 #define cobcancel(x) cob_cancel (x)
1540 
1541 /*******************************/
1542 /* Functions in screenio.c */
1543 
1544 COB_EXPIMP void cob_screen_line_col (cob_field *, const int);
1545 COB_EXPIMP void cob_screen_display (cob_screen *, cob_field *,
1546  cob_field *);
1547 COB_EXPIMP void cob_screen_accept (cob_screen *, cob_field *,
1548  cob_field *, cob_field *);
1549 COB_EXPIMP void cob_field_display (cob_field *, cob_field *, cob_field *,
1550  cob_field *, cob_field *, cob_field *,
1551  cob_field *, const int);
1552 COB_EXPIMP void cob_field_accept (cob_field *, cob_field *, cob_field *,
1553  cob_field *, cob_field *, cob_field *,
1554  cob_field *, cob_field *, cob_field *,
1555  const int);
1556 COB_EXPIMP void cob_accept_escape_key (cob_field *);
1557 COB_EXPIMP int cob_sys_clear_screen (void);
1558 COB_EXPIMP int cob_sys_sound_bell (void);
1559 COB_EXPIMP int cob_sys_get_csr_pos (unsigned char *);
1560 COB_EXPIMP int cob_sys_get_scr_size (unsigned char *, unsigned char *);
1561 
1562 /*******************************/
1563 /* Functions in termio.c */
1564 
1565 COB_EXPIMP void cob_display (const int, const int, const int, ...);
1566 COB_EXPIMP void cob_accept (cob_field *);
1567 
1568 /*******************************/
1569 /* Functions in fileio.c */
1570 
1571 COB_EXPIMP void cob_open (cob_file *, const int, const int, cob_field *);
1572 COB_EXPIMP void cob_close (cob_file *, cob_field *, const int, const int);
1573 COB_EXPIMP void cob_read (cob_file *, cob_field *, cob_field *, const int);
1574 COB_EXPIMP void cob_read_next (cob_file *, cob_field *, const int);
1575 COB_EXPIMP void cob_rewrite (cob_file *, cob_field *, const int, cob_field *);
1576 COB_EXPIMP void cob_delete (cob_file *, cob_field *);
1577 COB_EXPIMP void cob_start (cob_file *, const int, cob_field *,
1578  cob_field *, cob_field *);
1579 COB_EXPIMP void cob_write (cob_file *, cob_field *, const int,
1580  cob_field *, const unsigned int);
1581 
1582 COB_EXPIMP void cob_delete_file (cob_file *, cob_field *);
1583 COB_EXPIMP void cob_unlock_file (cob_file *, cob_field *);
1584 COB_EXPIMP void cob_commit (void);
1585 COB_EXPIMP void cob_rollback (void);
1586 
1587 /* File system routines */
1588 COB_EXPIMP int cob_sys_open_file (unsigned char *, unsigned char *,
1589  unsigned char *, unsigned char *,
1590  unsigned char *);
1591 COB_EXPIMP int cob_sys_create_file (unsigned char *, unsigned char *,
1592  unsigned char *, unsigned char *,
1593  unsigned char *);
1594 COB_EXPIMP int cob_sys_read_file (unsigned char *, unsigned char *,
1595  unsigned char *, unsigned char *,
1596  unsigned char *);
1597 COB_EXPIMP int cob_sys_write_file (unsigned char *, unsigned char *,
1598  unsigned char *, unsigned char *,
1599  unsigned char *);
1600 COB_EXPIMP int cob_sys_close_file (unsigned char *);
1601 COB_EXPIMP int cob_sys_flush_file (unsigned char *);
1602 COB_EXPIMP int cob_sys_delete_file (unsigned char *);
1603 COB_EXPIMP int cob_sys_copy_file (unsigned char *, unsigned char *);
1604 COB_EXPIMP int cob_sys_check_file_exist (unsigned char *, unsigned char *);
1605 COB_EXPIMP int cob_sys_rename_file (unsigned char *, unsigned char *);
1606 COB_EXPIMP int cob_sys_get_current_dir (const int, const int, unsigned char *);
1607 COB_EXPIMP int cob_sys_change_dir (unsigned char *);
1608 COB_EXPIMP int cob_sys_create_dir (unsigned char *);
1609 COB_EXPIMP int cob_sys_delete_dir (unsigned char *);
1610 COB_EXPIMP int cob_sys_chdir (unsigned char *, unsigned char *);
1611 COB_EXPIMP int cob_sys_mkdir (unsigned char *);
1612 COB_EXPIMP int cob_sys_copyfile (unsigned char *, unsigned char *,
1613  unsigned char *);
1614 COB_EXPIMP int cob_sys_file_info (unsigned char *, unsigned char *);
1615 COB_EXPIMP int cob_sys_file_delete (unsigned char *, unsigned char *);
1616 
1617 /* SORT routines */
1618 COB_EXPIMP void cob_file_sort_init (cob_file *, const unsigned int,
1619  const unsigned char *,
1620  void *, cob_field *);
1621 COB_EXPIMP void cob_file_sort_init_key (cob_file *, cob_field *,
1622  const int, const unsigned int);
1625 COB_EXPIMP void cob_file_sort_giving (cob_file *, const size_t, ...);
1628 
1629 /*******************************/
1630 /* Functions in intrinsic.c */
1631 
1632 COB_EXPIMP void cob_put_indirect_field (cob_field *);
1633 COB_EXPIMP void cob_get_indirect_field (cob_field *);
1634 COB_EXPIMP cob_field *cob_switch_value (const int);
1635 COB_EXPIMP cob_field *cob_intr_binop (cob_field *, const int,
1636  cob_field *);
1637 
1638 COB_EXPIMP int cob_check_numval (const cob_field *,
1639  const cob_field *,
1640  const int, const int);
1641 
1642 COB_EXPIMP int cob_valid_date_format (const char *);
1643 COB_EXPIMP int cob_valid_datetime_format (const char *, const char);
1644 COB_EXPIMP int cob_valid_time_format (const char *, const char);
1645 
1646 COB_EXPIMP cob_field *cob_intr_current_date (const int, const int);
1647 COB_EXPIMP cob_field *cob_intr_when_compiled (const int, const int,
1648  cob_field *);
1649 COB_EXPIMP cob_field *cob_intr_module_date (void);
1650 COB_EXPIMP cob_field *cob_intr_module_time (void);
1651 COB_EXPIMP cob_field *cob_intr_module_id (void);
1652 COB_EXPIMP cob_field *cob_intr_module_caller_id (void);
1653 COB_EXPIMP cob_field *cob_intr_module_source (void);
1654 COB_EXPIMP cob_field *cob_intr_module_formatted_date (void);
1655 COB_EXPIMP cob_field *cob_intr_module_path (void);
1656 COB_EXPIMP cob_field *cob_intr_exception_file (void);
1657 COB_EXPIMP cob_field *cob_intr_exception_location (void);
1658 COB_EXPIMP cob_field *cob_intr_exception_status (void);
1659 COB_EXPIMP cob_field *cob_intr_exception_statement (void);
1660 COB_EXPIMP cob_field *cob_intr_mon_decimal_point (void);
1661 COB_EXPIMP cob_field *cob_intr_num_decimal_point (void);
1662 COB_EXPIMP cob_field *cob_intr_mon_thousands_sep (void);
1663 COB_EXPIMP cob_field *cob_intr_num_thousands_sep (void);
1664 COB_EXPIMP cob_field *cob_intr_currency_symbol (void);
1665 COB_EXPIMP cob_field *cob_intr_char (cob_field *);
1666 COB_EXPIMP cob_field *cob_intr_ord (cob_field *);
1667 COB_EXPIMP cob_field *cob_intr_stored_char_length (cob_field *);
1668 COB_EXPIMP cob_field *cob_intr_combined_datetime (cob_field *, cob_field *);
1669 COB_EXPIMP cob_field *cob_intr_date_of_integer (cob_field *);
1670 COB_EXPIMP cob_field *cob_intr_day_of_integer (cob_field *);
1671 COB_EXPIMP cob_field *cob_intr_integer_of_date (cob_field *);
1672 COB_EXPIMP cob_field *cob_intr_integer_of_day (cob_field *);
1673 COB_EXPIMP cob_field *cob_intr_test_date_yyyymmdd (cob_field *);
1674 COB_EXPIMP cob_field *cob_intr_test_day_yyyyddd (cob_field *);
1675 COB_EXPIMP cob_field *cob_intr_test_numval (cob_field *);
1676 COB_EXPIMP cob_field *cob_intr_test_numval_c (cob_field *, cob_field *);
1677 COB_EXPIMP cob_field *cob_intr_test_numval_f (cob_field *);
1678 COB_EXPIMP cob_field *cob_intr_factorial (cob_field *);
1679 
1680 COB_EXPIMP cob_field *cob_intr_pi (void);
1681 COB_EXPIMP cob_field *cob_intr_e (void);
1682 COB_EXPIMP cob_field *cob_intr_exp (cob_field *);
1683 COB_EXPIMP cob_field *cob_intr_exp10 (cob_field *);
1684 COB_EXPIMP cob_field *cob_intr_abs (cob_field *);
1685 COB_EXPIMP cob_field *cob_intr_acos (cob_field *);
1686 COB_EXPIMP cob_field *cob_intr_asin (cob_field *);
1687 COB_EXPIMP cob_field *cob_intr_atan (cob_field *);
1688 COB_EXPIMP cob_field *cob_intr_cos (cob_field *);
1689 COB_EXPIMP cob_field *cob_intr_log (cob_field *);
1690 COB_EXPIMP cob_field *cob_intr_log10 (cob_field *);
1691 COB_EXPIMP cob_field *cob_intr_sin (cob_field *);
1692 COB_EXPIMP cob_field *cob_intr_sqrt (cob_field *);
1693 COB_EXPIMP cob_field *cob_intr_tan (cob_field *);
1694 
1695 COB_EXPIMP cob_field *cob_intr_upper_case (const int, const int,
1696  cob_field *);
1697 COB_EXPIMP cob_field *cob_intr_lower_case (const int, const int,
1698  cob_field *);
1699 COB_EXPIMP cob_field *cob_intr_reverse (const int, const int,
1700  cob_field *);
1701 COB_EXPIMP cob_field *cob_intr_concatenate (const int, const int,
1702  const int, ...);
1703 COB_EXPIMP cob_field *cob_intr_substitute (const int, const int,
1704  const int, ...);
1705 COB_EXPIMP cob_field *cob_intr_substitute_case (const int, const int,
1706  const int, ...);
1707 COB_EXPIMP cob_field *cob_intr_trim (const int, const int,
1708  cob_field *, const int);
1709 COB_EXPIMP cob_field *cob_intr_length (cob_field *);
1710 COB_EXPIMP cob_field *cob_intr_byte_length (cob_field *);
1711 COB_EXPIMP cob_field *cob_intr_integer (cob_field *);
1712 COB_EXPIMP cob_field *cob_intr_integer_part (cob_field *);
1713 COB_EXPIMP cob_field *cob_intr_fraction_part (cob_field *);
1714 COB_EXPIMP cob_field *cob_intr_sign (cob_field *);
1715 COB_EXPIMP cob_field *cob_intr_lowest_algebraic (cob_field *);
1716 COB_EXPIMP cob_field *cob_intr_highest_algebraic (cob_field *);
1717 COB_EXPIMP cob_field *cob_intr_numval (cob_field *);
1718 COB_EXPIMP cob_field *cob_intr_numval_c (cob_field *, cob_field *);
1719 COB_EXPIMP cob_field *cob_intr_numval_f (cob_field *);
1720 COB_EXPIMP cob_field *cob_intr_annuity (cob_field *, cob_field *);
1721 COB_EXPIMP cob_field *cob_intr_mod (cob_field *, cob_field *);
1722 COB_EXPIMP cob_field *cob_intr_rem (cob_field *, cob_field *);
1723 COB_EXPIMP cob_field *cob_intr_sum (const int, ...);
1724 COB_EXPIMP cob_field *cob_intr_ord_min (const int, ...);
1725 COB_EXPIMP cob_field *cob_intr_ord_max (const int, ...);
1726 COB_EXPIMP cob_field *cob_intr_min (const int, ...);
1727 COB_EXPIMP cob_field *cob_intr_max (const int, ...);
1728 COB_EXPIMP cob_field *cob_intr_midrange (const int, ...);
1729 COB_EXPIMP cob_field *cob_intr_median (const int, ...);
1730 COB_EXPIMP cob_field *cob_intr_mean (const int, ...);
1731 COB_EXPIMP cob_field *cob_intr_range (const int, ...);
1732 COB_EXPIMP cob_field *cob_intr_random (const int, ...);
1733 COB_EXPIMP cob_field *cob_intr_variance (const int, ...);
1734 COB_EXPIMP cob_field *cob_intr_standard_deviation (const int, ...);
1735 COB_EXPIMP cob_field *cob_intr_present_value (const int, ...);
1736 COB_EXPIMP cob_field *cob_intr_year_to_yyyy (const int, ...);
1737 COB_EXPIMP cob_field *cob_intr_date_to_yyyymmdd (const int, ...);
1738 COB_EXPIMP cob_field *cob_intr_day_to_yyyyddd (const int, ...);
1739 COB_EXPIMP cob_field *cob_intr_locale_compare (const int, ...);
1740 COB_EXPIMP cob_field *cob_intr_locale_date (const int, const int,
1741  cob_field *, cob_field *);
1742 COB_EXPIMP cob_field *cob_intr_locale_time (const int, const int,
1743  cob_field *, cob_field *);
1744 
1745 COB_EXPIMP cob_field *cob_intr_seconds_past_midnight (void);
1746 COB_EXPIMP cob_field *cob_intr_lcl_time_from_secs (const int, const int,
1747  cob_field *, cob_field *);
1748 
1749 COB_EXPIMP cob_field *cob_intr_seconds_from_formatted_time (cob_field *,
1750  cob_field *);
1751 
1752 COB_EXPIMP cob_field *cob_intr_boolean_of_integer (cob_field *, cob_field *);
1753 COB_EXPIMP cob_field *cob_intr_char_national (cob_field *);
1754 COB_EXPIMP cob_field *cob_intr_display_of (const int, const int,
1755  const int, ...);
1756 COB_EXPIMP cob_field *cob_intr_exception_file_n (void);
1757 COB_EXPIMP cob_field *cob_intr_exception_location_n (void);
1758 COB_EXPIMP cob_field *cob_intr_formatted_current_date (const int, const int,
1759  cob_field *);
1760 COB_EXPIMP cob_field *cob_intr_formatted_date (const int, const int,
1761  cob_field *, cob_field *);
1762 COB_EXPIMP cob_field *cob_intr_formatted_datetime (const int, const int,
1763  const int, ...);
1764 COB_EXPIMP cob_field *cob_intr_formatted_time (const int, const int,
1765  const int, ...);
1766 COB_EXPIMP cob_field *cob_intr_integer_of_boolean (cob_field *);
1767 COB_EXPIMP cob_field *cob_intr_national_of (const int, const int,
1768  const int, ...);
1769 COB_EXPIMP cob_field *cob_intr_standard_compare (const int, ...);
1770 COB_EXPIMP cob_field *cob_intr_test_formatted_datetime (cob_field *, cob_field *);
1771 
1772 COB_EXPIMP cob_field *cob_intr_integer_of_formatted_date (cob_field *,
1773  cob_field *);
1774 
1775 /*******************************/
1776 
1777 #endif /* COB_COMMON_H */
cob_field * record
Definition: common.h:1115
int cob_sys_create_file(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: fileio.c:5039
cob_field * cob_intr_mon_thousands_sep(void)
Definition: intrinsic.c:5668
cob_field * cob_intr_acos(cob_field *)
Definition: intrinsic.c:4425
char * cob_locale_monetary
Definition: common.h:1199
void * cbj_ptr_rest[2]
Definition: common.h:1239
cob_global * cob_get_global_ptr(void)
Definition: common.c:1787
unsigned char flag_main
Definition: common.h:1079
cob_field * cob_intr_exp(cob_field *)
Definition: intrinsic.c:4285
cob_field * cob_intr_exception_location(void)
Definition: intrinsic.c:3857
void * cbj_ptr[4]
Definition: common.h:1237
cob_field * cob_intr_exception_file_n(void)
Definition: intrinsic.c:6481
unsigned int cob_orig_line
Definition: common.h:1206
struct __cob_global cob_global
int cob_sys_file_info(unsigned char *, unsigned char *)
Definition: fileio.c:5491
void cob_set_environment(const cob_field *, const cob_field *)
Definition: common.c:3018
char return_value_pointer[sizeof(char *)]
Definition: common.h:1364
char * cob_locale_time
Definition: common.h:1201
void cob_temp_name(char *, const char *)
Definition: common.c:3253
void cob_accept_escape_key(cob_field *)
Definition: screenio.c:2524
char has_option
Definition: common.h:1363
int lin_foot
Definition: common.h:1157
int cob_sys_hosted(void *, const void *)
Return some hosted C variables, argc, argv, stdin, stdout, stderr.
Definition: common.c:3465
int curr_lines
Definition: common.h:1178
cob_field * cob_intr_test_date_yyyymmdd(cob_field *)
Definition: intrinsic.c:4188
int cob_sys_create_dir(unsigned char *)
Definition: fileio.c:5369
cob_field * cob_intr_numval_f(cob_field *)
Definition: intrinsic.c:4596
void cob_decimal_init(cob_decimal *)
Definition: numeric.c:321
char * cob_locale_numeric
Definition: common.h:1200
cob_field * cob_intr_cos(cob_field *)
Definition: intrinsic.c:4513
void cob_rollback(void)
Definition: fileio.c:4863
cob_file * cob_error_file
Definition: common.h:1187
signed short scale
Definition: common.h:943
int cob_is_lower(const cob_field *)
Definition: common.c:2479
void cob_decimal_mul(cob_decimal *, cob_decimal *)
Definition: numeric.c:1891
void cob_add(cob_field *, cob_field *, const int)
Definition: numeric.c:1931
int cbj_int[4]
Definition: common.h:1236
#define cob_u32_t
Definition: common.h:31
void cob_reg_sighnd(void(*sighnd)(int))
Definition: common.c:2288
int cob_sys_sound_bell(void)
Definition: screenio.c:2506
void cob_string_delimited(cob_field *)
Definition: strings.c:430
void cob_unlock_file(cob_file *, cob_field *)
Definition: fileio.c:4431
cob_field * line_counter
Definition: common.h:1169
void cob_div_remainder(cob_field *, const int)
Definition: numeric.c:2001
char * cob_getenv(const char *)
Definition: common.c:3181
int cob_add_int(cob_field *, const int, const int)
Definition: numeric.c:2195
cob_field * linage
Definition: common.h:1151
int cob_sys_flush_file(unsigned char *)
Definition: fileio.c:5155
unsigned char organization
Definition: common.h:1127
unsigned char flag_exit_program
Definition: common.h:1081
unsigned int module_active
Definition: common.h:1060
cob_field * cob_intr_test_numval_f(cob_field *)
Definition: intrinsic.c:5787
int cob_sys_write_file(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: fileio.c:5113
unsigned int offset
Definition: common.h:1105
cob_field * cob_intr_standard_deviation(const int,...)
Definition: intrinsic.c:5090
cob_field * cob_intr_num_thousands_sep(void)
Definition: intrinsic.c:5703
cob_field * cob_intr_e(void)
Definition: intrinsic.c:4262
void cob_free(void *)
Definition: common.c:1284
cob_field * cob_intr_module_path(void)
Definition: intrinsic.c:3701
void * cob_resolve_cobol(const char *, const int, const int)
Definition: call.c:923
int cob_sys_xf4(void *, const void *)
Definition: common.c:3665
int cob_sys_nor(const void *, void *, const int)
Definition: common.c:3558
int cob_call(const char *, const int, void **)
Definition: call.c:1080
int cob_sys_parameter_size(void *)
Definition: common.c:3867
void cob_move(cob_field *, cob_field *)
Definition: move.c:1170
int curr_page
Definition: common.h:1177
void cob_file_sort_close(cob_file *)
Definition: fileio.c:6201
cob_field * cob_intr_module_time(void)
Definition: intrinsic.c:3625
cob_field * assign
Definition: common.h:1114
void cob_check_version(const char *, const char *, const int)
Definition: common.c:1894
int cob_sys_change_dir(unsigned char *)
Definition: fileio.c:5395
unsigned char flag_fold_call
Definition: common.h:1080
void cob_display_command_line(cob_field *)
Definition: common.c:2855
void cob_call_error(void)
Definition: call.c:878
int cob_sys_error_proc(const void *, const void *)
Definition: common.c:3381
cob_field * cob_intr_min(const int,...)
Definition: intrinsic.c:4835
int cob_sys_xf5(const void *, void *)
Definition: common.c:3681
int def_first_detail
Definition: common.h:1173
void cob_inspect_init(cob_field *, const unsigned int)
cob_field * cob_intr_pi(void)
Definition: intrinsic.c:4274
cob_field * cob_intr_combined_datetime(cob_field *, cob_field *)
Definition: intrinsic.c:4020
void cob_table_sort_init(const size_t, const unsigned char *)
Definition: common.c:2494
int(* rewrite)(cob_file *, const int)
Definition: common.h:1230
char * cob_strcat(char *, char *)
Definition: common.c:4270
cob_field * cob_intr_range(const int,...)
Definition: intrinsic.c:4998
int(* read)(cob_file *, cob_field *, const int)
Definition: common.h:1227
void cob_accept_exception_status(cob_field *)
Definition: common.c:1233
cob_field * column
Definition: common.h:1035
void cob_decimal_push(const unsigned int,...)
int cob_sys_clear_screen(void)
Definition: screenio.c:2377
cob_field * field
Definition: common.h:1102
void cob_correct_numeric(cob_field *)
Definition: common.c:1917
void * cob_savenv2(struct cobjmp_buf *, const int)
Definition: call.c:1178
void cob_read_next(cob_file *, cob_field *, const int)
Definition: fileio.c:4696
unsigned char numeric_separator
Definition: common.h:1071
cob_field * cob_intr_substitute(const int, const int, const int,...)
Definition: intrinsic.c:3762
void print_version(void)
Definition: common.c:5119
const char * module_formatted_date
Definition: common.h:1050
cob_field * cob_intr_mod(cob_field *, cob_field *)
Definition: intrinsic.c:4992
int dataint
Definition: common.h:1002
void cob_stop_run(const int)
Definition: common.c:1524
void cob_div_quotient(cob_field *, cob_field *, cob_field *, const int)
Definition: numeric.c:1967
int cob_sys_oc_nanosleep(const void *)
Definition: common.c:3774
void cob_check_ref_mod(const int, const int, const int, const char *)
Definition: common.c:2602
cob_module * save_module
Definition: common.h:1092
unsigned int perform_through
Definition: common.h:992
void cob_close(cob_file *, cob_field *, const int, const int)
Definition: fileio.c:4498
cob_call_union module_entry
Definition: common.h:1052
int cob_sys_delete_file(unsigned char *)
Definition: fileio.c:5165
cob_field * cob_intr_reverse(const int, const int, cob_field *)
Definition: intrinsic.c:3593
int cob_sys_close_file(unsigned char *)
Definition: fileio.c:5144
cob_field * cob_intr_ord_max(const int,...)
Definition: intrinsic.c:4809
void cob_decimal_set_field(cob_decimal *, cob_field *)
Definition: numeric.c:1612
int cob_sys_get_scr_size(unsigned char *, unsigned char *)
Definition: screenio.c:2552
const char * cob_cstr_name
Definition: common.h:1021
const char * cob_orig_paragraph
Definition: common.h:1192
cob_field * cob_intr_present_value(const int,...)
Definition: intrinsic.c:5113
void cob_accept_time(cob_field *)
Definition: common.c:2842
int cob_valid_date_format(const char *)
Definition: intrinsic.c:3355
cob_field * cob_intr_integer_of_day(cob_field *)
Definition: intrinsic.c:4161
cob_field * cob_intr_stored_char_length(cob_field *)
Definition: intrinsic.c:4002
cob_field * cob_intr_factorial(cob_field *)
Definition: intrinsic.c:4241
void cob_file_sort_giving(cob_file *, const size_t,...)
Definition: fileio.c:6095
cob_field * cob_intr_rem(cob_field *, cob_field *)
Definition: intrinsic.c:5017
void cob_check_odo(const int, const int, const int, const char *)
Definition: common.c:2578
cob_field * cob_intr_median(const int,...)
Definition: intrinsic.c:4907
cob_field * cob_intr_integer_part(cob_field *)
Definition: intrinsic.c:3513
void cob_cancel_field(const cob_field *, const struct cob_call_struct *)
Definition: call.c:1047
cob_field * cob_intr_substitute_case(const int, const int, const int,...)
Definition: intrinsic.c:3776
unsigned char flag_operation
Definition: common.h:1133
int cob_sys_imp(const void *, void *, const int)
Definition: common.c:3594
unsigned char * data
Definition: common.h:952
void cob_table_sort(cob_field *, const int)
Definition: common.c:2516
int cob_sys_open_file(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: fileio.c:5026
cob_field * cob_intr_seconds_from_formatted_time(cob_field *, cob_field *)
Definition: intrinsic.c:5325
cob_field * cob_intr_current_date(const int, const int)
Definition: intrinsic.c:3952
void cob_inspect_first(cob_field *, cob_field *)
Definition: strings.c:341
cob_field * cob_intr_upper_case(const int, const int, cob_field *)
Definition: intrinsic.c:3559
#define cob_s64_t
Definition: common.h:51
struct __cob_screen * next
Definition: common.h:1028
void cob_accept_command_line(cob_field *)
Definition: common.c:2866
cob_field * page_counter
Definition: common.h:1168
int cob_cmp_uint(cob_field *, const unsigned int)
Definition: numeric.c:2266
int occurs
Definition: common.h:1040
int cob_sys_rename_file(unsigned char *, unsigned char *)
Definition: fileio.c:5299
cob_field * cob_intr_mean(const int,...)
Definition: intrinsic.c:4955
unsigned char flag_optional
Definition: common.h:1131
cob_field * foreg
Definition: common.h:1036
cob_field * cob_intr_log10(cob_field *)
Definition: intrinsic.c:4383
int def_footing
Definition: common.h:1176
void cob_read(cob_file *, cob_field *, cob_field *, const int)
Definition: fileio.c:4633
cob_field * cob_intr_module_formatted_date(void)
Definition: intrinsic.c:3674
int cob_max_x
Definition: common.h:1218
void * cob_external_addr(const char *, const int)
Definition: common.c:2621
int cob_call_params
Definition: common.h:1204
cob_field * cob_intr_integer(cob_field *)
Definition: intrinsic.c:3487
void cob_rewrite(cob_file *, cob_field *, const int, cob_field *)
Definition: fileio.c:4793
unsigned char currency_symbol
Definition: common.h:1070
void * funcvoid
Definition: common.h:1010
cob_field * cob_intr_abs(cob_field *)
Definition: intrinsic.c:4414
size_t record_min
Definition: common.h:1122
void cob_init(const int, char **)
Definition: common.c:5390
cob_field * cob_intr_exception_statement(void)
Definition: intrinsic.c:3920
int cob_get_int(cob_field *)
Definition: move.c:1626
unsigned char ebcdic_sign
Definition: common.h:1068
int cob_sys_justify(void *,...)
Definition: common.c:4086
unsigned long long dataull
Definition: common.h:1001
char * cob_strjoin(char **, int, char *)
Definition: common.c:4302
long long datall
Definition: common.h:1000
void * linorkeyptr
Definition: common.h:1119
void cob_decimal_set_llint(cob_decimal *, const long long)
#define COB_A_MALLOC
Definition: common.h:438
cob_field * latbot
Definition: common.h:1155
void cob_check_based(const unsigned char *, const char *)
Definition: common.c:2525
const char * cob_resolve_error(void)
Definition: call.c:864
void cob_field_accept(cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, const int)
Definition: screenio.c:2353
void cob_accept_day(cob_field *)
Definition: common.c:2803
unsigned char lock_mode
Definition: common.h:1129
cob_field * cob_intr_national_of(const int, const int, const int,...)
Definition: intrinsic.c:6501
void cob_screen_accept(cob_screen *, cob_field *, cob_field *, cob_field *)
Definition: screenio.c:2330
void cob_file_sort_using(cob_file *, cob_file *)
Definition: fileio.c:6075
int def_lines
Definition: common.h:1170
void cob_unstring_into(cob_field *, cob_field *, cob_field *)
Definition: strings.c:524
int def_last_control
Definition: common.h:1174
cob_field * cob_intr_standard_compare(const int,...)
Definition: intrinsic.c:6511
int def_heading
Definition: common.h:1172
struct __cob_screen * prev
Definition: common.h:1029
size_t record_max
Definition: common.h:1123
struct __cob_module cob_module
void cob_check_subscript(const int, const int, const int, const char *)
Definition: common.c:2590
int cob_sys_sleep(const void *)
Definition: common.c:4031
int cob_sys_get_current_dir(const int, const int, unsigned char *)
Definition: fileio.c:5328
cob_field * cob_intr_display_of(const int, const int, const int,...)
Definition: intrinsic.c:6470
int save_call_params
Definition: common.h:1093
unsigned int * module_ref_count
Definition: common.h:1057
cob_field * cob_intr_lowest_algebraic(cob_field *)
Definition: intrinsic.c:5794
void cob_set_location(const char *, const unsigned int, const char *, const char *, const char *)
Definition: common.c:1388
void cob_accept_environment(cob_field *)
Definition: common.c:3055
int cob_cmp_int(cob_field *, const int)
Definition: numeric.c:2257
void cob_screen_line_col(cob_field *, const int)
Definition: screenio.c:2366
unsigned int cob_physical_cancel
Definition: common.h:1209
cob_field * cob_intr_length(cob_field *)
Definition: intrinsic.c:3469
int cob_sys_copyfile(unsigned char *, unsigned char *, unsigned char *)
Definition: fileio.c:5470
cob_field * cob_intr_ord_min(const int,...)
Definition: intrinsic.c:4783
char name[25]
Definition: common.h:1362
unsigned char * cob_term_buff
Definition: common.h:1214
int cob_numeric_cmp(cob_field *, cob_field *)
Definition: numeric.c:2348
unsigned char flag_binary_truncate
Definition: common.h:1074
void cob_delete(cob_file *, cob_field *)
Definition: fileio.c:4829
unsigned int module_time
Definition: common.h:1062
void cob_decimal_pow(cob_decimal *, cob_decimal *)
Definition: intrinsic.c:2990
int cob_sys_delete_dir(unsigned char *)
Definition: fileio.c:5417
void * cob_realloc(void *, const size_t, const size_t)
Definition: common.c:1262
const unsigned char * collating_sequence
Definition: common.h:1054
void cob_div(cob_field *, cob_field *, const int)
Definition: numeric.c:1958
void * cob_cache_realloc(void *, const size_t)
Definition: common.c:1336
int cob_is_upper(const cob_field *)
Definition: common.c:2466
struct __cob_module * next
Definition: common.h:1047
cob_field * cob_intr_mon_decimal_point(void)
Definition: intrinsic.c:5598
void cob_screen_display(cob_screen *, cob_field *, cob_field *)
Definition: screenio.c:2321
cob_field * cob_intr_formatted_current_date(const int, const int, cob_field *)
Definition: intrinsic.c:6407
int cob_valid_datetime_format(const char *, const char)
Definition: intrinsic.c:3402
cob_field * cob_intr_binop(cob_field *, const int, cob_field *)
Definition: intrinsic.c:3429
void cob_unstring_tallying(cob_field *)
Definition: strings.c:614
int cob_sub_int(cob_field *, const int, const int)
Definition: numeric.c:2251
int cob_sys_x91(void *, const void *, void *)
Definition: common.c:3696
int cob_initial_external
Definition: common.h:1205
cob_field * cob_intr_date_to_yyyymmdd(const int,...)
Definition: intrinsic.c:5208
void cob_field_display(cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, cob_field *, const int)
Definition: screenio.c:2341
void cob_inspect_before(const cob_field *)
Definition: strings.c:270
int cob_sys_not(void *, const int)
Definition: common.c:3648
int cob_is_numeric(const cob_field *)
Definition: common.c:2375
void cob_check_linkage(const unsigned char *, const char *, const int)
Definition: common.c:2535
void * return_address_ptr
Definition: common.h:991
cob_field * cob_intr_integer_of_boolean(cob_field *)
Definition: intrinsic.c:6493
cob_field * backg
Definition: common.h:1037
void cob_gmp_free(void *)
Definition: numeric.c:217
unsigned int module_date
Definition: common.h:1061
cob_module * cob_current_module
Definition: common.h:1188
char * cob_locale_collate
Definition: common.h:1197
void cob_get_environment(const cob_field *, cob_field *)
Definition: common.c:3025
cob_field * linage_ctr
Definition: common.h:1152
void cob_accept_date_yyyymmdd(cob_field *)
Definition: common.c:2792
cob_field * prompt
Definition: common.h:1038
void cob_accept_date(cob_field *)
Definition: common.c:2781
int cob_decimal_cmp(cob_decimal *, cob_decimal *)
Definition: numeric.c:1922
void cob_decimal_add(cob_decimal *, cob_decimal *)
Definition: numeric.c:1875
cob_field * cob_intr_sign(cob_field *)
Definition: intrinsic.c:3551
cob_field * cob_intr_random(const int,...)
Definition: intrinsic.c:5023
int cob_sys_toupper(void *, const int)
Definition: common.c:3738
cob_field * latfoot
Definition: common.h:1153
void cob_table_sort_init_key(cob_field *, const int, const unsigned int)
Definition: common.c:2506
void cob_fatal_error(const int)
Definition: common.c:1601
int cob_sys_nimp(const void *, void *, const int)
Definition: common.c:3612
cob_field * value
Definition: common.h:1033
void cob_string_init(cob_field *, cob_field *)
Definition: strings.c:408
cob_field * cob_intr_formatted_time(const int, const int, const int,...)
Definition: intrinsic.c:6076
unsigned int module_type
Definition: common.h:1063
unsigned char flag_filename_mapping
Definition: common.h:1073
#define COB_A_NORETURN
Definition: common.h:366
int lin_lines
Definition: common.h:1156
int cob_tidy(void)
Definition: common.c:3315
void cob_set_locale(cob_field *, const int)
Definition: common.c:4165
unsigned char flag_host_sign
Definition: common.h:1076
cob_field * cob_intr_num_decimal_point(void)
Definition: intrinsic.c:5633
unsigned int module_param_cnt
Definition: common.h:1064
int cob_cmp_packed(cob_field *, const long long)
cob_field * field
Definition: common.h:1032
unsigned char flag_read_done
Definition: common.h:1139
void cob_unstring_finish(void)
Definition: strings.c:620
void cob_set_packed_int(cob_field *, const int)
Definition: numeric.c:1261
cob_field * cob_intr_module_id(void)
Definition: intrinsic.c:3640
cob_field * cob_intr_formatted_date(const int, const int, cob_field *, cob_field *)
Definition: intrinsic.c:6035
void cob_cancel(const char *)
Definition: call.c:1013
void cob_set_int(cob_field *, const int)
Definition: move.c:1612
void cob_decimal_div(cob_decimal *, cob_decimal *)
Definition: numeric.c:1899
void cob_accept_arg_number(cob_field *)
Definition: common.c:2930
int module_num_params
Definition: common.h:1066
void cob_inspect_characters(cob_field *)
Definition: strings.c:297
cob_field * cob_intr_variance(const int,...)
Definition: intrinsic.c:5078
void cob_accept_user_name(cob_field *)
Definition: common.c:1239
void cob_inspect_finish(void)
Definition: strings.c:388
int cob_cmp(cob_field *, cob_field *)
Definition: common.c:2318
cob_field * cob_intr_test_numval(cob_field *)
Definition: intrinsic.c:5773
void cob_set_switch(const int, const int)
Definition: common.c:2305
void cob_string_append(cob_field *)
Definition: strings.c:440
int cob_load_config(void)
Definition: common.c:5063
void * cob_fast_malloc(const size_t)
Definition: common.c:1296
cob_field * cob_intr_sqrt(cob_field *)
Definition: intrinsic.c:4561
cob_field * cob_intr_year_to_yyyy(const int,...)
Definition: intrinsic.c:5151
int(* close)(cob_file *, const int)
Definition: common.h:1225
int curr_status
Definition: common.h:1180
cob_field * cob_intr_numval(cob_field *)
Definition: intrinsic.c:4584
struct __cob_screen * child
Definition: common.h:1030
const char * cob_orig_section
Definition: common.h:1191
cob_field * cob_intr_exception_status(void)
Definition: intrinsic.c:3900
void cob_file_return(cob_file *)
Definition: fileio.c:6250
void cob_unstring_delimited(cob_field *, const unsigned int)
struct __cob_screen cob_screen
int cob_cmp_float(cob_field *, cob_field *)
Definition: numeric.c:2315
void cob_trace_section(const char *, const char *, const int)
Definition: common.c:1429
void cob_commit(void)
Definition: fileio.c:4851
void cob_set_cancel(cob_module *)
Definition: call.c:885
cob_field * cob_intr_integer_of_formatted_date(cob_field *, cob_field *)
Definition: intrinsic.c:6361
void cob_string_finish(void)
Definition: strings.c:477
const char * module_name
Definition: common.h:1049
cob_field * cob_intr_log(cob_field *)
Definition: intrinsic.c:4352
void cob_display_environment(const cob_field *)
Definition: common.c:2959
cob_field * cob_intr_test_day_yyyyddd(cob_field *)
Definition: intrinsic.c:4218
void * cob_malloc(const size_t)
Definition: common.c:1250
void cob_decimal_sub(cob_decimal *, cob_decimal *)
Definition: numeric.c:1883
void cob_inspect_all(cob_field *, cob_field *)
Definition: strings.c:329
void cob_accept(cob_field *)
Definition: termio.c:283
cob_field * cob_intr_date_of_integer(cob_field *)
Definition: intrinsic.c:4067
unsigned short digits
Definition: common.h:942
int cob_accept_status
Definition: common.h:1215
int(* read_next)(cob_file *, const int)
Definition: common.h:1228
int cob_sys_system(const void *)
Definition: common.c:3426
const char * cob_orig_statement
Definition: common.h:1189
int cob_check_numval(const cob_field *, const cob_field *, const int, const int)
Definition: intrinsic.c:3132
int cob_sys_calledby(void *)
Definition: common.c:3841
void cob_accept_arg_value(cob_field *)
Definition: common.c:2945
unsigned int cob_got_exception
Definition: common.h:1207
int cob_sys_eq(const void *, void *, const int)
Definition: common.c:3630
cob_field * cob_intr_lcl_time_from_secs(const int, const int, cob_field *, cob_field *)
Definition: intrinsic.c:5557
cob_field * cob_intr_seconds_past_midnight(void)
Definition: intrinsic.c:5306
void cob_inspect_converting(const cob_field *, const cob_field *)
Definition: strings.c:353
#define COB_EXPIMP
Definition: common.h:336
void * cob_command_line(int, int *, char ***, char ***, char **)
Definition: common.c:3279
unsigned int cob_screen_initialized
Definition: common.h:1208
void cob_open(cob_file *, const int, const int, cob_field *)
Definition: fileio.c:4438
cob_field * cob_intr_char_national(cob_field *)
Definition: intrinsic.c:6462
void cob_inspect_start(void)
Definition: strings.c:263
void cob_write(cob_file *, cob_field *, const int, cob_field *, const unsigned int)
Definition: fileio.c:4754
cob_field * cob_intr_when_compiled(const int, const int, cob_field *)
Definition: intrinsic.c:3940
cob_field * cob_intr_asin(cob_field *)
Definition: intrinsic.c:4455
cob_field * cob_intr_boolean_of_integer(cob_field *, cob_field *)
Definition: intrinsic.c:6453
int cob_valid_time_format(const char *, const char)
Definition: intrinsic.c:3366
int cob_decimal_get_field(cob_decimal *, cob_field *, const int)
Definition: numeric.c:1801
unsigned char decimal_point
Definition: common.h:1069
char * cob_locale_orig
Definition: common.h:1195
struct __cob_screen * parent
Definition: common.h:1031
size_t size
Definition: common.h:951
cob_field * cob_intr_module_source(void)
Definition: intrinsic.c:3688
int save_num_params
Definition: common.h:1094
void * cob_call_field(const cob_field *, const struct cob_call_struct *, const unsigned int, const int)
Definition: call.c:957
void cob_file_release(cob_file *)
Definition: fileio.c:6227
const char * cob_main_argv0
Definition: common.h:1193
cob_field * cob_intr_sum(const int,...)
Definition: intrinsic.c:4759
cob_field * cob_intr_locale_compare(const int,...)
Definition: intrinsic.c:5937
int cob_sys_check_file_exist(unsigned char *, unsigned char *)
Definition: fileio.c:5239
void cob_reset_trace(void)
Definition: common.c:1468
void cob_check_numeric(const cob_field *, const char *)
Definition: common.c:2552
void cob_display(const int, const int, const int,...)
Definition: termio.c:238
cob_field * cob_intr_fraction_part(cob_field *)
Definition: intrinsic.c:3532
cob_field * line
Definition: common.h:1034
cob_field * variable_record
Definition: common.h:1116
cob_field * cob_intr_char(cob_field *)
Definition: intrinsic.c:3977
cob_field * cob_intr_module_caller_id(void)
Definition: intrinsic.c:3653
cob_field * cob_intr_concatenate(const int, const int, const int,...)
Definition: intrinsic.c:3723
void cob_mul(cob_field *, cob_field *, const int)
Definition: numeric.c:1949
int cob_sys_printable(void *,...)
Definition: common.c:4053
cob_field * cob_intr_locale_date(const int, const int, cob_field *, cob_field *)
Definition: intrinsic.c:5375
unsigned char flag_select_features
Definition: common.h:1140
int cob_max_y
Definition: common.h:1217
cob_field * cob_intr_day_to_yyyyddd(const int,...)
Definition: intrinsic.c:5254
cob_exception_id
Definition: common.h:710
void cob_display_arg_number(cob_field *)
Definition: common.c:2911
cob_field * cob_intr_sin(cob_field *)
Definition: intrinsic.c:4529
void cob_accept_day_yyyyddd(cob_field *)
Definition: common.c:2814
int(* start)(cob_file *, const int, cob_field *)
Definition: common.h:1226
void cob_unstring_init(cob_field *, cob_field *, const size_t)
Definition: strings.c:487
cob_field ** save_proc_parms
Definition: common.h:1089
jmp_buf cbj_jmp_buf
Definition: common.h:1238
void cob_inspect_trailing(cob_field *, cob_field *)
Definition: strings.c:347
cob_field * cursor_pos
Definition: common.h:1056
cob_field * cob_intr_ord(cob_field *)
Definition: intrinsic.c:3995
#define DECLNORET
Definition: common.h:376
int cob_extern_init(void)
Definition: common.c:3272
void cob_incr_temp_iteration(void)
Definition: common.c:3266
unsigned int module_returning
Definition: common.h:1065
char * cob_locale_messages
Definition: common.h:1198
int lin_bot
Definition: common.h:1159
cob_field * ret_fld
Definition: common.h:1088
int cob_putenv(char *)
Definition: common.c:3195
int cob_get_switch(const int)
Definition: common.c:2296
unsigned char last_open_mode
Definition: common.h:1132
const unsigned char * sort_collating
Definition: common.h:1120
cob_field * cob_switch_value(const int)
Definition: intrinsic.c:2980
void cob_free_alloc(unsigned char **, unsigned char *)
Definition: common.c:3131
void cob_start(cob_file *, const int, cob_field *, cob_field *, cob_field *)
Definition: fileio.c:4584
void * cob_cache_malloc(const size_t)
Definition: common.c:1321
cob_field * cob_intr_locale_time(const int, const int, cob_field *, cob_field *)
Definition: intrinsic.c:5496
const char * cob_orig_program_id
Definition: common.h:1190
int cob_sys_get_csr_pos(unsigned char *)
Definition: screenio.c:2530
void * cob_resolve(const char *)
Definition: call.c:908
cob_field * cob_intr_numval_c(cob_field *, cob_field *)
Definition: intrinsic.c:4590
cob_field * cob_intr_atan(cob_field *)
Definition: intrinsic.c:4491
int cob_sys_copy_file(unsigned char *, unsigned char *)
Definition: fileio.c:5187
cob_call_union cob_cstr_cancel
Definition: common.h:1023
int(* write)(cob_file *, const int)
Definition: common.h:1229
void cob_set_packed_zero(cob_field *)
Definition: numeric.c:1073
void cob_allocate(unsigned char **, cob_field *, cob_field *, cob_field *)
Definition: common.c:3089
char return_value[4]
Definition: common.h:1365
unsigned short type
Definition: common.h:941
void * cob_get_prog_pointer(const void *)
Definition: common.c:1483
const char ** module_path
Definition: common.h:1058
cob_call_union module_cancel
Definition: common.h:1053
void cob_module_enter(cob_module **, cob_global **, const int)
Definition: common.c:1796
void cob_inspect_leading(cob_field *, cob_field *)
Definition: strings.c:335
int cob_exception_code
Definition: common.h:1203
unsigned char flag_begin_of_file
Definition: common.h:1137
struct longoption_def longoption_def
void * cob_savenv(struct cobjmp_buf *)
Definition: call.c:1160
int cob_sys_xor(const void *, void *, const int)
Definition: common.c:3576
cob_field * cob_intr_day_of_integer(cob_field *)
Definition: intrinsic.c:4097
char * cob_locale
Definition: common.h:1194
size_t nkeys
Definition: common.h:1124
void print_runtime_env(void)
Definition: common.c:5234
mpz_t value
Definition: common.h:985
void * file
Definition: common.h:1118
cob_field * cob_intr_module_date(void)
Definition: intrinsic.c:3610
void cob_get_indirect_field(cob_field *)
Definition: intrinsic.c:3096
const char * module_source
Definition: common.h:1051
const char * pic
Definition: common.h:945
#define cob_u64_t
Definition: common.h:52
cob_field ** cob_procedure_params
Definition: common.h:1048
void cob_decimal_pop(const unsigned int,...)
unsigned char access_mode
Definition: common.h:1128
int cob_is_omitted(const cob_field *)
Definition: common.c:2369
cob_field * cob_intr_midrange(const int,...)
Definition: intrinsic.c:4883
void cob_decimal_alloc(const unsigned int,...)
int cob_cmp_numdisp(const unsigned char *, const size_t, const long long, const unsigned int)
cob_file * report_file
Definition: common.h:1167
unsigned char flag_end_of_file
Definition: common.h:1136
int cob_sys_getpid(void)
Definition: common.c:3818
void cob_longjmp(struct cobjmp_buf *)
Definition: call.c:1186
unsigned char * cob_get_pointer(const void *)
Definition: common.c:1474
cob_field * cob_intr_exp10(cob_field *)
Definition: intrinsic.c:4307
unsigned char flag_pretty_display
Definition: common.h:1075
cob_field * cob_intr_exception_location_n(void)
Definition: intrinsic.c:6487
int cob_sys_exit_proc(const void *, const void *)
Definition: common.c:3336
char * cob_int_to_string(int, char *)
Definition: common.c:4238
void cob_module_leave(cob_module *)
Definition: common.c:1827
cob_field * crt_status
Definition: common.h:1055
int cob_is_alpha(const cob_field *)
Definition: common.c:2453
int cob_cmp_llint(cob_field *, const long long)
cob_field * cob_intr_currency_symbol(void)
Definition: intrinsic.c:5738
int cob_sys_tolower(void *, const int)
Definition: common.c:3756
void * cob_save_func(cob_field **, const int, const int,...)
Definition: common.c:1835
int cob_sys_or(const void *, void *, const int)
Definition: common.c:3540
void cob_inspect_after(const cob_field *)
Definition: strings.c:283
cob_field * cob_intr_trim(const int, const int, cob_field *, const int)
Definition: intrinsic.c:3790
cob_field ** func_params
Definition: common.h:1090
int cob_sys_chdir(unsigned char *, unsigned char *)
Definition: fileio.c:5453
void cob_delete_file(cob_file *, cob_field *)
Definition: fileio.c:4875
int cob_sys_file_delete(unsigned char *, unsigned char *)
Definition: fileio.c:5555
unsigned char flag_needs_nl
Definition: common.h:1141
void cob_accept_day_of_week(cob_field *)
Definition: common.c:2825
cob_field * cob_intr_byte_length(cob_field *)
Definition: intrinsic.c:3480
unsigned char file_version
Definition: common.h:1143
char * cob_expand_env_string(char *)
Definition: common.c:4406
const char * select_name
Definition: common.h:1112
int cob_sys_return_args(void *)
Definition: common.c:3827
void cob_file_sort_init_key(cob_file *, cob_field *, const int, const unsigned int)
Definition: fileio.c:6191
void cob_restore_func(struct cob_func_loc *)
Definition: common.c:1879
cob_field * cob_intr_test_formatted_datetime(cob_field *, cob_field *)
Definition: intrinsic.c:6273
cob_field * cob_intr_annuity(cob_field *, cob_field *)
Definition: intrinsic.c:4712
void cob_sub(cob_field *, cob_field *, const int)
Definition: numeric.c:1940
void print_info(void)
Definition: common.c:5153
int cob_sys_read_file(unsigned char *, unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: fileio.c:5066
cob_field * cob_intr_integer_of_date(cob_field *)
Definition: intrinsic.c:4126
int(* open)(cob_file *, char *, const int, const int)
Definition: common.h:1224
unsigned int return_address_num
Definition: common.h:993
unsigned char flag_no_phys_canc
Definition: common.h:1078
void cob_cache_free(void *)
Definition: common.c:1362
unsigned char ** data
Definition: common.h:1091
cob_field * cob_intr_max(const int,...)
Definition: intrinsic.c:4859
void cob_file_sort_init(cob_file *, const unsigned int, const unsigned char *, void *, cob_field *)
Definition: fileio.c:6146
int cob_sys_getopt_long_long(void *, void *, void *, const int, void *, void *)
Definition: common.c:3889
cob_field * cob_intr_exception_file(void)
Definition: intrinsic.c:3833
void cob_chain_setup(void *, const size_t, const size_t)
Definition: common.c:3070
cob_field * cob_intr_tan(cob_field *)
Definition: intrinsic.c:4545
int cob_sys_and(const void *, void *, const int)
Definition: common.c:3522
cob_field * cob_intr_highest_algebraic(cob_field *)
Definition: intrinsic.c:5866
int cob_sys_mkdir(unsigned char *)
Definition: fileio.c:5439
char * cob_int_to_formatted_bytestring(int, char *)
Definition: common.c:4246
int cob_func(const char *, const int, void **)
Definition: call.c:1150
cob_field * cob_intr_test_numval_c(cob_field *, cob_field *)
Definition: intrinsic.c:5780
void * cob_resolve_func(const char *)
Definition: call.c:944
void cob_display_env_value(const cob_field *)
Definition: common.c:2981
cob_field * cob_intr_formatted_datetime(const int, const int, const int,...)
Definition: intrinsic.c:6169
int(* fdelete)(cob_file *)
Definition: common.h:1231
char * cob_locale_ctype
Definition: common.h:1196
cob_call_union cob_cstr_call
Definition: common.h:1022
long long cob_get_llint(cob_field *)
Definition: move.c:1656
cob_field * cob_intr_lower_case(const int, const int, cob_field *)
Definition: intrinsic.c:3576
void cob_put_indirect_field(cob_field *)
Definition: intrinsic.c:3088
void cob_ready_trace(void)
Definition: common.c:1462
void cob_set_exception(const int)
Definition: common.c:1212