OpenCOBOL 1.1pre-rel
Classes | Defines | Typedefs | Enumerations | Functions | Variables
common.h File Reference
#include <libcob/exception.def>
Include dependency graph for common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  cob_external
struct  cob_field_attr
struct  cob_field
struct  cob_module

Defines

#define DLL_EXPIMP
#define COB_INLINE
#define likely(x)   (x)
#define unlikely(x)   (x)
#define COB_NOINLINE
#define COB_MINI_BUFF   256
#define COB_SMALL_BUFF   1024
#define COB_NORMAL_BUFF   2048
#define COB_MEDIUM_BUFF   8192
#define COB_LARGE_BUFF   16384
#define COB_MINI_MAX   (COB_MINI_BUFF - 1)
#define COB_SMALL_MAX   (COB_SMALL_BUFF - 1)
#define COB_NORMAL_MAX   (COB_NORMAL_BUFF - 1)
#define COB_MEDIUM_MAX   (COB_MEDIUM_BUFF - 1)
#define COB_LARGE_MAX   (COB_LARGE_BUFF - 1)
#define COB_STACK_SIZE   255
#define COB_MAX_FIELD_PARAMS   64
#define COB_TYPE_UNKNOWN   0x00
#define COB_TYPE_GROUP   0x01
#define COB_TYPE_BOOLEAN   0x02
#define COB_TYPE_NUMERIC   0x10
#define COB_TYPE_NUMERIC_DISPLAY   0x10
#define COB_TYPE_NUMERIC_BINARY   0x11
#define COB_TYPE_NUMERIC_PACKED   0x12
#define COB_TYPE_NUMERIC_FLOAT   0x13
#define COB_TYPE_NUMERIC_DOUBLE   0x14
#define COB_TYPE_NUMERIC_EDITED   0x24
#define COB_TYPE_ALPHANUMERIC   0x21
#define COB_TYPE_ALPHANUMERIC_ALL   0x22
#define COB_TYPE_ALPHANUMERIC_EDITED   0x23
#define COB_TYPE_NATIONAL   0x40
#define COB_TYPE_NATIONAL_EDITED   0x41
#define COB_FLAG_HAVE_SIGN   0x01
#define COB_FLAG_SIGN_SEPARATE   0x02
#define COB_FLAG_SIGN_LEADING   0x04
#define COB_FLAG_BLANK_ZERO   0x08
#define COB_FLAG_JUSTIFIED   0x10
#define COB_FLAG_BINARY_SWAP   0x20
#define COB_FLAG_REAL_BINARY   0x40
#define COB_FLAG_IS_POINTER   0x80
#define COB_FIELD_HAVE_SIGN(f)   ((f)->attr->flags & COB_FLAG_HAVE_SIGN)
#define COB_FIELD_SIGN_SEPARATE(f)   ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE)
#define COB_FIELD_SIGN_LEADING(f)   ((f)->attr->flags & COB_FLAG_SIGN_LEADING)
#define COB_FIELD_BLANK_ZERO(f)   ((f)->attr->flags & COB_FLAG_BLANK_ZERO)
#define COB_FIELD_JUSTIFIED(f)   ((f)->attr->flags & COB_FLAG_JUSTIFIED)
#define COB_FIELD_BINARY_SWAP(f)   ((f)->attr->flags & COB_FLAG_BINARY_SWAP)
#define COB_FIELD_REAL_BINARY(f)   ((f)->attr->flags & COB_FLAG_REAL_BINARY)
#define COB_FIELD_IS_POINTER(f)   ((f)->attr->flags & COB_FLAG_IS_POINTER)
#define cob_get_sign(f)   (COB_FIELD_HAVE_SIGN (f) ? cob_real_get_sign (f) : 0)
#define cob_put_sign(f, s)   if (COB_FIELD_HAVE_SIGN (f)) cob_real_put_sign (f, s)
#define COB_FIELD_TYPE(f)   ((f)->attr->type)
#define COB_FIELD_DIGITS(f)   ((f)->attr->digits)
#define COB_FIELD_SCALE(f)   ((f)->attr->scale)
#define COB_FIELD_FLAGS(f)   ((f)->attr->flags)
#define COB_FIELD_PIC(f)   ((f)->attr->pic)
#define COB_FIELD_DATA(f)
#define COB_FIELD_SIZE(f)   ((f)->size - (COB_FIELD_SIGN_SEPARATE (f) ? 1 : 0))
#define COB_FIELD_IS_NUMERIC(f)   (COB_FIELD_TYPE (f) & COB_TYPE_NUMERIC)
#define GET_SIGN_ASCII(x)   x -= 0x40
#define PUT_SIGN_ASCII(x)   x += 0x40
#define COB_DISPLAY_SIGN_ASCII   0
#define COB_DISPLAY_SIGN_EBCDIC   1
#define COB_EXCEPTION(code, tag, name, critical)   tag,
#define COB_FERROR_INITIALIZED   0
#define COB_FERROR_CODEGEN   1
#define COB_FERROR_CHAINING   2
#define COB_FERROR_STACK   3
#define cob_d2i(x)   ((x) - '0')
#define cob_i2d(x)   ((x) + '0')

