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 
   31 #define cob_u32_t       unsigned int 
   32 #define cob_sli_t       long int 
   33 #define cob_uli_t       unsigned long int 
   35 #if defined(_WIN32) && !defined(__MINGW32__) && !defined(__MINGW64__) 
   37 #define cob_s64_t       __int64 
   38 #define cob_u64_t       unsigned __int64 
   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" 
   51 #define cob_s64_t       long long 
   52 #define cob_u64_t       unsigned long long 
   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" 
   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 * 
   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 * 
   92 #undef  COB_BSWAP_16_CONSTANT 
   93 #undef  COB_BSWAP_32_CONSTANT 
   94 #undef  COB_BSWAP_64_CONSTANT 
   99 #define COB_BSWAP_16_CONSTANT(val)  ((cob_u16_t) (      \ 
  100     (((cob_u16_t)(val) & (cob_u16_t) 0x00FFU) << 8) |       \ 
  101     (((cob_u16_t)(val) & (cob_u16_t) 0xFF00U) >> 8))) 
  103 #define COB_BSWAP_32_CONSTANT(val)  ((cob_u32_t) (      \ 
  104     (((cob_u32_t) (val) & (cob_u32_t) 0x000000FFU) << 24) | \ 
  105     (((cob_u32_t) (val) & (cob_u32_t) 0x0000FF00U) <<  8) | \ 
  106     (((cob_u32_t) (val) & (cob_u32_t) 0x00FF0000U) >>  8) | \ 
  107     (((cob_u32_t) (val) & (cob_u32_t) 0xFF000000U) >> 24))) 
  109 #define COB_BSWAP_64_CONSTANT(val)  ((cob_u64_t) (      \ 
  110     (((cob_u64_t) (val) &                   \ 
  111       (cob_u64_t) COB_U64_C(0x00000000000000FF)) << 56) |   \ 
  112     (((cob_u64_t) (val) &                   \ 
  113       (cob_u64_t) COB_U64_C(0x000000000000FF00)) << 40) |   \ 
  114     (((cob_u64_t) (val) &                   \ 
  115       (cob_u64_t) COB_U64_C(0x0000000000FF0000)) << 24) |   \ 
  116     (((cob_u64_t) (val) &                   \ 
  117       (cob_u64_t) COB_U64_C(0x00000000FF000000)) <<  8) |   \ 
  118     (((cob_u64_t) (val) &                   \ 
  119       (cob_u64_t) COB_U64_C(0x000000FF00000000)) >>  8) |   \ 
  120     (((cob_u64_t) (val) &                   \ 
  121       (cob_u64_t) COB_U64_C(0x0000FF0000000000)) >> 24) |   \ 
  122     (((cob_u64_t) (val) &                   \ 
  123       (cob_u64_t) COB_U64_C(0x00FF000000000000)) >> 40) |   \ 
  124     (((cob_u64_t) (val) &                   \ 
  125       (cob_u64_t) COB_U64_C(0xFF00000000000000)) >> 56))) 
  131 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 
  133 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  134 #define COB_BSWAP_32(val) (__builtin_bswap32 (val)) 
  135 #define COB_BSWAP_64(val) (__builtin_bswap64 (val)) 
  137 #elif   defined(__i386__) 
  139 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  140 #define COB_BSWAP_32(val)                   \ 
  142     ({ register cob_u32_t __v,              \ 
  143          __x = ((cob_u32_t) (val));             \ 
  144        if (__builtin_constant_p (__x))          \ 
  145          __v = COB_BSWAP_32_CONSTANT (__x);         \ 
  147          __asm__ ("bswap %0"                \ 
  151 #define COB_BSWAP_64(val)                   \ 
  153     ({ union { cob_u64_t __ll;              \ 
  154            cob_u32_t __l[2]; } __w, __r;        \ 
  155        __w.__ll = ((cob_u64_t) (val));          \ 
  156        if (__builtin_constant_p (__w.__ll))         \ 
  157          __r.__ll = COB_BSWAP_64_CONSTANT (__w.__ll);   \ 
  160            __r.__l[0] = COB_BSWAP_32 (__w.__l[1]);      \ 
  161            __r.__l[1] = COB_BSWAP_32 (__w.__l[0]);      \ 
  165 #elif defined (__ia64__) 
  167 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  168 #define COB_BSWAP_32(val)                   \ 
  170      ({ register cob_u32_t __v,             \ 
  171           __x = ((cob_u32_t) (val));            \ 
  172         if (__builtin_constant_p (__x))         \ 
  173           __v = COB_BSWAP_32_CONSTANT (__x);        \ 
  175          __asm__ __volatile__ ("shl %0 = %1, 32 ;;"     \ 
  176                    "mux1 %0 = %0, @rev ;;"  \ 
  180 #define COB_BSWAP_64(val)                   \ 
  182     ({ register cob_u64_t __v,              \ 
  183          __x = ((cob_u64_t) (val));             \ 
  184        if (__builtin_constant_p (__x))          \ 
  185          __v = COB_BSWAP_64_CONSTANT (__x);         \ 
  187          __asm__ __volatile__ ("mux1 %0 = %1, @rev ;;"  \ 
  192 #elif defined (__x86_64__) 
  194 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  195 #define COB_BSWAP_32(val)                   \ 
  197     ({ register cob_u32_t __v,              \ 
  198          __x = ((cob_u32_t) (val));             \ 
  199        if (__builtin_constant_p (__x))          \ 
  200          __v = COB_BSWAP_32_CONSTANT (__x);         \ 
  202         __asm__ ("bswapl %0"                \ 
  206 #define COB_BSWAP_64(val)                   \ 
  208     ({ register cob_u64_t __v,              \ 
  209          __x = ((cob_u64_t) (val));             \ 
  210        if (__builtin_constant_p (__x))          \ 
  211          __v = COB_BSWAP_64_CONSTANT (__x);         \ 
  213          __asm__ ("bswapq %0"               \ 
  220 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  221 #define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val)) 
  222 #define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val)) 
  226 #elif defined(_MSC_VER) && (_MSC_VER >= 1400) 
  228 #define COB_BSWAP_16(val) (_byteswap_ushort (val)) 
  229 #define COB_BSWAP_32(val) (_byteswap_ulong (val)) 
  230 #define COB_BSWAP_64(val) (_byteswap_uint64 (val)) 
  234 #define COB_BSWAP_16(val) (COB_BSWAP_16_CONSTANT (val)) 
  235 #define COB_BSWAP_32(val) (COB_BSWAP_32_CONSTANT (val)) 
  236 #define COB_BSWAP_64(val) (COB_BSWAP_64_CONSTANT (val)) 
  246 #ifndef _CRT_SECURE_NO_DEPRECATE 
  247 #define _CRT_SECURE_NO_DEPRECATE    1 
  255 #pragma warning(disable: 4996) 
  257 #pragma warning(disable: 4255) 
  259 #define strncasecmp     _strnicmp 
  260 #define strcasecmp      _stricmp 
  261 #define snprintf        _snprintf 
  262 #define getpid          _getpid 
  263 #define access          _access 
  265 #define __attribute__(x) 
  270 #define S_ISDIR(x)      (((x) & _S_IFMT) == _S_IFDIR) 
  275 #define S_ISREG(x)      (((x) & _S_IFMT) == _S_IFREG) 
  290 #define _ftime(a)   ftime(a) 
  291 #define strncasecmp strnicmp 
  292 #define strcasecmp  stricmp 
  293 #define _setmode    setmode 
  299 #if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(__clang__) 
  300 #ifdef  COB_LIB_EXPIMP 
  301     #define COB_EXPIMP  __declspec(dllexport) extern 
  303     #define COB_EXPIMP  __declspec(dllimport) extern 
  306     #define COB_EXPIMP  extern 
  309 #if defined(__370__) || defined(_MSC_VER) || defined(__DECC) || \ 
  310     defined(__BORLANDC__) || defined(__WATCOMC__) 
  311     #define COB_INLINE  __inline 
  312 #elif   defined(__INTEL_COMPILER) 
  314     #define COB_INLINE  inline 
  315 #elif   defined(__GNUC__) 
  317     #define COB_INLINE  __inline__ 
  318 #elif   defined(__STDC_VERSION__) && __STDC_VERSION__ > 199900L 
  320     #define COB_INLINE  inline 
  321 #elif   defined(COB_KEYWORD_INLINE) 
  322     #define COB_INLINE  COB_KEYWORD_INLINE 
  329 #if defined(__GNUC__) || (defined(__xlc__) && __IBMC__ >= 700) 
  330 #define COB_A_NORETURN  __attribute__((noreturn)) 
  331 #define COB_A_FORMAT12  __attribute__((format(printf, 1, 2))) 
  332 #define COB_A_FORMAT23  __attribute__((format(printf, 2, 3))) 
  333 #define COB_A_FORMAT34  __attribute__((format(printf, 3, 4))) 
  335 #define COB_A_NORETURN 
  336 #define COB_A_FORMAT12 
  337 #define COB_A_FORMAT23 
  338 #define COB_A_FORMAT34 
  342 #define DECLNORET   __declspec(noreturn) 
  347 #if defined(__GNUC__) 
  348 #define optim_memcpy(x,y,z) __builtin_memcpy (x, y, z) 
  350 #define optim_memcpy(x,y,z) memcpy (x, y, z) 
  353 #if defined(__GNUC__) && (__GNUC__ >= 3) 
  354 #define likely(x)   __builtin_expect((long int)!!(x), 1L) 
  355 #define unlikely(x) __builtin_expect((long int)!!(x), 0L) 
  356 #define COB_A_MALLOC    __attribute__((malloc)) 
  357 #define COB_HAVE_STEXPR 1 
  359 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) 
  360 #define COB_NOINLINE    __attribute__((noinline)) 
  361 #define COB_A_INLINE    __attribute__((always_inline)) 
  367 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 
  368 #define COB_A_COLD  __attribute__((cold)) 
  373 #elif   defined(__xlc__) && __IBMC__ >= 700 
  376 #define likely(x)   __builtin_expect((long int)!!(x), 1L) 
  377 #define unlikely(x) __builtin_expect((long int)!!(x), 0L) 
  379 #define likely(x)   (x) 
  380 #define unlikely(x) (x) 
  382 #define COB_NOINLINE    __attribute__((noinline)) 
  383 #define COB_A_INLINE    __attribute__((always_inline)) 
  387 #define COB_HAVE_STEXPR 1 
  389 #undef  COB_HAVE_STEXPR 
  392 #elif   defined(__SUNPRO_C) && __SUNPRO_C >= 0x590 
  394 #define likely(x)   (x) 
  395 #define unlikely(x) (x) 
  396 #define COB_A_MALLOC    __attribute__((malloc)) 
  397 #define COB_NOINLINE    __attribute__((noinline)) 
  398 #define COB_A_INLINE    __attribute__((always_inline)) 
  400 #define COB_HAVE_STEXPR 1 
  404 #define likely(x)   (x) 
  405 #define unlikely(x) (x) 
  410 #undef  COB_HAVE_STEXPR 
  415 #ifdef  __INTEL_COMPILER 
  418 #pragma warning ( disable : 111 ) 
  420 #pragma warning ( disable : 177 ) 
  422 #pragma warning ( disable : 181 ) 
  424 #pragma warning ( disable : 188 ) 
  426 #pragma warning ( disable : 193 ) 
  428 #pragma warning ( disable : 593 ) 
  430 #pragma warning ( disable : 869 ) 
  432 #pragma warning ( disable : 981 ) 
  435 #pragma warning ( disable : 1011 ) 
  437 #pragma warning ( disable : 1419 ) 
  439 #pragma warning ( disable : 1599 ) 
  440 #pragma warning ( disable : 1944 ) 
  442 #pragma warning ( disable : 2259 ) 
  446 #if !defined(__i386__) && !defined(__x86_64__) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__amd64__) 
  447     #define COB_NON_ALIGNED 
  450         #define COB_SHORT_BORK 
  452     #if defined(_MSC_VER) 
  453         #define COB_ALLOW_UNALIGNED 
  458     #define COB_ALLOW_UNALIGNED 
  464 #if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) 
  473 #define SLASH_INT   '/' 
  474 #define SLASH_STR   "/" 
  476 #define SLASH_INT   '\\' 
  477 #define SLASH_STR   "\\" 
  485 #define COB_EBCDIC_MACHINE 
  487 #undef  COB_EBCDIC_MACHINE 
  492 #define COB_UNUSED(z)   do { (void)(z); } while (0) 
  496 #define COB_MINI_BUFF       256 
  497 #define COB_SMALL_BUFF      1024 
  498 #define COB_NORMAL_BUFF     2048 
  499 #define COB_FILE_BUFF       4096 
  500 #define COB_MEDIUM_BUFF     8192 
  501 #define COB_LARGE_BUFF      16384 
  502 #define COB_MINI_MAX        (COB_MINI_BUFF - 1) 
  503 #define COB_SMALL_MAX       (COB_SMALL_BUFF - 1) 
  504 #define COB_NORMAL_MAX      (COB_NORMAL_BUFF - 1) 
  505 #define COB_FILE_MAX        (COB_FILE_BUFF - 1) 
  506 #define COB_MEDIUM_MAX      (COB_MEDIUM_BUFF - 1) 
  507 #define COB_LARGE_MAX       (COB_LARGE_BUFF - 1) 
  510 #define COB_STACK_SIZE      255 
  513 #define MAX_FD_RECORD       65535 
  516 #define COB_MAX_FIELD_PARAMS    36 
  519 #define COB_MAX_DIGITS      38 
  522 #define COB_MAX_BINARY      39 
  525 #define COB_MAX_FIELD_SIZE  268435456 
  528 #define COB_MAX_DEC_STRUCT  32 
  531 #define COB_MAX_WORDLEN     61 
  534 #define COB_SORT_MEMORY     128 * 1024 * 1024 
  535 #define COB_SORT_CHUNK      256 * 1024 
  538 #define COB_RET_TYPE_INT    0 
  539 #define COB_RET_TYPE_PTR    1 
  540 #define COB_RET_TYPE_VOID   2 
  543 #define COB_FOLD_UPPER      1 
  544 #define COB_FOLD_LOWER      2 
  547 #define COB_LC_COLLATE      0 
  548 #define COB_LC_CTYPE        1 
  549 #define COB_LC_MESSAGES     2 
  550 #define COB_LC_MONETARY     3 
  551 #define COB_LC_NUMERIC      4 
  552 #define COB_LC_TIME     5 
  554 #define COB_LC_USER     7 
  555 #define COB_LC_CLASS        8 
  559 #define COB_TYPE_UNKNOWN        0x00 
  560 #define COB_TYPE_GROUP          0x01U 
  561 #define COB_TYPE_BOOLEAN        0x02U 
  563 #define COB_TYPE_NUMERIC        0x10U 
  564 #define COB_TYPE_NUMERIC_DISPLAY    0x10U 
  565 #define COB_TYPE_NUMERIC_BINARY     0x11U 
  566 #define COB_TYPE_NUMERIC_PACKED     0x12U 
  567 #define COB_TYPE_NUMERIC_FLOAT      0x13U 
  568 #define COB_TYPE_NUMERIC_DOUBLE     0x14U 
  569 #define COB_TYPE_NUMERIC_L_DOUBLE   0x15U 
  570 #define COB_TYPE_NUMERIC_FP_DEC64   0x16U 
  571 #define COB_TYPE_NUMERIC_FP_DEC128  0x17U 
  572 #define COB_TYPE_NUMERIC_FP_BIN32   0x18U 
  573 #define COB_TYPE_NUMERIC_FP_BIN64   0x19U 
  574 #define COB_TYPE_NUMERIC_FP_BIN128  0x1AU 
  576 #define COB_TYPE_NUMERIC_EDITED     0x24U 
  578 #define COB_TYPE_ALPHANUMERIC       0x21U 
  579 #define COB_TYPE_ALPHANUMERIC_ALL   0x22U 
  580 #define COB_TYPE_ALPHANUMERIC_EDITED    0x23U 
  582 #define COB_TYPE_NATIONAL       0x40U 
  583 #define COB_TYPE_NATIONAL_EDITED    0x41U 
  587 #define COB_FLAG_HAVE_SIGN      (1U << 0)    
  588 #define COB_FLAG_SIGN_SEPARATE      (1U << 1)    
  589 #define COB_FLAG_SIGN_LEADING       (1U << 2)    
  590 #define COB_FLAG_BLANK_ZERO     (1U << 3)    
  591 #define COB_FLAG_JUSTIFIED      (1U << 4)    
  592 #define COB_FLAG_BINARY_SWAP        (1U << 5)    
  593 #define COB_FLAG_REAL_BINARY        (1U << 6)    
  594 #define COB_FLAG_IS_POINTER     (1U << 7)    
  595 #define COB_FLAG_NO_SIGN_NIBBLE     (1U << 8)    
  596 #define COB_FLAG_IS_FP          (1U << 9)    
  597 #define COB_FLAG_REAL_SIGN      (1U << 10)   
  598 #define COB_FLAG_BINARY_TRUNC       (1U << 11)   
  600 #define COB_FIELD_HAVE_SIGN(f)      ((f)->attr->flags & COB_FLAG_HAVE_SIGN) 
  601 #define COB_FIELD_SIGN_SEPARATE(f)  ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE) 
  602 #define COB_FIELD_SIGN_LEADING(f)   ((f)->attr->flags & COB_FLAG_SIGN_LEADING) 
  603 #define COB_FIELD_BLANK_ZERO(f)     ((f)->attr->flags & COB_FLAG_BLANK_ZERO) 
  604 #define COB_FIELD_JUSTIFIED(f)      ((f)->attr->flags & COB_FLAG_JUSTIFIED) 
  605 #define COB_FIELD_BINARY_SWAP(f)    ((f)->attr->flags & COB_FLAG_BINARY_SWAP) 
  606 #define COB_FIELD_REAL_BINARY(f)    ((f)->attr->flags & COB_FLAG_REAL_BINARY) 
  607 #define COB_FIELD_IS_POINTER(f)     ((f)->attr->flags & COB_FLAG_IS_POINTER) 
  608 #define COB_FIELD_NO_SIGN_NIBBLE(f) ((f)->attr->flags & COB_FLAG_NO_SIGN_NIBBLE) 
  609 #define COB_FIELD_IS_FP(f)      ((f)->attr->flags & COB_FLAG_IS_FP) 
  610 #define COB_FIELD_REAL_SIGN(f)      ((f)->attr->flags & COB_FLAG_REAL_SIGN) 
  611 #define COB_FIELD_BINARY_TRUNC(f)   ((f)->attr->flags & COB_FLAG_BINARY_TRUNC) 
  613 #define COB_FLAG_LEADSEP        \ 
  614     (COB_FLAG_SIGN_SEPARATE | COB_FLAG_SIGN_LEADING) 
  616 #define COB_FIELD_SIGN_LEADSEP(f)   \ 
  617     (((f)->attr->flags & COB_FLAG_LEADSEP) == COB_FLAG_LEADSEP) 
  619 #define COB_FIELD_TYPE(f)   ((f)->attr->type) 
  620 #define COB_FIELD_DIGITS(f) ((f)->attr->digits) 
  621 #define COB_FIELD_SCALE(f)  ((f)->attr->scale) 
  622 #define COB_FIELD_FLAGS(f)  ((f)->attr->flags) 
  623 #define COB_FIELD_PIC(f)    ((f)->attr->pic) 
  625 #define COB_FIELD_DATA(f)   \ 
  626     ((f)->data + (COB_FIELD_SIGN_LEADSEP (f) ? 1 : 0)) 
  628 #define COB_FIELD_SIZE(f)   \ 
  629     (COB_FIELD_SIGN_SEPARATE (f) ? f->size - 1 : f->size) 
  631 #define COB_FIELD_IS_NUMERIC(f) (COB_FIELD_TYPE (f) & COB_TYPE_NUMERIC) 
  632 #define COB_FIELD_IS_NUMDISP(f) (COB_FIELD_TYPE (f) == COB_TYPE_NUMERIC_DISPLAY) 
  633 #define COB_FIELD_IS_ALNUM(f)   (COB_FIELD_TYPE (f) == COB_TYPE_ALPHANUMERIC) 
  634 #define COB_FIELD_IS_NATIONAL(f)    (COB_FIELD_TYPE (f) & COB_TYPE_NATIONAL) 
  637 #define COB_DISPLAY_SIGN_ASCII  0 
  638 #define COB_DISPLAY_SIGN_EBCDIC 1 
  640 #define COB_NATIONAL_SIZE   2 
  642 #define COB_SET_FLD(v,x,y,z)    (v.size = x, v.data = y, v.attr = z, &v) 
  643 #define COB_SET_DATA(x,z)   (x.data = z, &x) 
  647 #define COB_FERROR_NONE     0 
  648 #define COB_FERROR_CANCEL   1 
  649 #define COB_FERROR_INITIALIZED  2 
  650 #define COB_FERROR_CODEGEN  3 
  651 #define COB_FERROR_CHAINING 4 
  652 #define COB_FERROR_STACK    5 
  653 #define COB_FERROR_GLOBAL   6 
  654 #define COB_FERROR_MEMORY   7 
  655 #define COB_FERROR_MODULE   8 
  656 #define COB_FERROR_RECURSIVE    9 
  657 #define COB_FERROR_SCR_INP  10 
  658 #define COB_FERROR_FILE     11 
  659 #define COB_FERROR_FUNCTION 12 
  660 #define COB_FERROR_FREE     13 
  665 #define COB_EXCEPTION(code,tag,name,critical)   tag, 
  679 #define COB_FILE_VERSION    1 
  692 #define COB_ASCENDING       0 
  693 #define COB_DESCENDING      1 
  695 #define COB_FILE_MODE       0644 
  699 #define COB_ORG_SEQUENTIAL  0 
  700 #define COB_ORG_LINE_SEQUENTIAL 1 
  701 #define COB_ORG_RELATIVE    2 
  702 #define COB_ORG_INDEXED     3 
  703 #define COB_ORG_SORT        4 
  704 #define COB_ORG_MAX     5 
  708 #define COB_ACCESS_SEQUENTIAL   1 
  709 #define COB_ACCESS_DYNAMIC  2 
  710 #define COB_ACCESS_RANDOM   3 
  714 #define COB_SELECT_FILE_STATUS  (1U << 0) 
  715 #define COB_SELECT_EXTERNAL (1U << 1) 
  716 #define COB_SELECT_LINAGE   (1U << 2) 
  717 #define COB_SELECT_SPLITKEY (1U << 3) 
  718 #define COB_SELECT_STDIN    (1U << 4) 
  719 #define COB_SELECT_STDOUT   (1U << 5) 
  720 #define COB_SELECT_TEMPORARY    (1U << 6) 
  722 #define COB_FILE_SPECIAL(x) \ 
  723     ((x)->flag_select_features & (COB_SELECT_STDIN | COB_SELECT_STDOUT)) 
  724 #define COB_FILE_STDIN(x)   ((x)->flag_select_features & COB_SELECT_STDIN) 
  725 #define COB_FILE_STDOUT(x)  ((x)->flag_select_features & COB_SELECT_STDOUT) 
  726 #define COB_FILE_TEMPORARY(x)   ((x)->flag_select_features & COB_SELECT_TEMPORARY) 
  730 #define COB_LOCK_EXCLUSIVE  (1U << 0) 
  731 #define COB_LOCK_MANUAL     (1U << 1) 
  732 #define COB_LOCK_AUTOMATIC  (1U << 2) 
  733 #define COB_LOCK_MULTIPLE   (1U << 3) 
  734 #define COB_LOCK_OPEN_EXCLUSIVE (1U << 4) 
  736 #define COB_FILE_EXCLUSIVE  (COB_LOCK_EXCLUSIVE | COB_LOCK_OPEN_EXCLUSIVE) 
  740 #define COB_OPEN_CLOSED     0 
  741 #define COB_OPEN_INPUT      1 
  742 #define COB_OPEN_OUTPUT     2 
  743 #define COB_OPEN_I_O        3 
  744 #define COB_OPEN_EXTEND     4 
  745 #define COB_OPEN_LOCKED     5 
  749 #define COB_CLOSE_NORMAL    0 
  750 #define COB_CLOSE_LOCK      1 
  751 #define COB_CLOSE_NO_REWIND 2 
  752 #define COB_CLOSE_UNIT      3 
  753 #define COB_CLOSE_UNIT_REMOVAL  4 
  757 #define COB_WRITE_MASK      0x0000FFFF 
  759 #define COB_WRITE_LINES     0x00010000 
  760 #define COB_WRITE_PAGE      0x00020000 
  761 #define COB_WRITE_CHANNEL   0x00040000 
  762 #define COB_WRITE_AFTER     0x00100000 
  763 #define COB_WRITE_BEFORE    0x00200000 
  764 #define COB_WRITE_EOP       0x00400000 
  765 #define COB_WRITE_LOCK      0x00800000 
  766 #define COB_WRITE_NO_LOCK   0x01000000 
  770 #define COB_READ_NEXT       (1 << 0) 
  771 #define COB_READ_PREVIOUS   (1 << 1) 
  772 #define COB_READ_FIRST      (1 << 2) 
  773 #define COB_READ_LAST       (1 << 3) 
  774 #define COB_READ_LOCK       (1 << 4) 
  775 #define COB_READ_NO_LOCK    (1 << 5) 
  776 #define COB_READ_KEPT_LOCK  (1 << 6) 
  777 #define COB_READ_WAIT_LOCK  (1 << 7) 
  778 #define COB_READ_IGNORE_LOCK    (1 << 8) 
  780 #define COB_READ_MASK       \ 
  781     (COB_READ_NEXT | COB_READ_PREVIOUS | COB_READ_FIRST | COB_READ_LAST) 
  785 #define COB_STATUS_00_SUCCESS           00 
  786 #define COB_STATUS_02_SUCCESS_DUPLICATE     02 
  787 #define COB_STATUS_04_SUCCESS_INCOMPLETE    04 
  788 #define COB_STATUS_05_SUCCESS_OPTIONAL      05 
  789 #define COB_STATUS_07_SUCCESS_NO_UNIT       07 
  790 #define COB_STATUS_10_END_OF_FILE       10 
  791 #define COB_STATUS_14_OUT_OF_KEY_RANGE      14 
  792 #define COB_STATUS_21_KEY_INVALID       21 
  793 #define COB_STATUS_22_KEY_EXISTS        22 
  794 #define COB_STATUS_23_KEY_NOT_EXISTS        23 
  795 #define COB_STATUS_24_KEY_BOUNDARY      24 
  796 #define COB_STATUS_30_PERMANENT_ERROR       30 
  797 #define COB_STATUS_31_INCONSISTENT_FILENAME 31 
  798 #define COB_STATUS_34_BOUNDARY_VIOLATION    34 
  799 #define COB_STATUS_35_NOT_EXISTS        35 
  800 #define COB_STATUS_37_PERMISSION_DENIED     37 
  801 #define COB_STATUS_38_CLOSED_WITH_LOCK      38 
  802 #define COB_STATUS_39_CONFLICT_ATTRIBUTE    39 
  803 #define COB_STATUS_41_ALREADY_OPEN      41 
  804 #define COB_STATUS_42_NOT_OPEN          42 
  805 #define COB_STATUS_43_READ_NOT_DONE     43 
  806 #define COB_STATUS_44_RECORD_OVERFLOW       44 
  807 #define COB_STATUS_46_READ_ERROR        46 
  808 #define COB_STATUS_47_INPUT_DENIED      47 
  809 #define COB_STATUS_48_OUTPUT_DENIED     48 
  810 #define COB_STATUS_49_I_O_DENIED        49 
  811 #define COB_STATUS_51_RECORD_LOCKED     51 
  812 #define COB_STATUS_57_I_O_LINAGE        57 
  813 #define COB_STATUS_61_FILE_SHARING      61 
  814 #define COB_STATUS_91_NOT_AVAILABLE     91 
  818 #define COB_NOT_CONFIGURED          32768 
  823 #define COB_STORE_ROUND         (1 << 0) 
  824 #define COB_STORE_KEEP_ON_OVERFLOW  (1 << 1) 
  825 #define COB_STORE_TRUNC_ON_OVERFLOW (1 << 2) 
  827 #define COB_STORE_AWAY_FROM_ZERO    (1 << 4) 
  828 #define COB_STORE_NEAR_AWAY_FROM_ZERO   (1 << 5) 
  829 #define COB_STORE_NEAR_EVEN     (1 << 6) 
  830 #define COB_STORE_NEAR_TOWARD_ZERO  (1 << 7) 
  831 #define COB_STORE_PROHIBITED        (1 << 8) 
  832 #define COB_STORE_TOWARD_GREATER    (1 << 9) 
  833 #define COB_STORE_TOWARD_LESSER     (1 << 10) 
  834 #define COB_STORE_TRUNCATION        (1 << 11) 
  836 #define COB_STORE_MASK                  \ 
  837     (COB_STORE_ROUND | COB_STORE_KEEP_ON_OVERFLOW | \ 
  838      COB_STORE_TRUNC_ON_OVERFLOW) 
  841 #define COB_SCREEN_BLACK        0 
  842 #define COB_SCREEN_BLUE         1 
  843 #define COB_SCREEN_GREEN        2 
  844 #define COB_SCREEN_CYAN         3 
  845 #define COB_SCREEN_RED          4 
  846 #define COB_SCREEN_MAGENTA      5 
  847 #define COB_SCREEN_YELLOW       6 
  848 #define COB_SCREEN_WHITE        7 
  850 #define COB_SCREEN_LINE_PLUS        (1 << 0) 
  851 #define COB_SCREEN_LINE_MINUS       (1 << 1) 
  852 #define COB_SCREEN_COLUMN_PLUS      (1 << 2) 
  853 #define COB_SCREEN_COLUMN_MINUS     (1 << 3) 
  854 #define COB_SCREEN_AUTO         (1 << 4) 
  855 #define COB_SCREEN_BELL         (1 << 5) 
  856 #define COB_SCREEN_BLANK_LINE       (1 << 6) 
  857 #define COB_SCREEN_BLANK_SCREEN     (1 << 7) 
  858 #define COB_SCREEN_BLINK        (1 << 8) 
  859 #define COB_SCREEN_ERASE_EOL        (1 << 9) 
  860 #define COB_SCREEN_ERASE_EOS        (1 << 10) 
  861 #define COB_SCREEN_FULL         (1 << 11) 
  862 #define COB_SCREEN_HIGHLIGHT        (1 << 12) 
  863 #define COB_SCREEN_LOWLIGHT     (1 << 13) 
  864 #define COB_SCREEN_REQUIRED     (1 << 14) 
  865 #define COB_SCREEN_REVERSE      (1 << 15) 
  866 #define COB_SCREEN_SECURE       (1 << 16) 
  867 #define COB_SCREEN_UNDERLINE        (1 << 17) 
  868 #define COB_SCREEN_OVERLINE     (1 << 18) 
  869 #define COB_SCREEN_PROMPT       (1 << 19) 
  870 #define COB_SCREEN_UPDATE       (1 << 20) 
  871 #define COB_SCREEN_INPUT        (1 << 21) 
  872 #define COB_SCREEN_SCROLL_DOWN      (1 << 22) 
  873 #define COB_SCREEN_INITIAL      (1 << 23) 
  874 #define COB_SCREEN_NO_ECHO      (1 << 24) 
  875 #define COB_SCREEN_LEFTLINE     (1 << 25) 
  876 #define COB_SCREEN_NO_DISP      (1 << 26) 
  877 #define COB_SCREEN_EMULATE_NL       (1 << 27) 
  878 #define COB_SCREEN_UPPER        (1 << 28) 
  879 #define COB_SCREEN_LOWER        (1 << 29) 
  881 #define COB_SCREEN_TYPE_GROUP       0 
  882 #define COB_SCREEN_TYPE_FIELD       1 
  883 #define COB_SCREEN_TYPE_VALUE       2 
  884 #define COB_SCREEN_TYPE_ATTRIBUTE   3 
  896     unsigned short  digits;     
 
  898     unsigned short  flags;      
 
  915     const unsigned char *data;      
 
  923     const cob_const_field   cf;
 
  954     unsigned char data[8];
 
  968     void        *(__stdcall *funcptr_std)();
 
  969     void        (__stdcall *funcnull_std)();
 
  971     int     (__stdcall *funcint_std)();
 
 1044     unsigned char       **
data;
 
 1058     unsigned int    offset; 
 
 1065     const char      *select_name;       
 
 1066     unsigned char       *file_status;       
 
 1073     const unsigned char *sort_collating;    
 
 1080     unsigned char       organization;       
 
 1081     unsigned char       access_mode;        
 
 1082     unsigned char       lock_mode;      
 
 1083     unsigned char       open_mode;      
 
 1084     unsigned char       flag_optional;      
 
 1085     unsigned char       last_open_mode;     
 
 1086     unsigned char       flag_operation;     
 
 1087     unsigned char       flag_nonexistent;   
 
 1089     unsigned char       flag_end_of_file;   
 
 1090     unsigned char       flag_begin_of_file; 
 
 1091     unsigned char       flag_first_read;    
 
 1092     unsigned char       flag_read_done;     
 
 1093     unsigned char       flag_select_features;   
 
 1094     unsigned char       flag_needs_nl;      
 
 1095     unsigned char       flag_needs_top;     
 
 1096     unsigned char       file_version;       
 
 1119     const char      *report_name;       
 
 1126     int         def_first_detail;   
 
 1127     int         def_last_control;   
 
 1128     int         def_last_detail;    
 
 1186     int (*
open)     (
cob_file *, 
char *, 
const int, 
const int);
 
 1267                          cob_field *, cob_field *);
 
 1279 #define cobgetenv(x)            cob_getenv (x) 
 1280 #define cobputenv(x)            cob_putenv (x) 
 1281 #define cobtidy()           cob_tidy () 
 1282 #define cobinit()           cob_extern_init () 
 1283 #define cobexit(x)          cob_stop_run (x) 
 1284 #define cobcommandline(v,w,x,y,z)   cob_command_line (v,w,x,y,z) 
 1328                      const char *, 
const char *,
 
 1363                      const unsigned int);
 
 1373                      const int, 
const char *);
 
 1375                      const int, 
const char *);
 
 1377                      const int, 
const char *);
 
 1437                      cob_field *, 
const int);
 
 1474                          const struct cob_call_struct *);
 
 1482 #define cobsetjmp(x)    setjmp (cob_savenv (x)) 
 1483 #define coblongjmp(x)   cob_longjmp (x) 
 1484 #define cobsavenv(x)    cob_savenv (x) 
 1485 #define cobsavenv2(x,z) cob_savenv2 (x, z) 
 1486 #define cobfunc(x,y,z)  cob_func (x, y, z) 
 1487 #define cobcall(x,y,z)  cob_call (x, y, z) 
 1488 #define cobcancel(x)    cob_cancel (x) 
 1497                      cob_field *, cob_field *);
 
 1499                      cob_field *, cob_field *, cob_field *,
 
 1502                      cob_field *, cob_field *, cob_field *,
 
 1503                      cob_field *, cob_field *, 
const int);
 
 1526                  cob_field *, cob_field *);
 
 1528                  cob_field *, 
const unsigned int);
 
 1537                      unsigned char *, 
unsigned char *,
 
 1540                      unsigned char *, 
unsigned char *,
 
 1543                      unsigned char *, 
unsigned char *,
 
 1546                      unsigned char *, 
unsigned char *,
 
 1567                      const unsigned char *,
 
 1568                      void *, cob_field *);
 
 1570                      const int, 
const unsigned int);
 
 1652                              cob_field *, 
const int);
 
 1685                              cob_field *, cob_field *);
 
 1687                              cob_field *, cob_field *);
 
 1691                              cob_field *, cob_field *);
 
 1705                              cob_field *, cob_field *);