GnuCOBOL
2.0
A free COBOL compiler
|
#include "config.h"
#include "defaults.h"
#include "tarstamp.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <errno.h>
#include <math.h>
#include <time.h>
#include "lib/gettext.h"
#include "libcob.h"
#include "coblocal.h"
#include "libcob/cobgetopt.h"
#include "exception.def"
Go to the source code of this file.
Data Structures | |
struct | cob_alloc_cache |
struct | cob_external |
struct | exit_handlerlist |
struct | handlerlist |
Macros | |
#define | COB_LIB_EXPIMP |
#define | CB_IMSG_SIZE 24 |
#define | CB_IVAL_SIZE (80 - CB_IMSG_SIZE - 4) |
#define | CB_STRINGIFY(s) #s |
#define | CB_XSTRINGIFY(s) CB_STRINGIFY(s) |
#define | OC_C_VERSION_PRF "" |
#define | OC_C_VERSION "unknown" |
#define | COB_ERRBUF_SIZE 1024 |
#define | COB_EXCEPTION(code, tag, name, critical) name, |
#define | COB_EXCEPTION(code, tag, name, critical) 0x##code, |
#define | EXCEPTION_TAB_SIZE sizeof(cob_exception_tab_code) / sizeof(int) |
#define | COB_SWITCH_MAX 36 /* (must match cobc/tree.h)*/ |
#define | NUM_CONFIG (sizeof(gc_conf)/sizeof(struct config_tbl)-1) |
#define | FUNC_NAME_IN_DEFAULT NUM_CONFIG + 1 |
Functions | |
static int | set_config_val (char *value, int pos) |
static char * | get_config_val (char *value, int pos, char *orgvalue) |
void | conf_runtime_error_value (char *value, const int conf_pos) |
void | conf_runtime_error (const int finish_error, const char *fmt,...) |
static void | cob_exit_common (void) |
static void | cob_terminate_routines (void) |
static void | cob_set_signal (void) |
static int | cob_get_sign_ascii (unsigned char *p) |
static void | cob_put_sign_ascii (unsigned char *p) |
static int | cob_get_sign_ebcdic (unsigned char *p) |
static void | cob_put_sign_ebcdic (unsigned char *p, const int sign) |
static int | common_cmpc (const unsigned char *s1, const unsigned int c, const size_t size, const unsigned char *col) |
static int | common_cmps (const unsigned char *s1, const unsigned char *s2, const size_t size, const unsigned char *col) |
static int | cob_cmp_all (cob_field *f1, cob_field *f2) |
static int | cob_cmp_alnum (cob_field *f1, cob_field *f2) |
static int | sort_compare (const void *data1, const void *data2) |
static void | cob_memcpy (cob_field *dst, const void *src, const size_t size) |
static void | cob_check_trace_file (void) |
int | cob_check_env_true (char *s) |
int | cob_check_env_false (char *s) |
static void | cob_rescan_env_vals (void) |
static int | one_indexed_day_of_week_from_monday (int zero_indexed_from_sunday) |
static void | set_unknown_offset (struct cob_time *time) |
int | cob_get_exception_code (void) |
const char * | cob_get_exception_name (void) |
void | cob_set_exception (const int id) |
void | cob_accept_exception_status (cob_field *f) |
void | cob_accept_user_name (cob_field *f) |
void * | cob_malloc (const size_t size) |
void * | cob_realloc (void *optr, const size_t osize, const size_t nsize) |
void | cob_free (void *mptr) |
void * | cob_fast_malloc (const size_t size) |
char * | cob_strdup (const char *p) |
void * | cob_cache_malloc (const size_t size) |
void * | cob_cache_realloc (void *ptr, const size_t size) |
void | cob_cache_free (void *ptr) |
void | cob_set_location (const char *sfile, const unsigned int sline, const char *csect, const char *cpara, const char *cstatement) |
void | cob_trace_section (const char *para, const char *source, const int line) |
void | cob_ready_trace (void) |
void | cob_reset_trace (void) |
unsigned char * | cob_get_pointer (const void *srcptr) |
void * | cob_get_prog_pointer (const void *srcptr) |
void | cob_field_to_string (const cob_field *f, void *str, const size_t maxsize) |
void | cob_stop_run (const int status) |
void | cob_runtime_error (const char *fmt,...) |
void | cob_fatal_error (const int fatal_error) |
cob_global * | cob_get_global_ptr (void) |
void | cob_module_enter (cob_module **module, cob_global **mglobal, const int auto_init) |
void | cob_module_leave (cob_module *module) |
void * | cob_save_func (cob_field **savefld, const int params, const int eparams,...) |
void | cob_restore_func (struct cob_func_loc *fl) |
void | cob_check_version (const char *prog, const char *packver, const int patchlev) |
void | cob_parameter_check (const char *funcname, const int numparms) |
void | cob_correct_numeric (cob_field *f) |
static int | cob_check_numdisp (const cob_field *f) |
int | cob_real_get_sign (cob_field *f) |
void | cob_real_put_sign (cob_field *f, const int sign) |
void | cob_reg_sighnd (void(*sighnd)(int)) |
int | cob_get_switch (const int n) |
void | cob_set_switch (const int n, const int flag) |
int | cob_cmp (cob_field *f1, cob_field *f2) |
int | cob_is_omitted (const cob_field *f) |
int | cob_is_numeric (const cob_field *f) |
int | cob_is_alpha (const cob_field *f) |
int | cob_is_upper (const cob_field *f) |
int | cob_is_lower (const cob_field *f) |
void | cob_table_sort_init (const size_t nkeys, const unsigned char *collating_sequence) |
void | cob_table_sort_init_key (cob_field *field, const int flag, const unsigned int offset) |
void | cob_table_sort (cob_field *f, const int n) |
void | cob_check_based (const unsigned char *x, const char *name) |
void | cob_check_linkage (const unsigned char *x, const char *name, const int check_type) |
void | cob_check_numeric (const cob_field *f, const char *name) |
void | cob_check_odo (const int i, const int min, const int max, const char *name) |
void | cob_check_subscript (const int i, const int min, const int max, const char *name) |
void | cob_check_ref_mod (const int offset, const int length, const int size, const char *name) |
void * | cob_external_addr (const char *exname, const int exlength) |
int | cob_ctoi (const char digit) |
struct cob_time | cob_get_current_date_and_time (void) |
void | cob_accept_date (cob_field *f) |
void | cob_accept_date_yyyymmdd (cob_field *f) |
void | cob_accept_day (cob_field *f) |
void | cob_accept_day_yyyyddd (cob_field *f) |
void | cob_accept_day_of_week (cob_field *f) |
void | cob_accept_time (cob_field *field) |
void | cob_display_command_line (cob_field *f) |
void | cob_accept_command_line (cob_field *f) |
void | cob_display_arg_number (cob_field *f) |
void | cob_accept_arg_number (cob_field *f) |
void | cob_accept_arg_value (cob_field *f) |
void | cob_display_environment (const cob_field *f) |
void | cob_display_env_value (const cob_field *f) |
void | cob_set_environment (const cob_field *f1, const cob_field *f2) |
void | cob_get_environment (const cob_field *envname, cob_field *envval) |
void | cob_accept_environment (cob_field *f) |
void | cob_chain_setup (void *data, const size_t parm, const size_t size) |
void | cob_allocate (unsigned char **dataptr, cob_field *retptr, cob_field *sizefld, cob_field *initialize) |
void | cob_free_alloc (unsigned char **ptr1, unsigned char *ptr2) |
char * | cob_getenv (const char *name) |
int | cob_putenv (char *name) |
static const char * | cob_gettmpdir (void) |
void | cob_temp_name (char *filename, const char *ext) |
void | cob_incr_temp_iteration (void) |
int | cob_extern_init (void) |
void * | cob_command_line (int flags, int *pargc, char ***pargv, char ***penvp, char **pname) |
int | cob_tidy (void) |
int | cob_sys_exit_proc (const void *dispo, const void *pptr) |
int | cob_sys_error_proc (const void *dispo, const void *pptr) |
int | cob_sys_system (const void *cmdline) |
int | cob_sys_hosted (void *p, const void *var) |
Return some hosted C variables, argc, argv, stdin, stdout, stderr. More... | |
int | cob_sys_and (const void *p1, void *p2, const int length) |
int | cob_sys_or (const void *p1, void *p2, const int length) |
int | cob_sys_nor (const void *p1, void *p2, const int length) |
int | cob_sys_xor (const void *p1, void *p2, const int length) |
int | cob_sys_imp (const void *p1, void *p2, const int length) |
int | cob_sys_nimp (const void *p1, void *p2, const int length) |
int | cob_sys_eq (const void *p1, void *p2, const int length) |
int | cob_sys_not (void *p1, const int length) |
int | cob_sys_xf4 (void *p1, const void *p2) |
int | cob_sys_xf5 (const void *p1, void *p2) |
int | cob_sys_x91 (void *p1, const void *p2, void *p3) |
int | cob_sys_toupper (void *p1, const int length) |
int | cob_sys_tolower (void *p1, const int length) |
int | cob_sys_oc_nanosleep (const void *data) |
int | cob_sys_getpid (void) |
int | cob_sys_return_args (void *data) |
int | cob_sys_calledby (void *data) |
int | cob_sys_parameter_size (void *data) |
int | cob_sys_getopt_long_long (void *so, void *lo, void *idx, const int long_only, void *return_char, void *opt_val) |
int | cob_sys_sleep (const void *data) |
int | cob_sys_printable (void *p1,...) |
int | cob_sys_justify (void *p1,...) |
void | cob_set_locale (cob_field *locale, const int category) |
char * | cob_int_to_string (int i, char *number) |
char * | cob_int_to_formatted_bytestring (int i, char *number) |
char * | cob_strcat (char *str1, char *str2) |
char * | cob_strjoin (char **strarray, int size, char *separator) |
char * | cob_save_env_value (char *env_var, char *env_val) |
static void | var_print (const char *msg, const char *val, const char *default_val, const unsigned int format) |
char * | cob_expand_env_string (char *strval) |
static void | set_value (char *data, int len, long val) |
static long | get_value (char *data, int len) |
static int | set_config_val_by_name (char *value, const char *name, const char *func) |
static int | cb_lookup_config (char *keyword) |
static int | cb_config_entry (char *buf, int line) |
static int | cob_load_config_file (const char *config_file, int isoptional) |
int | cob_load_config (void) |
void | print_version (void) |
void | print_info (void) |
void | print_runtime_env () |
cob_settings * | cob_get_settings_ptr () |
void | cob_init (const int argc, char **argv) |
Variables | |
static int | cob_initialized = 0 |
static int | cob_argc |
static char ** | cob_argv |
static struct cob_alloc_cache * | cob_alloc_base |
static const char * | cob_last_sfile |
static cob_global * | cobglobptr = ((void*)0) |
static cob_settings * | cobsetptr = ((void*)0) |
static char * | runtime_err_str = ((void*)0) |
static const cob_field_attr | const_alpha_attr |
static char * | cob_local_env = ((void*)0) |
static int | current_arg |
static unsigned char * | commlnptr = ((void*)0) |
static size_t | commlncnt |
static size_t | cob_local_env_size = 0 |
static struct cob_external * | basext = ((void*)0) |
static size_t | sort_nkeys = 0 |
static cob_file_key * | sort_keys |
static const unsigned char * | sort_collate |
static const char * | cob_current_program_id = ((void*)0) |
static const char * | cob_current_section = ((void*)0) |
static const char * | cob_current_paragraph = ((void*)0) |
static const char * | cob_source_file = ((void*)0) |
static const char * | cob_source_statement = ((void*)0) |
static FILE * | cob_trace_file = ((void*)0) |
static unsigned int | cob_source_line = 0 |
static char * | strbuff = ((void*)0) |
static int | cob_process_id = 0 |
static int | cob_temp_iteration = 0 |
static unsigned int | conf_runtime_error_displayed = 0 |
static unsigned int | last_runtime_error_line = 0 |
static const char * | last_runtime_error_file = "unknown" |
static void(* | cob_ext_sighdl )(int) = ((void*)0) |
static const char *const | cob_exception_tab_name [] |
static const int | cob_exception_tab_code [] |
static int | cob_switch [36+1] |
static struct exit_handlerlist * | exit_hdlrs |
static struct handlerlist * | hdlrs |
static const char * | setting_group [] |
static char | not_set [] = "not set" |
static struct config_enum | lwrupr [] = {{"LOWER","1"},{"UPPER","2"},{not_set,"0"},{ ((void*)0) , ((void*)0) }} |
static struct config_enum | beepopts [] = {{"FLASH","1"},{"SPEAKER","2"},{"FALSE","9"},{"BEEP","0"},{ ((void*)0) , ((void*)0) }} |
static struct config_enum | timeopts [] = {{"0","1000"},{"1","100"},{"2","10"},{"3","1"},{ ((void*)0) , ((void*)0) }} |
static struct config_enum | syncopts [] = {{"P","1"},{ ((void*)0) , ((void*)0) }} |
static struct config_enum | varseqopts [] = {{"0","0"},{"1","1"},{"2","2"},{"3","3"},{ ((void*)0) , ((void*)0) }} |
static char | varseq_dflt [8] = "0" |
static struct config_tbl | gc_conf [] |
#define CB_IMSG_SIZE 24 |
Definition at line 74 of file common.c.
Referenced by var_print().
#define CB_IVAL_SIZE (80 - CB_IMSG_SIZE - 4) |
Definition at line 75 of file common.c.
Referenced by var_print().
#define CB_XSTRINGIFY | ( | s | ) | CB_STRINGIFY(s) |
#define COB_ERRBUF_SIZE 1024 |
Definition at line 120 of file common.c.
Referenced by cob_init().
#define COB_EXCEPTION | ( | code, | |
tag, | |||
name, | |||
critical | |||
) | 0x##code, |
#define COB_SWITCH_MAX 36 /* (must match cobc/tree.h)*/ |
Definition at line 199 of file common.c.
Referenced by cob_get_switch(), cob_init(), and cob_set_switch().
#define EXCEPTION_TAB_SIZE sizeof(cob_exception_tab_code) / sizeof(int) |
Definition at line 196 of file common.c.
Referenced by cob_get_exception_name().
#define FUNC_NAME_IN_DEFAULT NUM_CONFIG + 1 |
Definition at line 284 of file common.c.
Referenced by print_runtime_env(), and set_config_val_by_name().
#define NUM_CONFIG (sizeof(gc_conf)/sizeof(struct config_tbl)-1) |
Definition at line 283 of file common.c.
Referenced by cb_config_entry(), cb_lookup_config(), cob_exit_common(), cob_load_config(), cob_rescan_env_vals(), print_runtime_env(), and set_config_val_by_name().
#define OC_C_VERSION "unknown" |
Definition at line 102 of file common.c.
Referenced by print_info().
#define OC_C_VERSION_PRF "" |
Definition at line 101 of file common.c.
Referenced by print_info().
|
static |
Definition at line 4772 of file common.c.
References _, cb_lookup_config(), __cob_settings::cob_config_cur, cob_expand_env_string(), cob_free(), cob_malloc(), COB_MINI_BUFF, COB_SMALL_BUFF, cob_source_line, conf_runtime_error(), config_tbl::config_num, config_tbl::data_loc, config_tbl::data_type, ENV_PATH, ENV_STR, GRP_HIDE, line, NULL, NUM_CONFIG, config_tbl::set_by, set_config_val(), STS_CNFSET, STS_ENVCLR, STS_ENVSET, STS_RESET, and value.
Referenced by cob_load_config_file().
|
static |
Definition at line 4755 of file common.c.
References NUM_CONFIG.
Referenced by cb_config_entry().
void cob_accept_arg_number | ( | cob_field * | f | ) |
Definition at line 2930 of file common.c.
References cob_field::attr, cob_argc, COB_ATTR_INIT, cob_move(), COB_TYPE_NUMERIC_BINARY, cob_field::data, NULL, and cob_field::size.
Referenced by cobxref_().
void cob_accept_arg_value | ( | cob_field * | f | ) |
Definition at line 2945 of file common.c.
References cob_argc, cob_argv, COB_EC_IMP_ACCEPT, cob_memcpy(), cob_set_exception(), and current_arg.
Referenced by cobxref_().
void cob_accept_command_line | ( | cob_field * | f | ) |
Definition at line 2866 of file common.c.
References cob_argc, cob_argv, cob_free(), cob_malloc(), cob_memcpy(), commlncnt, commlnptr, and cob_field::size.
Referenced by GCic_().
void cob_accept_date | ( | cob_field * | f | ) |
Definition at line 2781 of file common.c.
References cob_memcpy(), and NULL.
Referenced by cobxref_().
void cob_accept_date_yyyymmdd | ( | cob_field * | f | ) |
Definition at line 2792 of file common.c.
References cob_memcpy(), and NULL.
Referenced by LISTING_().
void cob_accept_day | ( | cob_field * | f | ) |
Definition at line 2803 of file common.c.
References cob_memcpy(), and NULL.
void cob_accept_day_of_week | ( | cob_field * | f | ) |
Definition at line 2825 of file common.c.
References cob_memcpy(), and NULL.
void cob_accept_day_yyyyddd | ( | cob_field * | f | ) |
Definition at line 2814 of file common.c.
References cob_memcpy(), and NULL.
void cob_accept_environment | ( | cob_field * | f | ) |
Definition at line 3055 of file common.c.
References COB_EC_IMP_ACCEPT, cob_local_env, cob_memcpy(), cob_set_exception(), and NULL.
void cob_accept_exception_status | ( | cob_field * | f | ) |
Definition at line 1233 of file common.c.
References __cob_global::cob_exception_code, and cob_set_int().
void cob_accept_time | ( | cob_field * | field | ) |
Definition at line 2842 of file common.c.
References cob_get_current_date_and_time(), cob_memcpy(), cob_time::hour, cob_time::minute, cob_time::nanosecond, and cob_time::second.
Referenced by cobxref_().
void cob_accept_user_name | ( | cob_field * | f | ) |
Definition at line 1239 of file common.c.
References cob_memcpy(), and __cob_settings::cob_user_name.
void cob_allocate | ( | unsigned char ** | dataptr, |
cob_field * | retptr, | ||
cob_field * | sizefld, | ||
cob_field * | initialize | ||
) |
Definition at line 3089 of file common.c.
References cob_field::attr, cob_alloc_base, COB_EC_STORAGE_NOT_AVAIL, __cob_global::cob_exception_code, cob_free(), cob_get_int(), cob_malloc(), cob_move(), cob_alloc_cache::cob_pointer, cob_set_exception(), const_alpha_attr, cob_field::data, cob_alloc_cache::next, NULL, cob_alloc_cache::size, and cob_field::size.
void cob_cache_free | ( | void * | ptr | ) |
Definition at line 1362 of file common.c.
References cob_alloc_base, cob_free(), cob_alloc_cache::cob_pointer, and cob_alloc_cache::next.
Referenced by CHECKSRC_(), get__reserved__lists_(), and LISTING_().
void* cob_cache_malloc | ( | const size_t | size | ) |
Definition at line 1321 of file common.c.
References cob_alloc_base, cob_malloc(), cob_alloc_cache::cob_pointer, cob_alloc_cache::next, and cob_alloc_cache::size.
Referenced by cob_cache_realloc(), cob_module_enter(), cobxref_(), GCic_(), get__reserved__lists_(), and LISTING_().
void* cob_cache_realloc | ( | void * | ptr, |
const size_t | size | ||
) |
Definition at line 1336 of file common.c.
References cob_alloc_base, cob_cache_malloc(), cob_free(), cob_malloc(), cob_alloc_cache::cob_pointer, cob_alloc_cache::next, and cob_alloc_cache::size.
void cob_chain_setup | ( | void * | data, |
const size_t | parm, | ||
const size_t | size | ||
) |
Definition at line 3070 of file common.c.
References cob_argc, cob_argv, and __cob_global::cob_call_params.
void cob_check_based | ( | const unsigned char * | x, |
const char * | name | ||
) |
Definition at line 2525 of file common.c.
References _, cob_runtime_error(), and cob_stop_run().
int cob_check_env_false | ( | char * | s | ) |
int cob_check_env_true | ( | char * | s | ) |
void cob_check_linkage | ( | const unsigned char * | x, |
const char * | name, | ||
const int | check_type | ||
) |
Definition at line 2535 of file common.c.
References _, cob_runtime_error(), and cob_stop_run().
|
static |
Definition at line 2108 of file common.c.
References COB_FIELD_HAVE_SIGN, COB_FIELD_SIGN_LEADING, COB_FIELD_SIGN_SEPARATE, COB_MODULE_PTR, cob_field::data, cob_func_loc::data, cob_field::size, and unlikely.
Referenced by cob_is_numeric().
void cob_check_numeric | ( | const cob_field * | f, |
const char * | name | ||
) |
Definition at line 2552 of file common.c.
References _, cob_fast_malloc(), cob_free(), cob_is_numeric(), cob_runtime_error(), COB_SMALL_BUFF, cob_stop_run(), cob_field::data, and cob_field::size.
void cob_check_odo | ( | const int | i, |
const int | min, | ||
const int | max, | ||
const char * | name | ||
) |
Definition at line 2578 of file common.c.
References _, COB_EC_BOUND_ODO, cob_runtime_error(), cob_set_exception(), and cob_stop_run().
void cob_check_ref_mod | ( | const int | offset, |
const int | length, | ||
const int | size, | ||
const char * | name | ||
) |
Definition at line 2602 of file common.c.
References _, COB_EC_BOUND_REF_MOD, cob_runtime_error(), cob_set_exception(), and cob_stop_run().
void cob_check_subscript | ( | const int | i, |
const int | min, | ||
const int | max, | ||
const char * | name | ||
) |
Definition at line 2590 of file common.c.
References _, COB_EC_BOUND_SUBSCRIPT, cob_runtime_error(), cob_set_exception(), and cob_stop_run().
|
static |
Definition at line 1056 of file common.c.
References cob_trace_file, __cob_settings::cob_trace_filename, and __cob_settings::cob_unix_lf.
Referenced by cob_set_location(), and cob_trace_section().
void cob_check_version | ( | const char * | prog, |
const char * | packver, | ||
const int | patchlev | ||
) |
Definition at line 1894 of file common.c.
References _, cob_runtime_error(), cob_stop_run(), PACKAGE_VERSION, and PATCH_LEVEL.
Referenced by CHECKSRC_(), cobxref_(), GCic_(), get__reserved__lists_(), and LISTING_().
Definition at line 2318 of file common.c.
References cob_field::attr, cob_cmp_all(), cob_cmp_alnum(), cob_cmp_int(), COB_FIELD_DIGITS, COB_FIELD_IS_NUMERIC, COB_FIELD_TYPE, COB_FLAG_HAVE_SIGN, cob_move(), cob_numeric_cmp(), COB_TYPE_ALPHANUMERIC_ALL, COB_TYPE_NUMERIC_DISPLAY, cob_field::data, cob_field_attr::flags, cob_field::size, and cob_field_attr::type.
Referenced by cob_intr_max(), cob_intr_min(), cob_intr_ord_max(), cob_intr_ord_min(), cobxref_(), comp_field(), GCic_(), get__reserved__lists_(), get_min_and_max_of_args(), and LISTING_().
Definition at line 946 of file common.c.
References COB_FIELD_TYPE, COB_GET_SIGN, COB_MODULE_PTR, COB_PUT_SIGN, COB_TYPE_NUMERIC_PACKED, common_cmpc(), common_cmps(), cob_field::data, sign, and cob_field::size.
Referenced by cob_cmp().
Definition at line 982 of file common.c.
References COB_FIELD_TYPE, COB_GET_SIGN, COB_MODULE_PTR, COB_PUT_SIGN, COB_TYPE_NUMERIC_PACKED, common_cmpc(), common_cmps(), cob_field::data, and cob_field::size.
Referenced by cob_cmp().
void* cob_command_line | ( | int | flags, |
int * | pargc, | ||
char *** | pargv, | ||
char *** | penvp, | ||
char ** | pname | ||
) |
Definition at line 3279 of file common.c.
References _, cob_argc, cob_argv, cob_initialized, cob_runtime_error(), cob_stop_run(), COB_UNUSED, and NULL.
void cob_correct_numeric | ( | cob_field * | f | ) |
Definition at line 1917 of file common.c.
References COB_FIELD_HAVE_SIGN, COB_FIELD_IS_NUMDISP, COB_FIELD_SIGN_LEADING, COB_FIELD_SIGN_SEPARATE, COB_MODULE_PTR, cob_field::data, cob_func_loc::data, cob_field::size, and unlikely.
int cob_ctoi | ( | const char | digit | ) |
Definition at line 2651 of file common.c.
Referenced by cob_get_current_date_and_time(), seconds_from_formatted_time(), test_century(), test_day_of_year(), test_decade(), test_hour(), test_millenium(), test_month(), test_unit_year(), and test_week().
void cob_display_arg_number | ( | cob_field * | f | ) |
Definition at line 2911 of file common.c.
References cob_field::attr, cob_argc, COB_ATTR_INIT, COB_EC_IMP_DISPLAY, cob_move(), cob_set_exception(), COB_TYPE_NUMERIC_BINARY, current_arg, cob_field::data, NULL, and cob_field::size.
void cob_display_command_line | ( | cob_field * | f | ) |
Definition at line 2855 of file common.c.
References cob_free(), cob_malloc(), commlncnt, commlnptr, cob_field::data, and cob_field::size.
void cob_display_env_value | ( | const cob_field * | f | ) |
Definition at line 2981 of file common.c.
References COB_EC_IMP_DISPLAY, cob_fast_malloc(), cob_field_to_string(), cob_free(), cob_local_env, cob_malloc(), cob_rescan_env_vals(), cob_set_exception(), and cob_field::size.
Referenced by cob_set_environment().
void cob_display_environment | ( | const cob_field * | f | ) |
Definition at line 2959 of file common.c.
References __cob_settings::cob_env_mangle, cob_field_to_string(), cob_free(), cob_local_env, cob_local_env_size, cob_malloc(), cob_field::size, and unlikely.
Referenced by cob_set_environment().
|
static |
Definition at line 293 of file common.c.
References __cob_settings::cob_config_file, __cob_settings::cob_config_num, cob_free(), cob_initialized, cob_last_sfile, cob_local_env, __cob_global::cob_locale, __cob_global::cob_locale_collate, __cob_global::cob_locale_ctype, __cob_global::cob_locale_messages, __cob_global::cob_locale_monetary, __cob_global::cob_locale_numeric, __cob_global::cob_locale_orig, __cob_global::cob_locale_time, __cob_global::cob_main_argv0, cob_alloc_cache::cob_pointer, __cob_global::cob_term_buff, commlnptr, config_tbl::data_loc, cob_external::ename, ENV_PATH, ENV_STR, cob_external::ext_alloc, cob_alloc_cache::next, cob_external::next, NULL, NUM_CONFIG, and runtime_err_str.
Referenced by cob_terminate_routines().
char* cob_expand_env_string | ( | char * | strval | ) |
Definition at line 4406 of file common.c.
References COB_CONFIG_DIR, COB_COPY_DIR, cob_free(), cob_malloc(), cob_realloc(), cob_strdup(), and NULL.
Referenced by cb_config_entry(), and set_config_val().
int cob_extern_init | ( | void | ) |
Definition at line 3272 of file common.c.
References cob_init(), and NULL.
void* cob_external_addr | ( | const char * | exname, |
const int | exlength | ||
) |
Definition at line 2621 of file common.c.
References _, basext, __cob_global::cob_initial_external, cob_malloc(), cob_runtime_error(), cob_stop_run(), cob_external::ename, cob_external::esize, cob_external::ext_alloc, and cob_external::next.
void* cob_fast_malloc | ( | const size_t | size | ) |
Definition at line 1296 of file common.c.
References cob_fatal_error(), COB_FERROR_MEMORY, and unlikely.
Referenced by cob_check_numeric(), cob_decimal_set_display(), cob_display_env_value(), cob_file_sort_init(), cob_get_buff(), cob_getopt_long_long(), cob_gettmpdir(), cob_init(), cob_init_call(), cob_init_fileio(), cob_inspect_init(), cob_int_to_formatted_bytestring(), cob_new_item(), cob_save_env_value(), cob_strcat(), and cobcrun_setenv().
void cob_fatal_error | ( | const int | fatal_error | ) |
Definition at line 1601 of file common.c.
References _, cob_file::assign, COB_D2I, __cob_global::cob_error_file, COB_FERROR_CANCEL, COB_FERROR_CHAINING, COB_FERROR_CODEGEN, COB_FERROR_FILE, COB_FERROR_FREE, COB_FERROR_FUNCTION, COB_FERROR_GLOBAL, COB_FERROR_INITIALIZED, COB_FERROR_MEMORY, COB_FERROR_MODULE, COB_FERROR_NONE, COB_FERROR_RECURSIVE, COB_FERROR_STACK, cob_field_to_string(), COB_FILE_BUFF, COB_FILE_MAX, cob_free(), cob_malloc(), COB_MODULE_PTR, cob_runtime_error(), COB_STATUS_10_END_OF_FILE, COB_STATUS_14_OUT_OF_KEY_RANGE, COB_STATUS_21_KEY_INVALID, COB_STATUS_22_KEY_EXISTS, COB_STATUS_23_KEY_NOT_EXISTS, COB_STATUS_30_PERMANENT_ERROR, COB_STATUS_35_NOT_EXISTS, COB_STATUS_37_PERMISSION_DENIED, COB_STATUS_41_ALREADY_OPEN, COB_STATUS_42_NOT_OPEN, COB_STATUS_43_READ_NOT_DONE, COB_STATUS_44_RECORD_OVERFLOW, COB_STATUS_46_READ_ERROR, COB_STATUS_47_INPUT_DENIED, COB_STATUS_48_OUTPUT_DENIED, COB_STATUS_49_I_O_DENIED, COB_STATUS_51_RECORD_LOCKED, COB_STATUS_57_I_O_LINAGE, COB_STATUS_61_FILE_SHARING, COB_STATUS_91_NOT_AVAILABLE, cob_stop_run(), and cob_file::file_status.
Referenced by CHECKSRC_(), cob_call(), cob_call_field(), cob_cancel(), cob_cancel_field(), cob_fast_malloc(), cob_file_open(), cob_free(), cob_get_global_ptr(), cob_intr_boolean_of_integer(), cob_intr_char_national(), cob_intr_display_of(), cob_intr_exception_file_n(), cob_intr_exception_location_n(), cob_intr_integer_of_boolean(), cob_intr_national_of(), cob_intr_standard_compare(), cob_longjmp(), cob_malloc(), cob_module_enter(), cob_realloc(), cob_resolve_internal(), cob_savenv(), cobxref_(), field_display(), GCic_(), get__reserved__lists_(), integer_of_ddd(), integer_of_formatted_date(), integer_of_mmdd(), integer_of_wwwd(), LISTING_(), and seconds_from_formatted_time().
void cob_field_to_string | ( | const cob_field * | f, |
void * | str, | ||
const size_t | maxsize | ||
) |
Definition at line 1492 of file common.c.
References cob_field::data, cob_field::size, and unlikely.
Referenced by cob_call_field(), cob_cancel_field(), cob_delete_file(), cob_display_env_value(), cob_display_environment(), cob_exit_fileio(), cob_fatal_error(), cob_get_environment(), cob_intr_locale_compare(), cob_intr_locale_date(), cob_open(), cob_set_locale(), and cob_sys_getopt_long_long().
void cob_free | ( | void * | mptr | ) |
Definition at line 1284 of file common.c.
References cob_fatal_error(), COB_FERROR_FREE, and unlikely.
Referenced by alloc_figurative(), cb_config_entry(), cb_list_intrinsics(), cb_load_conf_file(), cob_accept_command_line(), cob_allocate(), cob_cache_free(), cob_cache_realloc(), cob_call(), cob_call_field(), cob_check_numeric(), cob_chk_file_env(), cob_chk_file_mapping(), cob_close(), cob_decimal_get_field(), cob_decimal_pop(), cob_decimal_set_display(), cob_display_command_line(), cob_display_env_value(), cob_display_environment(), cob_exit_call(), cob_exit_common(), cob_exit_fileio(), cob_exit_intrinsic(), cob_exit_numeric(), cob_exit_screen(), cob_exit_strings(), cob_expand_env_string(), cob_fatal_error(), cob_file_sort_close(), cob_file_sort_giving(), cob_free_alloc(), cob_free_list(), cob_get_buff(), cob_get_environment(), cob_getopt_long_long(), cob_gettmpdir(), cob_init(), cob_init_call(), cob_inspect_init(), cob_intr_concatenate(), cob_intr_exception_location(), cob_intr_locale_compare(), cob_intr_median(), cob_intr_numval_f(), cob_move_all(), cob_move_edited_to_display(), cob_realloc(), cob_resolve(), cob_resolve_cobol(), cob_restore_func(), cob_runtime_error(), cob_save_env_value(), cob_set_library_path(), cob_set_locale(), cob_set_location(), cob_srttmpfile(), cob_strcat(), cob_sys_change_dir(), cob_sys_check_file_exist(), cob_sys_copy_file(), cob_sys_create_dir(), cob_sys_delete_dir(), cob_sys_delete_file(), cob_sys_error_proc(), cob_sys_exit_proc(), cob_sys_file_info(), cob_sys_get_current_dir(), cob_sys_getopt_long_long(), cob_sys_rename_file(), cob_sys_system(), cob_table_sort(), cob_trace_section(), cob_unstring_init(), do_cancel_module(), format_field(), indexed_close(), indexed_open(), indirect_move(), insert(), make_field_entry(), numval(), open_cbl_file(), set_config_val(), substitute(), and var_print().
void cob_free_alloc | ( | unsigned char ** | ptr1, |
unsigned char * | ptr2 | ||
) |
Definition at line 3131 of file common.c.
References cob_alloc_base, COB_EC_STORAGE_NOT_ALLOC, __cob_global::cob_exception_code, cob_free(), cob_alloc_cache::cob_pointer, cob_set_exception(), cob_alloc_cache::next, and NULL.
struct cob_time cob_get_current_date_and_time | ( | void | ) |
Definition at line 2699 of file common.c.
References cob_ctoi(), cob_time::day_of_month, cob_time::day_of_week, cob_time::hour, cob_time::minute, cob_time::month, cob_time::nanosecond, NULL, cob_time::offset_known, one_indexed_day_of_week_from_monday(), cob_time::second, set_unknown_offset(), cob_time::utc_offset, and cob_time::year.
Referenced by cob_accept_time(), cob_intr_current_date(), format_current_date(), and get_system_offset_time_ptr().
Definition at line 3025 of file common.c.
References COB_EC_IMP_ACCEPT, __cob_settings::cob_env_mangle, cob_field_to_string(), cob_free(), cob_malloc(), cob_memcpy(), cob_set_exception(), cob_field::size, and unlikely.
Referenced by cobxref_(), GCic_(), and LISTING_().
int cob_get_exception_code | ( | void | ) |
Definition at line 1193 of file common.c.
References __cob_global::cob_exception_code.
Referenced by cob_string_append(), and cob_unstring_into().
const char* cob_get_exception_name | ( | void | ) |
Definition at line 1199 of file common.c.
References __cob_global::cob_exception_code, cob_exception_tab_code, cob_exception_tab_name, EXCEPTION_TAB_SIZE, and NULL.
Referenced by cob_intr_exception_status().
cob_global* cob_get_global_ptr | ( | void | ) |
Definition at line 1787 of file common.c.
References cob_fatal_error(), COB_FERROR_INITIALIZED, cob_initialized, cobglobptr, and unlikely.
unsigned char* cob_get_pointer | ( | const void * | srcptr | ) |
void* cob_get_prog_pointer | ( | const void * | srcptr | ) |
cob_settings* cob_get_settings_ptr | ( | void | ) |
|
static |
Definition at line 651 of file common.c.
Referenced by cob_real_get_sign().
|
static |
Definition at line 747 of file common.c.
Referenced by cob_real_get_sign().
int cob_get_switch | ( | const int | n | ) |
Definition at line 2296 of file common.c.
References cob_switch, and COB_SWITCH_MAX.
Referenced by cob_switch_value().
char* cob_getenv | ( | const char * | name | ) |
Definition at line 3181 of file common.c.
References cob_strdup(), and NULL.
|
static |
Definition at line 3210 of file common.c.
References cob_fast_malloc(), cob_free(), cob_strdup(), and NULL.
Referenced by cob_temp_name().
void cob_incr_temp_iteration | ( | void | ) |
Definition at line 3266 of file common.c.
References cob_temp_iteration.
Referenced by cob_srttmpfile(), and process_filename().
void cob_init | ( | const int | argc, |
char ** | argv | ||
) |
Definition at line 5390 of file common.c.
References _, bindtextdomain, cob_argc, cob_argv, cob_current_paragraph, cob_current_program_id, cob_current_section, COB_ERRBUF_SIZE, cob_fast_malloc(), cob_free(), cob_init_call(), cob_init_fileio(), cob_init_intrinsic(), cob_init_move(), cob_init_numeric(), cob_init_screenio(), cob_init_strings(), cob_init_termio(), cob_initialized, COB_LARGE_BUFF, COB_LARGE_MAX, cob_last_sfile, cob_load_config(), cob_local_env, cob_local_env_size, __cob_global::cob_locale, __cob_global::cob_locale_collate, __cob_global::cob_locale_ctype, __cob_global::cob_locale_messages, __cob_global::cob_locale_monetary, __cob_global::cob_locale_numeric, __cob_global::cob_locale_orig, __cob_global::cob_locale_time, __cob_global::cob_main_argv0, cob_malloc(), COB_MEDIUM_BUFF, __cob_settings::cob_physical_cancel, __cob_global::cob_physical_cancel, cob_set_signal(), cob_source_file, cob_source_line, cob_source_statement, cob_stop_run(), cob_strdup(), cob_switch, COB_SWITCH_MAX, __cob_global::cob_term_buff, __cob_settings::cob_unix_lf, __cob_settings::cob_user_name, commlncnt, commlnptr, current_arg, exit_hdlrs, hdlrs, LOCALEDIR, NULL, PACKAGE, R_OK, runtime_err_str, set_config_val_by_name(), sort_collate, sort_nkeys, textdomain, and unlikely.
Referenced by cob_extern_init(), cob_module_enter(), main(), and process_command_line().
char* cob_int_to_formatted_bytestring | ( | int | i, |
char * | number | ||
) |
Definition at line 4246 of file common.c.
References cob_fast_malloc(), and NULL.
char* cob_int_to_string | ( | int | i, |
char * | number | ||
) |
int cob_is_alpha | ( | const cob_field * | f | ) |
Definition at line 2453 of file common.c.
References cob_field::data, and cob_field::size.
Referenced by cobxref_().
int cob_is_lower | ( | const cob_field * | f | ) |
int cob_is_numeric | ( | const cob_field * | f | ) |
Definition at line 2375 of file common.c.
References cob_check_numdisp(), COB_FIELD_HAVE_SIGN, COB_FIELD_NO_SIGN_NIBBLE, COB_FIELD_TYPE, COB_MODULE_PTR, COB_TYPE_NUMERIC_BINARY, COB_TYPE_NUMERIC_DISPLAY, COB_TYPE_NUMERIC_DOUBLE, COB_TYPE_NUMERIC_FLOAT, COB_TYPE_NUMERIC_FP_DEC128, COB_TYPE_NUMERIC_FP_DEC64, COB_TYPE_NUMERIC_PACKED, cob_field::data, sign, and cob_field::size.
Referenced by cob_check_numeric(), and cobxref_().
int cob_is_omitted | ( | const cob_field * | f | ) |
Definition at line 2369 of file common.c.
References cob_field::data, and NULL.
int cob_is_upper | ( | const cob_field * | f | ) |
int cob_load_config | ( | void | ) |
Definition at line 5063 of file common.c.
References COB_CONFIG_DIR, cob_load_config_file(), COB_MEDIUM_BUFF, COB_MEDIUM_MAX, cob_rescan_env_vals(), config_tbl::data_type, NULL, NUM_CONFIG, set_config_val(), SLASH_STR, STS_CNFSET, STS_ENVCLR, STS_ENVSET, varseq_dflt, and WITH_VARSEQ.
Referenced by cob_init().
|
static |
Definition at line 4944 of file common.c.
References _, cb_config_entry(), __cob_settings::cob_config_cur, COB_CONFIG_DIR, __cob_settings::cob_config_file, __cob_settings::cob_config_num, COB_FILE_BUFF, COB_FILE_MAX, cob_malloc(), cob_realloc(), COB_SMALL_BUFF, cob_source_file, cob_source_line, conf_runtime_error(), F_OK, line, NULL, SLASH_CHAR, and SLASH_STR.
Referenced by cob_load_config().
void* cob_malloc | ( | const size_t | size | ) |
Definition at line 1250 of file common.c.
References cob_fatal_error(), COB_FERROR_MEMORY, and unlikely.
Referenced by alloc_figurative(), cache_dynload(), cache_preload(), cb_config_entry(), cb_list_intrinsics(), cb_load_conf_file(), cob_accept_command_line(), cob_allocate(), cob_cache_file(), cob_cache_malloc(), cob_cache_realloc(), cob_call(), cob_decimal_get_field(), cob_decimal_push(), cob_display_command_line(), cob_display_env_value(), cob_display_environment(), cob_expand_env_string(), cob_external_addr(), cob_fatal_error(), cob_file_sort_giving(), cob_file_sort_init(), cob_get_environment(), cob_init(), cob_init_call(), cob_init_fileio(), cob_init_intrinsic(), cob_init_numeric(), cob_init_strings(), cob_intr_concatenate(), cob_intr_exception_location(), cob_intr_locale_compare(), cob_intr_median(), cob_intr_numval_f(), cob_load_config_file(), cob_move_all(), cob_move_edited_to_display(), cob_rescan_env_vals(), cob_resolve_internal(), cob_save_func(), cob_set_library_path(), cob_set_locale(), cob_srttmpfile(), cob_str_from_fld(), cob_strdup(), cob_sys_error_proc(), cob_sys_exit_proc(), cob_sys_getopt_long_long(), cob_sys_system(), cob_table_sort_init(), cob_unstring_init(), format_field(), indexed_open(), indexed_write(), indirect_move(), insert(), make_field_entry(), numval(), screen_accept(), and substitute().
|
static |
Definition at line 1042 of file common.c.
References cob_field::attr, cob_move(), cob_u8_ptr, const_alpha_attr, cob_field::data, and cob_field::size.
Referenced by cob_accept_arg_value(), cob_accept_command_line(), cob_accept_date(), cob_accept_date_yyyymmdd(), cob_accept_day(), cob_accept_day_of_week(), cob_accept_day_yyyyddd(), cob_accept_environment(), cob_accept_time(), cob_accept_user_name(), and cob_get_environment().
void cob_module_enter | ( | cob_module ** | module, |
cob_global ** | mglobal, | ||
const int | auto_init | ||
) |
Definition at line 1796 of file common.c.
References cob_cache_malloc(), __cob_global::cob_call_params, cob_fatal_error(), COB_FERROR_INITIALIZED, cob_init(), cob_initialized, COB_MODULE_PTR, cobglobptr, module, NULL, and unlikely.
Referenced by CHECKSRC_(), cobxref_(), GCic_(), get__reserved__lists_(), and LISTING_().
void cob_module_leave | ( | cob_module * | module | ) |
Definition at line 1827 of file common.c.
References COB_MODULE_PTR, and COB_UNUSED.
Referenced by CHECKSRC_(), cobxref_(), GCic_(), get__reserved__lists_(), and LISTING_().
void cob_parameter_check | ( | const char * | funcname, |
const int | numparms | ||
) |
Definition at line 1907 of file common.c.
References _, __cob_global::cob_call_params, cob_runtime_error(), and cob_stop_run().
|
static |
Definition at line 699 of file common.c.
Referenced by cb_build_move_literal(), and cob_real_put_sign().
|
static |
Definition at line 821 of file common.c.
Referenced by cob_real_put_sign().
int cob_putenv | ( | char * | name | ) |
Definition at line 3195 of file common.c.
References cob_rescan_env_vals(), and cob_strdup().
void cob_ready_trace | ( | void | ) |
int cob_real_get_sign | ( | cob_field * | f | ) |
Definition at line 2205 of file common.c.
References COB_FIELD_NO_SIGN_NIBBLE, COB_FIELD_SIGN_LEADING, COB_FIELD_SIGN_SEPARATE, COB_FIELD_TYPE, cob_get_sign_ascii(), cob_get_sign_ebcdic(), COB_MODULE_PTR, COB_TYPE_NUMERIC_DISPLAY, COB_TYPE_NUMERIC_PACKED, cob_field::data, cob_field::size, and unlikely.
void cob_real_put_sign | ( | cob_field * | f, |
const int | sign | ||
) |
Definition at line 2246 of file common.c.
References COB_FIELD_NO_SIGN_NIBBLE, COB_FIELD_SIGN_LEADING, COB_FIELD_SIGN_SEPARATE, COB_FIELD_TYPE, COB_MODULE_PTR, cob_put_sign_ascii(), cob_put_sign_ebcdic(), COB_TYPE_NUMERIC_DISPLAY, COB_TYPE_NUMERIC_PACKED, cob_u8_t, cob_field::data, cob_field::size, and unlikely.
void* cob_realloc | ( | void * | optr, |
const size_t | osize, | ||
const size_t | nsize | ||
) |
Definition at line 1262 of file common.c.
References cob_fatal_error(), COB_FERROR_FREE, COB_FERROR_MEMORY, cob_free(), and unlikely.
Referenced by cob_expand_env_string(), and cob_load_config_file().
void cob_reg_sighnd | ( | void(*)(int) | sighnd | ) |
|
static |
Definition at line 1099 of file common.c.
References __cob_settings::cob_extended_status, cob_malloc(), cob_source_file, cob_source_line, __cob_settings::cob_use_esc, config_tbl::data_type, GRP_HIDE, NULL, NUM_CONFIG, config_tbl::set_by, set_config_val(), and STS_ENVSET.
Referenced by cob_display_env_value(), cob_load_config(), and cob_putenv().
void cob_reset_trace | ( | void | ) |
void cob_restore_func | ( | struct cob_func_loc * | fl | ) |
Definition at line 1879 of file common.c.
References __cob_global::cob_call_params, cob_free(), COB_MODULE_PTR, cob_func_loc::data, cob_func_loc::func_params, cob_func_loc::save_call_params, cob_func_loc::save_module, cob_func_loc::save_num_params, and cob_func_loc::save_proc_parms.
void cob_runtime_error | ( | const char * | fmt, |
... | |||
) |
Definition at line 1543 of file common.c.
References _, cob_exit_screen(), cob_free(), cob_source_file, cob_source_line, hdlrs, handlerlist::next, NULL, handlerlist::proc, and runtime_err_str.
Referenced by cob_call(), cob_call_error(), cob_cancel(), cob_check_based(), cob_check_linkage(), cob_check_numeric(), cob_check_odo(), cob_check_ref_mod(), cob_check_subscript(), cob_check_version(), cob_command_line(), cob_external_addr(), cob_fatal_error(), cob_get_sort_tempfile(), cob_longjmp(), cob_parameter_check(), cob_resolve_func(), cob_savenv(), cob_screen_init(), cob_sys_check_file_exist(), cob_sys_file_info(), cob_sys_getopt_long_long(), and cob_sys_system().
char* cob_save_env_value | ( | char * | env_var, |
char * | env_val | ||
) |
Definition at line 4319 of file common.c.
References cob_fast_malloc(), cob_free(), and NULL.
void* cob_save_func | ( | cob_field ** | savefld, |
const int | params, | ||
const int | eparams, | ||
... | |||
) |
Definition at line 1835 of file common.c.
References __cob_global::cob_call_params, cob_malloc(), COB_MODULE_PTR, cob_field::data, cob_func_loc::data, cob_func_loc::func_params, params, cob_func_loc::save_call_params, cob_func_loc::save_module, cob_func_loc::save_num_params, cob_func_loc::save_proc_parms, and unlikely.
Definition at line 3018 of file common.c.
References cob_display_env_value(), and cob_display_environment().
Referenced by GCic_().
void cob_set_exception | ( | const int | id | ) |
Definition at line 1212 of file common.c.
References cob_current_paragraph, cob_current_program_id, cob_current_section, __cob_global::cob_exception_code, cob_exception_tab_code, __cob_global::cob_got_exception, __cob_global::cob_orig_line, __cob_global::cob_orig_paragraph, __cob_global::cob_orig_program_id, __cob_global::cob_orig_section, __cob_global::cob_orig_statement, cob_source_line, cob_source_statement, and NULL.
Referenced by cob_accept(), cob_accept_arg_value(), cob_accept_environment(), cob_alloc_field(), cob_allocate(), cob_call_field(), cob_check_odo(), cob_check_pos_status(), cob_check_ref_mod(), cob_check_subscript(), cob_decimal_div(), cob_decimal_do_round(), cob_decimal_get_binary(), cob_decimal_get_display(), cob_decimal_get_field(), cob_decimal_get_ieee128dec(), cob_decimal_get_ieee64dec(), cob_decimal_get_packed(), cob_decimal_pow(), cob_display_arg_number(), cob_display_env_value(), cob_free_alloc(), cob_get_environment(), cob_inspect_converting(), cob_inspect_init(), cob_intr_acos(), cob_intr_annuity(), cob_intr_asin(), cob_intr_atan(), cob_intr_binop(), cob_intr_combined_datetime(), cob_intr_cos(), cob_intr_currency_symbol(), cob_intr_date_of_integer(), cob_intr_date_to_yyyymmdd(), cob_intr_day_of_integer(), cob_intr_day_to_yyyyddd(), cob_intr_exp(), cob_intr_exp10(), cob_intr_factorial(), cob_intr_formatted_current_date(), cob_intr_formatted_date(), cob_intr_formatted_datetime(), cob_intr_formatted_time(), cob_intr_highest_algebraic(), cob_intr_integer_of_date(), cob_intr_integer_of_day(), cob_intr_lcl_time_from_secs(), cob_intr_locale_compare(), cob_intr_locale_date(), cob_intr_locale_time(), cob_intr_log(), cob_intr_log10(), cob_intr_lowest_algebraic(), cob_intr_mon_decimal_point(), cob_intr_mon_thousands_sep(), cob_intr_num_decimal_point(), cob_intr_num_thousands_sep(), cob_intr_numval_f(), cob_intr_seconds_from_formatted_time(), cob_intr_sin(), cob_intr_sqrt(), cob_intr_standard_deviation(), cob_intr_tan(), cob_intr_year_to_yyyy(), cob_mod_or_rem(), cob_resolve_cobol(), cob_resolve_internal(), cob_set_locale(), cob_string_append(), cob_string_init(), cob_unstring_finish(), cob_unstring_init(), format_time(), inspect_common(), numval(), raise_ec_on_invalid_line_or_col(), raise_ec_on_truncation(), save_status(), and set_resolve_error().
void cob_set_locale | ( | cob_field * | locale, |
const int | category | ||
) |
Definition at line 4165 of file common.c.
References COB_EC_LOCALE_MISSING, cob_field_to_string(), cob_free(), COB_LC_ALL, COB_LC_CLASS, COB_LC_COLLATE, COB_LC_CTYPE, COB_LC_MESSAGES, COB_LC_MONETARY, COB_LC_NUMERIC, COB_LC_TIME, COB_LC_USER, __cob_global::cob_locale, __cob_global::cob_locale_ctype, __cob_global::cob_locale_orig, cob_malloc(), cob_set_exception(), cob_strdup(), NULL, and cob_field::size.
void cob_set_location | ( | const char * | sfile, |
const unsigned int | sline, | ||
const char * | csect, | ||
const char * | cpara, | ||
const char * | cstatement | ||
) |
Definition at line 1388 of file common.c.
References cob_check_trace_file(), cob_current_paragraph, cob_current_program_id, cob_current_section, cob_free(), cob_last_sfile, __cob_settings::cob_line_trace, COB_MODULE_PTR, cob_source_file, cob_source_line, cob_source_statement, cob_strdup(), and cob_trace_file.
Referenced by CHECKSRC_(), cobxref_(), GCic_(), get__reserved__lists_(), and LISTING_().
|
static |
Definition at line 549 of file common.c.
References NULL.
Referenced by cob_init().
void cob_set_switch | ( | const int | n, |
const int | flag | ||
) |
void cob_stop_run | ( | const int | status | ) |
Definition at line 1524 of file common.c.
References cob_initialized, cob_terminate_routines(), exit_hdlrs, exit_handlerlist::next, NULL, and exit_handlerlist::proc.
Referenced by cob_call(), cob_call_error(), cob_cancel(), cob_check_based(), cob_check_linkage(), cob_check_numeric(), cob_check_odo(), cob_check_ref_mod(), cob_check_subscript(), cob_check_version(), cob_command_line(), cob_external_addr(), cob_fatal_error(), cob_get_sort_tempfile(), cob_init(), cob_longjmp(), cob_parameter_check(), cob_resolve_func(), cob_savenv(), cob_screen_init(), cob_sys_check_file_exist(), cob_sys_file_info(), cob_sys_getopt_long_long(), cob_sys_system(), GCic_(), and main().
char* cob_strcat | ( | char * | str1, |
char * | str2 | ||
) |
Definition at line 4270 of file common.c.
References cob_fast_malloc(), cob_free(), cob_strdup(), and strbuff.
Referenced by cache_preload(), cob_strjoin(), and var_print().
char* cob_strdup | ( | const char * | p | ) |
Definition at line 1308 of file common.c.
References cob_malloc().
Referenced by cache_dynload(), cache_preload(), cob_chk_call_path(), cob_chk_file_env(), cob_chk_file_mapping(), cob_expand_env_string(), cob_getenv(), cob_gettmpdir(), cob_init(), cob_init_call(), cob_putenv(), cob_set_locale(), cob_set_location(), cob_strcat(), cob_trace_section(), indexed_open(), insert(), and var_print().
char* cob_strjoin | ( | char ** | strarray, |
int | size, | ||
char * | separator | ||
) |
Definition at line 4302 of file common.c.
References cob_strcat(), and NULL.
int cob_sys_and | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_calledby | ( | void * | data | ) |
int cob_sys_eq | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_error_proc | ( | const void * | dispo, |
const void * | pptr | ||
) |
Definition at line 3381 of file common.c.
References COB_CHK_PARMS, cob_free(), cob_malloc(), hdlrs, handlerlist::next, NULL, and handlerlist::proc.
int cob_sys_exit_proc | ( | const void * | dispo, |
const void * | pptr | ||
) |
Definition at line 3336 of file common.c.
References COB_CHK_PARMS, cob_free(), cob_malloc(), exit_hdlrs, exit_handlerlist::next, NULL, and exit_handlerlist::proc.
int cob_sys_getopt_long_long | ( | void * | so, |
void * | lo, | ||
void * | idx, | ||
const int | long_only, | ||
void * | return_char, | ||
void * | opt_val | ||
) |
Definition at line 3889 of file common.c.
References _, cob_argc, cob_argv, COB_CHK_PARMS, cob_field_to_string(), cob_free(), cob_get_int(), cob_getopt_long_long(), cob_malloc(), COB_MODULE_PTR, cob_optarg, cob_runtime_error(), cob_set_int(), cob_stop_run(), COB_UNUSED, option::flag, option::has_arg, longoption_def::has_option, option::name, longoption_def::name, NULL, longoption_def::return_value, longoption_def::return_value_pointer, and option::val.
int cob_sys_getpid | ( | void | ) |
Definition at line 3818 of file common.c.
References cob_process_id.
Referenced by cob_temp_name().
int cob_sys_hosted | ( | void * | p, |
const void * | var | ||
) |
Return some hosted C variables, argc, argv, stdin, stdout, stderr.
Definition at line 3465 of file common.c.
References cob_argc, cob_argv, COB_CHK_PARMS, COB_MODULE_PTR, and cob_u8_ptr.
int cob_sys_imp | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_justify | ( | void * | p1, |
... | |||
) |
Definition at line 4086 of file common.c.
References __cob_global::cob_call_params, COB_CHK_PARMS, COB_MODULE_PTR, and cob_u8_ptr.
Referenced by LISTING_().
int cob_sys_nimp | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_nor | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_not | ( | void * | p1, |
const int | length | ||
) |
int cob_sys_oc_nanosleep | ( | const void * | data | ) |
Definition at line 3774 of file common.c.
References COB_CHK_PARMS, cob_get_llint(), COB_MODULE_PTR, cob_s64_t, COB_UNUSED, and NULL.
int cob_sys_or | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
int cob_sys_parameter_size | ( | void * | data | ) |
Definition at line 3867 of file common.c.
References COB_CHK_PARMS, cob_get_int(), COB_MODULE_PTR, and COB_UNUSED.
int cob_sys_printable | ( | void * | p1, |
... | |||
) |
Definition at line 4053 of file common.c.
References __cob_global::cob_call_params, COB_CHK_PARMS, COB_MODULE_PTR, and cob_u8_ptr.
int cob_sys_return_args | ( | void * | data | ) |
Definition at line 3827 of file common.c.
References COB_CHK_PARMS, COB_MODULE_PTR, cob_set_int(), and COB_UNUSED.
int cob_sys_sleep | ( | const void * | data | ) |
Definition at line 4031 of file common.c.
References COB_CHK_PARMS, cob_get_int(), COB_MODULE_PTR, and COB_UNUSED.
Referenced by GCic_().
int cob_sys_system | ( | const void * | cmdline | ) |
Definition at line 3426 of file common.c.
References _, COB_CHK_PARMS, cob_free(), cob_malloc(), COB_MEDIUM_MAX, COB_MODULE_PTR, cob_runtime_error(), __cob_global::cob_screen_initialized, cob_screen_set_mode(), cob_stop_run(), and unlikely.
Referenced by GCic_(), and get__reserved__lists_().
int cob_sys_tolower | ( | void * | p1, |
const int | length | ||
) |
int cob_sys_toupper | ( | void * | p1, |
const int | length | ||
) |
int cob_sys_x91 | ( | void * | p1, |
const void * | p2, | ||
void * | p3 | ||
) |
int cob_sys_xf4 | ( | void * | p1, |
const void * | p2 | ||
) |
int cob_sys_xf5 | ( | const void * | p1, |
void * | p2 | ||
) |
int cob_sys_xor | ( | const void * | p1, |
void * | p2, | ||
const int | length | ||
) |
void cob_table_sort | ( | cob_field * | f, |
const int | n | ||
) |
Definition at line 2516 of file common.c.
References cob_free(), cob_field::data, cob_field::size, and sort_compare().
Referenced by cobxref_().
void cob_table_sort_init | ( | const size_t | nkeys, |
const unsigned char * | collating_sequence | ||
) |
Definition at line 2494 of file common.c.
References cob_malloc(), COB_MODULE_PTR, sort_collate, and sort_nkeys.
Referenced by cobxref_().
void cob_table_sort_init_key | ( | cob_field * | field, |
const int | flag, | ||
const unsigned int | offset | ||
) |
Definition at line 2506 of file common.c.
References cob_file_key::field, cob_file_key::flag, cob_file_key::offset, and sort_nkeys.
Referenced by cobxref_().
void cob_temp_name | ( | char * | filename, |
const char * | ext | ||
) |
Definition at line 3253 of file common.c.
References COB_FILE_MAX, cob_gettmpdir(), cob_sys_getpid(), cob_temp_iteration, and SLASH_CHAR.
Referenced by cob_srttmpfile(), and process_filename().
|
static |
Definition at line 406 of file common.c.
References cob_exit_call(), cob_exit_common(), cob_exit_fileio(), cob_exit_intrinsic(), cob_exit_numeric(), cob_exit_screen(), cob_exit_strings(), cob_initialized, cob_trace_file, and NULL.
Referenced by cob_stop_run(), and cob_tidy().
int cob_tidy | ( | void | ) |
Definition at line 3315 of file common.c.
References cob_initialized, cob_terminate_routines(), exit_hdlrs, exit_handlerlist::next, NULL, and exit_handlerlist::proc.
void cob_trace_section | ( | const char * | para, |
const char * | source, | ||
const int | line | ||
) |
Definition at line 1429 of file common.c.
References cob_check_trace_file(), cob_free(), cob_last_sfile, __cob_settings::cob_line_trace, COB_MODULE_PTR, cob_strdup(), and cob_trace_file.
|
static |
Definition at line 900 of file common.c.
References unlikely.
Referenced by cob_cmp_all(), and cob_cmp_alnum().
|
static |
Definition at line 923 of file common.c.
References unlikely.
Referenced by cob_cmp_all(), cob_cmp_alnum(), and sort_compare().
void conf_runtime_error | ( | const int | finish_error, |
const char * | fmt, | ||
... | |||
) |
Definition at line 1744 of file common.c.
References _, cob_source_file, cob_source_line, conf_runtime_error_displayed, last_runtime_error_file, and last_runtime_error_line.
Referenced by cb_config_entry(), cob_load_config_file(), conf_runtime_error_value(), and set_config_val().
void conf_runtime_error_value | ( | char * | value, |
const int | conf_pos | ||
) |
Definition at line 1731 of file common.c.
References _, config_tbl::conf_name, conf_runtime_error(), config_tbl::env_name, NULL, and STS_CNFSET.
Referenced by set_config_val().
|
static |
Definition at line 4665 of file common.c.
References config_tbl::data_len, config_tbl::data_loc, config_tbl::data_type, config_tbl::enums, ENV_BOOL, ENV_CHAR, ENV_INT, ENV_NOT, ENV_PATH, ENV_SIZE, ENV_STR, get_value(), config_enum::match, NULL, numval(), and value.
Referenced by print_runtime_env().
|
static |
Definition at line 4488 of file common.c.
Referenced by get_config_val().
|
static |
Definition at line 1147 of file common.c.
Referenced by cob_get_current_date_and_time().
void print_info | ( | void | ) |
Definition at line 5153 of file common.c.
References _, COB_BLD_BUILD, COB_BLD_CC, COB_BLD_CFLAGS, COB_BLD_CPPFLAGS, COB_BLD_LD, COB_BLD_LDFLAGS, COB_EXEEXT, COB_MODULE_EXT, COB_OBJECT_EXT, NULL, OC_C_VERSION, OC_C_VERSION_PRF, print_version(), var_print(), WITH_CURSES, and WITH_VARSEQ.
Referenced by process_command_line().
void print_runtime_env | ( | void | ) |
Definition at line 5234 of file common.c.
References _, __cob_settings::cob_config_file, __cob_settings::cob_config_num, COB_MEDIUM_BUFF, COB_MINI_BUFF, FUNC_NAME_IN_DEFAULT, get_config_val(), GRP_MAX, not_set, NULL, NUM_CONFIG, PACKAGE_NAME, PACKAGE_VERSION, PATCH_LEVEL, setting_group, STS_CNFSET, STS_ENVCLR, STS_ENVSET, STS_FNCSET, STS_RESET, and value.
Referenced by process_command_line().
void print_version | ( | void | ) |
Definition at line 5119 of file common.c.
References _, COB_MINI_BUFF, COB_MINI_MAX, COB_TAR_DATE, PACKAGE_NAME, PACKAGE_VERSION, and PATCH_LEVEL.
Referenced by print_info(), and process_command_line().
|
static |
Definition at line 4503 of file common.c.
References _, cob_expand_env_string(), cob_free(), conf_runtime_error(), conf_runtime_error_value(), config_tbl::data_len, config_tbl::data_loc, config_tbl::data_type, config_tbl::enums, ENV_BOOL, ENV_CHAR, ENV_ENUM, ENV_ENUMVAL, ENV_INT, ENV_NOT, ENV_PATH, ENV_SIZE, ENV_STR, config_enum::match, NULL, numval(), set_value(), and value.
Referenced by cb_config_entry(), cob_load_config(), cob_rescan_env_vals(), and set_config_val_by_name().
|
static |
Definition at line 4644 of file common.c.
References config_tbl::data_type, config_tbl::default_val, FUNC_NAME_IN_DEFAULT, NUM_CONFIG, config_tbl::set_by, set_config_val(), and STS_FNCSET.
Referenced by cob_init().
|
static |
Definition at line 1153 of file common.c.
References cob_time::offset_known, and cob_time::utc_offset.
Referenced by cob_get_current_date_and_time().
|
static |
Definition at line 4473 of file common.c.
Referenced by set_config_val().
|
static |
Definition at line 1018 of file common.c.
References COB_ASCENDING, COB_FIELD_IS_NUMERIC, cob_numeric_cmp(), common_cmps(), cob_field::data, f1, f2, cob_file_key::field, cob_field::size, sort_collate, and sort_nkeys.
Referenced by cob_table_sort().
|
static |
Definition at line 4331 of file common.c.
References _, CB_IMSG_SIZE, CB_IVAL_SIZE, cob_free(), cob_strcat(), cob_strdup(), and NULL.
Referenced by print_info().
|
static |
Definition at line 144 of file common.c.
Referenced by cob_external_addr().
|
static |
|
static |
Definition at line 127 of file common.c.
Referenced by cob_allocate(), cob_cache_free(), cob_cache_malloc(), cob_cache_realloc(), and cob_free_alloc().
|
static |
Definition at line 125 of file common.c.
Referenced by cob_accept_arg_number(), cob_accept_arg_value(), cob_accept_command_line(), cob_chain_setup(), cob_command_line(), cob_display_arg_number(), cob_init(), cob_sys_getopt_long_long(), and cob_sys_hosted().
|
static |
Definition at line 126 of file common.c.
Referenced by cob_accept_arg_value(), cob_accept_command_line(), cob_chain_setup(), cob_command_line(), cob_init(), cob_sys_getopt_long_long(), and cob_sys_hosted().
|
static |
Definition at line 152 of file common.c.
Referenced by cob_init(), cob_set_exception(), and cob_set_location().
|
static |
Definition at line 150 of file common.c.
Referenced by cob_init(), cob_set_exception(), and cob_set_location().
|
static |
Definition at line 151 of file common.c.
Referenced by cob_init(), cob_set_exception(), and cob_set_location().
|
static |
Definition at line 188 of file common.c.
Referenced by cob_get_exception_name(), and cob_set_exception().
|
static |
Definition at line 180 of file common.c.
Referenced by cob_get_exception_name().
|
static |
Definition at line 172 of file common.c.
Referenced by cob_reg_sighnd().
|
static |
Definition at line 124 of file common.c.
Referenced by cob_command_line(), cob_exit_common(), cob_get_global_ptr(), cob_init(), cob_module_enter(), cob_stop_run(), cob_terminate_routines(), and cob_tidy().
|
static |
Definition at line 128 of file common.c.
Referenced by cob_exit_common(), cob_init(), cob_set_location(), and cob_trace_section().
|
static |
Definition at line 138 of file common.c.
Referenced by cob_accept_environment(), cob_display_env_value(), cob_display_environment(), cob_exit_common(), and cob_init().
|
static |
Definition at line 142 of file common.c.
Referenced by cob_display_environment(), and cob_init().
|
static |
Definition at line 160 of file common.c.
Referenced by cob_sys_getpid().
|
static |
Definition at line 153 of file common.c.
Referenced by cob_init(), cob_load_config_file(), cob_rescan_env_vals(), cob_runtime_error(), cob_set_location(), and conf_runtime_error().
|
static |
Definition at line 156 of file common.c.
Referenced by cb_config_entry(), cob_init(), cob_load_config_file(), cob_rescan_env_vals(), cob_runtime_error(), cob_set_exception(), cob_set_location(), and conf_runtime_error().
|
static |
Definition at line 154 of file common.c.
Referenced by cob_init(), cob_set_exception(), and cob_set_location().
|
static |
Definition at line 201 of file common.c.
Referenced by cob_get_switch(), cob_init(), cob_set_switch(), and cob_sys_x91().
|
static |
Definition at line 161 of file common.c.
Referenced by cob_incr_temp_iteration(), and cob_temp_name().
|
static |
Definition at line 155 of file common.c.
Referenced by cob_check_trace_file(), cob_set_location(), cob_terminate_routines(), and cob_trace_section().
|
static |
Definition at line 130 of file common.c.
Referenced by cob_get_global_ptr(), and cob_module_enter().
|
static |
Definition at line 131 of file common.c.
Referenced by cob_get_settings_ptr().
|
static |
Definition at line 141 of file common.c.
Referenced by cob_accept_command_line(), cob_display_command_line(), and cob_init().
|
static |
Definition at line 140 of file common.c.
Referenced by cob_accept_command_line(), cob_display_command_line(), cob_exit_common(), and cob_init().
|
static |
Definition at line 163 of file common.c.
Referenced by conf_runtime_error().
|
static |
Definition at line 135 of file common.c.
Referenced by cob_allocate(), and cob_memcpy().
|
static |
Definition at line 139 of file common.c.
Referenced by cob_accept_arg_value(), cob_display_arg_number(), and cob_init().
|
static |
Referenced by cob_init(), cob_stop_run(), cob_sys_exit_proc(), and cob_tidy().
|
static |
|
static |
Referenced by cob_init(), cob_runtime_error(), and cob_sys_error_proc().
|
static |
Definition at line 165 of file common.c.
Referenced by conf_runtime_error().
|
static |
Definition at line 164 of file common.c.
Referenced by conf_runtime_error().
|
static |
|
static |
Definition at line 219 of file common.c.
Referenced by print_runtime_env().
|
static |
Definition at line 133 of file common.c.
Referenced by cob_exit_common(), cob_init(), and cob_runtime_error().
|
static |
Definition at line 215 of file common.c.
Referenced by print_runtime_env().
|
static |
Definition at line 148 of file common.c.
Referenced by cob_init(), cob_table_sort_init(), and sort_compare().
|
static |
|
static |
Definition at line 146 of file common.c.
Referenced by cob_init(), cob_table_sort_init(), cob_table_sort_init_key(), and sort_compare().
|
static |
Definition at line 158 of file common.c.
Referenced by cob_strcat().
|
static |
|
static |
|
static |
Definition at line 225 of file common.c.
Referenced by cob_load_config().
|
static |