Typedefs

typedef unsigned char * ucharptr

Enumerations

enum  cob_exception_id { COB_EC_ZERO, COB_EC_MAX }

Functions

void cob_init (int, char **)
void cob_module_enter (struct cob_module *)
void cob_module_leave (struct cob_module *)
void cobexit (int)
void cob_stop_run (const int)
void cob_fatal_error (const unsigned int)
void cob_runtime_error (const char *,...)
void * cob_malloc (const size_t)
const char * cob_get_exception_name (const int)
void cob_set_exception (const int)
void cob_check_version (const char *, const char *, const int)
void cob_accept_date (cob_field *)
void cob_accept_date_yyyymmdd (cob_field *)
void cob_accept_day (cob_field *)
void cob_accept_day_yyyyddd (cob_field *)
void cob_accept_day_of_week (cob_field *)
void cob_accept_time (cob_field *)
void cob_display_command_line (cob_field *)
void cob_accept_command_line (cob_field *)
void cob_set_environment (cob_field *, cob_field *)
void cob_display_environment (cob_field *)
void cob_get_environment (cob_field *, cob_field *)
void cob_accept_environment (cob_field *)
void cob_display_env_value (cob_field *)
void cob_display_arg_number (cob_field *)
void cob_accept_arg_number (cob_field *)
void cob_accept_arg_value (cob_field *)
void cob_chain_setup (void *, const size_t, const size_t)
void cob_allocate (unsigned char **, cob_field *, cob_field *)
void cob_free_alloc (unsigned char **, unsigned char *)
int cobinit (void)
int cobtidy (void)
void * cobcommandline (int, int *, char ***, char ***, char **)
char * cobgetenv (const char *)
int cobputenv (char *)
int CBL_ERROR_PROC (unsigned char *, unsigned char *)
int CBL_EXIT_PROC (unsigned char *, unsigned char *)
int SYSTEM (const unsigned char *)
int CBL_AND (unsigned char *, unsigned char *, const int)
int CBL_OR (unsigned char *, unsigned char *, const int)
int CBL_NOR (unsigned char *, unsigned char *, const int)
int CBL_XOR (unsigned char *, unsigned char *, const int)
int CBL_IMP (unsigned char *, unsigned char *, const int)
int CBL_NIMP (unsigned char *, unsigned char *, const int)
int CBL_EQ (unsigned char *, unsigned char *, const int)
int CBL_NOT (unsigned char *, const int)
int CBL_XF4 (unsigned char *, unsigned char *)
int CBL_XF5 (unsigned char *, unsigned char *)
int CBL_X91 (unsigned char *, const unsigned char *, unsigned char *)
int CBL_TOUPPER (unsigned char *, const int)
int CBL_TOLOWER (unsigned char *, const int)
int CBL_OC_NANOSLEEP (unsigned char *)
int cob_return_args (unsigned char *)
int cob_parameter_size (unsigned char *)
int cob_acuw_sleep (unsigned char *)
int cob_acuw_justify (unsigned char *,...)
unsigned char * cob_external_addr (const char *, const int)
unsigned char * cob_get_pointer (const unsigned char *)
void * cob_get_prog_pointer (const unsigned char *)
void cob_set_location (const char *, const char *, const unsigned int, const char *, const char *, const char *)
void cob_ready_trace (void)
void cob_reset_trace (void)
int cob_get_switch (const int)
void cob_set_switch (const int, const int)
int cob_cmp (cob_field *, cob_field *)
int cob_is_omitted (const cob_field *)
int cob_is_numeric (cob_field *)
int cob_is_alpha (const cob_field *)
int cob_is_upper (const cob_field *)
int cob_is_lower (const cob_field *)
void cob_table_sort_init (const int, const unsigned char *)
void cob_table_sort_init_key (const int, cob_field *, size_t)
void cob_table_sort (cob_field *, const int)
void cob_check_numeric (cob_field *, const char *)
void cob_check_based (const unsigned char *, const char *)
void cob_check_odo (const int, const int, const int, const char *)
void cob_check_subscript (const int, const int, const int, const char *)
void cob_check_ref_mod (const int, const int, const int, const char *)
int cob_numeric_cmp (cob_field *, cob_field *)

Variables

DLL_EXPIMP int cob_initialized
DLL_EXPIMP int cob_exception_code
DLL_EXPIMP struct cob_modulecob_current_module
DLL_EXPIMP int cob_call_params
DLL_EXPIMP int cob_save_call_params
DLL_EXPIMP int cob_initial_external
DLL_EXPIMP cob_field cob_zero
DLL_EXPIMP cob_field cob_space
DLL_EXPIMP cob_field cob_high
DLL_EXPIMP cob_field cob_low
DLL_EXPIMP cob_field cob_quote
DLL_EXPIMP cob_field cob_one

Define Documentation

#define cob_d2i (   x)    ((x) - '0')

Definition at line 263 of file common.h.

#define COB_DISPLAY_SIGN_ASCII   0

Definition at line 194 of file common.h.

#define COB_DISPLAY_SIGN_EBCDIC   1

Definition at line 195 of file common.h.

#define COB_EXCEPTION (   code,
  tag,
  name,
  critical 
)    tag,

Definition at line 223 of file common.h.

#define COB_FERROR_CHAINING   2

Definition at line 239 of file common.h.

#define COB_FERROR_CODEGEN   1

Definition at line 238 of file common.h.

#define COB_FERROR_INITIALIZED   0

Definition at line 237 of file common.h.

#define COB_FERROR_STACK   3

Definition at line 240 of file common.h.

#define COB_FIELD_BINARY_SWAP (   f)    ((f)->attr->flags & COB_FLAG_BINARY_SWAP)

Definition at line 146 of file common.h.

#define COB_FIELD_BLANK_ZERO (   f)    ((f)->attr->flags & COB_FLAG_BLANK_ZERO)

Definition at line 144 of file common.h.

#define COB_FIELD_DATA (   f)
Value:
((f)->data +                                                              \
   ((COB_FIELD_SIGN_SEPARATE (f) && COB_FIELD_SIGN_LEADING (f)) ? 1 : 0))

Definition at line 176 of file common.h.

#define COB_FIELD_DIGITS (   f)    ((f)->attr->digits)

Definition at line 172 of file common.h.

#define COB_FIELD_FLAGS (   f)    ((f)->attr->flags)

Definition at line 174 of file common.h.

#define COB_FIELD_HAVE_SIGN (   f)    ((f)->attr->flags & COB_FLAG_HAVE_SIGN)

Definition at line 141 of file common.h.

#define COB_FIELD_IS_NUMERIC (   f)    (COB_FIELD_TYPE (f) & COB_TYPE_NUMERIC)

Definition at line 182 of file common.h.

#define COB_FIELD_IS_POINTER (   f)    ((f)->attr->flags & COB_FLAG_IS_POINTER)

Definition at line 148 of file common.h.

#define COB_FIELD_JUSTIFIED (   f)    ((f)->attr->flags & COB_FLAG_JUSTIFIED)

Definition at line 145 of file common.h.

#define COB_FIELD_PIC (   f)    ((f)->attr->pic)

Definition at line 175 of file common.h.

#define COB_FIELD_REAL_BINARY (   f)    ((f)->attr->flags & COB_FLAG_REAL_BINARY)

Definition at line 147 of file common.h.

#define COB_FIELD_SCALE (   f)    ((f)->attr->scale)

Definition at line 173 of file common.h.

#define COB_FIELD_SIGN_LEADING (   f)    ((f)->attr->flags & COB_FLAG_SIGN_LEADING)

Definition at line 143 of file common.h.

#define COB_FIELD_SIGN_SEPARATE (   f)    ((f)->attr->flags & COB_FLAG_SIGN_SEPARATE)

Definition at line 142 of file common.h.

#define COB_FIELD_SIZE (   f)    ((f)->size - (COB_FIELD_SIGN_SEPARATE (f) ? 1 : 0))

Definition at line 179 of file common.h.

#define COB_FIELD_TYPE (   f)    ((f)->attr->type)

Definition at line 171 of file common.h.

#define COB_FLAG_BINARY_SWAP   0x20

Definition at line 137 of file common.h.

#define COB_FLAG_BLANK_ZERO   0x08

Definition at line 135 of file common.h.

#define COB_FLAG_HAVE_SIGN   0x01

Definition at line 132 of file common.h.

#define COB_FLAG_IS_POINTER   0x80

Definition at line 139 of file common.h.

#define COB_FLAG_JUSTIFIED   0x10

Definition at line 136 of file common.h.

#define COB_FLAG_REAL_BINARY   0x40

Definition at line 138 of file common.h.

#define COB_FLAG_SIGN_LEADING   0x04

Definition at line 134 of file common.h.

#define COB_FLAG_SIGN_SEPARATE   0x02

Definition at line 133 of file common.h.

#define cob_get_sign (   f)    (COB_FIELD_HAVE_SIGN (f) ? cob_real_get_sign (f) : 0)

Definition at line 150 of file common.h.

#define cob_i2d (   x)    ((x) + '0')

Definition at line 266 of file common.h.

#define COB_INLINE

Definition at line 54 of file common.h.

#define COB_LARGE_BUFF   16384

Definition at line 83 of file common.h.

#define COB_LARGE_MAX   (COB_LARGE_BUFF - 1)

Definition at line 88 of file common.h.

#define COB_MAX_FIELD_PARAMS   64

Definition at line 92 of file common.h.

#define COB_MEDIUM_BUFF   8192

Definition at line 82 of file common.h.

#define COB_MEDIUM_MAX   (COB_MEDIUM_BUFF - 1)

Definition at line 87 of file common.h.

#define COB_MINI_BUFF   256

Definition at line 79 of file common.h.

#define COB_MINI_MAX   (COB_MINI_BUFF - 1)

Definition at line 84 of file common.h.

#define COB_NOINLINE

Definition at line 70 of file common.h.

#define COB_NORMAL_BUFF   2048

Definition at line 81 of file common.h.

#define COB_NORMAL_MAX   (COB_NORMAL_BUFF - 1)

Definition at line 86 of file common.h.

#define cob_put_sign (   f,
 
)    if (COB_FIELD_HAVE_SIGN (f)) cob_real_put_sign (f, s)

Definition at line 151 of file common.h.

#define COB_SMALL_BUFF   1024

Definition at line 80 of file common.h.

#define COB_SMALL_MAX   (COB_SMALL_BUFF - 1)

Definition at line 85 of file common.h.

#define COB_STACK_SIZE   255

Definition at line 90 of file common.h.

#define COB_TYPE_ALPHANUMERIC   0x21

Definition at line 123 of file common.h.

#define COB_TYPE_ALPHANUMERIC_ALL   0x22

Definition at line 124 of file common.h.

#define COB_TYPE_ALPHANUMERIC_EDITED   0x23

Definition at line 125 of file common.h.

#define COB_TYPE_BOOLEAN   0x02

Definition at line 113 of file common.h.

#define COB_TYPE_GROUP   0x01

Definition at line 112 of file common.h.

#define COB_TYPE_NATIONAL   0x40

Definition at line 127 of file common.h.

#define COB_TYPE_NATIONAL_EDITED   0x41

Definition at line 128 of file common.h.

#define COB_TYPE_NUMERIC   0x10

Definition at line 115 of file common.h.

#define COB_TYPE_NUMERIC_BINARY   0x11

Definition at line 117 of file common.h.

#define COB_TYPE_NUMERIC_DISPLAY   0x10

Definition at line 116 of file common.h.

#define COB_TYPE_NUMERIC_DOUBLE   0x14

Definition at line 120 of file common.h.

#define COB_TYPE_NUMERIC_EDITED   0x24

Definition at line 121 of file common.h.

#define COB_TYPE_NUMERIC_FLOAT   0x13

Definition at line 119 of file common.h.

#define COB_TYPE_NUMERIC_PACKED   0x12

Definition at line 118 of file common.h.

#define COB_TYPE_UNKNOWN   0x00

Definition at line 111 of file common.h.

#define DLL_EXPIMP

Definition at line 46 of file common.h.

#define GET_SIGN_ASCII (   x)    x -= 0x40

Definition at line 191 of file common.h.

#define likely (   x)    (x)

Definition at line 68 of file common.h.

#define PUT_SIGN_ASCII (   x)    x += 0x40

Definition at line 192 of file common.h.

#define unlikely (   x)    (x)

Definition at line 69 of file common.h.


Typedef Documentation

typedef unsigned char* ucharptr

Definition at line 77 of file common.h.


Enumeration Type Documentation

Enumerator:
COB_EC_ZERO 
COB_EC_MAX 

Definition at line 225 of file common.h.

                      {
        COB_EC_ZERO,
#include <libcob/exception.def>
        COB_EC_MAX
};

Function Documentation

int CBL_AND ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_EQ ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_ERROR_PROC ( unsigned char *  ,
unsigned char *   
)
int CBL_EXIT_PROC ( unsigned char *  ,
unsigned char *   
)
int CBL_IMP ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_NIMP ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_NOR ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_NOT ( unsigned char *  ,
const int   
)
int CBL_OC_NANOSLEEP ( unsigned char *  )
int CBL_OR ( unsigned char *  ,
unsigned char *  ,
const int   
)
int CBL_TOLOWER ( unsigned char *  ,
const int   
)
int CBL_TOUPPER ( unsigned char *  ,
const int   
)
int CBL_X91 ( unsigned char *  ,
const unsigned char *  ,
unsigned char *   
)
int CBL_XF4 ( unsigned char *  ,
unsigned char *   
)
int CBL_XF5 ( unsigned char *  ,
unsigned char *   
)
int CBL_XOR ( unsigned char *  ,
unsigned char *  ,
const int   
)
void cob_accept_arg_number ( cob_field )
void cob_accept_arg_value ( cob_field )
void cob_accept_command_line ( cob_field )
void cob_accept_date ( cob_field )
void cob_accept_date_yyyymmdd ( cob_field )
void cob_accept_day ( cob_field )
void cob_accept_day_of_week ( cob_field )
void cob_accept_day_yyyyddd ( cob_field )
void cob_accept_environment ( cob_field )
void cob_accept_time ( cob_field )
int cob_acuw_justify ( unsigned char *  ,
  ... 
)
int cob_acuw_sleep ( unsigned char *  )
void cob_allocate ( unsigned char **  ,
cob_field ,
cob_field  
)
void cob_chain_setup ( void *  ,
const size_t  ,
const size_t   
)
void cob_check_based ( const unsigned char *  ,
const char *   
)
void cob_check_numeric ( cob_field ,
const char *   
)
void cob_check_odo ( const int  ,
const int  ,
const int  ,
const char *   
)
void cob_check_ref_mod ( const int  ,
const int  ,
const int  ,
const char *   
)
void cob_check_subscript ( const int  ,
const int  ,
const int  ,
const char *   
)
void cob_check_version ( const char *  ,
const char *  ,
const int   
)
int cob_cmp ( cob_field ,
cob_field  
)

Here is the caller graph for this function:

void cob_display_arg_number ( cob_field )
void cob_display_command_line ( cob_field )
void cob_display_env_value ( cob_field )
void cob_display_environment ( cob_field )
unsigned char* cob_external_addr ( const char *  ,
const int   
)
void cob_fatal_error ( const unsigned  int)
void cob_free_alloc ( unsigned char **  ,
unsigned char *   
)
void cob_get_environment ( cob_field ,
cob_field  
)
const char* cob_get_exception_name ( const int  )

Here is the caller graph for this function:

unsigned char* cob_get_pointer ( const unsigned char *  )
void* cob_get_prog_pointer ( const unsigned char *  )
int cob_get_switch ( const int  )
void cob_init ( int  ,
char **   
)

Here is the caller graph for this function:

int cob_is_alpha ( const cob_field )
int cob_is_lower ( const cob_field )
int cob_is_numeric ( cob_field )
int cob_is_omitted ( const cob_field )
int cob_is_upper ( const cob_field )
void* cob_malloc ( const size_t  )

Here is the caller graph for this function:

void cob_module_enter ( struct cob_module )
void cob_module_leave ( struct cob_module )
int cob_numeric_cmp ( cob_field ,
cob_field  
)

Definition at line 1324 of file numeric.c.

{
        cob_decimal_set_field (&cob_d1, f1);
        cob_decimal_set_field (&cob_d2, f2);
        return cob_decimal_cmp (&cob_d1, &cob_d2);
}

Here is the call graph for this function:

int cob_parameter_size ( unsigned char *  )
void cob_ready_trace ( void  )
void cob_reset_trace ( void  )
int cob_return_args ( unsigned char *  )
void cob_runtime_error ( const char *  ,
  ... 
)

Here is the caller graph for this function:

void cob_set_environment ( cob_field ,
cob_field  
)
void cob_set_exception ( const int  )

Here is the caller graph for this function:

void cob_set_location ( const char *  ,
const char *  ,
const unsigned  int,
const char *  ,
const char *  ,
const char *   
)
void cob_set_switch ( const int  ,
const int   
)
void cob_stop_run ( const int  )

Here is the caller graph for this function:

void cob_table_sort ( cob_field ,
const int   
)
void cob_table_sort_init ( const int  ,
const unsigned char *   
)
void cob_table_sort_init_key ( const int  ,
cob_field ,
size_t   
)
void* cobcommandline ( int  ,
int *  ,
char ***  ,
char ***  ,
char **   
)
void cobexit ( int  )
char* cobgetenv ( const char *  )
int cobinit ( void  )
int cobputenv ( char *  )
int cobtidy ( void  )
int SYSTEM ( const unsigned char *  )

Variable Documentation

DLL_EXPIMP int cob_call_params

Definition at line 163 of file common.c.

DLL_EXPIMP struct cob_module* cob_current_module

Definition at line 158 of file common.c.

DLL_EXPIMP int cob_exception_code

Definition at line 161 of file common.c.

DLL_EXPIMP cob_field cob_high

Definition at line 176 of file common.c.

DLL_EXPIMP int cob_initial_external

Definition at line 165 of file common.c.

DLL_EXPIMP int cob_initialized

Definition at line 160 of file common.c.

DLL_EXPIMP cob_field cob_low

Definition at line 177 of file common.c.

DLL_EXPIMP cob_field cob_one

Definition at line 179 of file common.c.

DLL_EXPIMP cob_field cob_quote

Definition at line 178 of file common.c.

DLL_EXPIMP int cob_save_call_params

Definition at line 164 of file common.c.

DLL_EXPIMP cob_field cob_space

Definition at line 175 of file common.c.

DLL_EXPIMP cob_field cob_zero

Definition at line 174 of file common.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines