30 #include <sys/types.h>
33 #define COB_LIB_EXPIMP
39 #define INSPECT_LEADING 1
40 #define INSPECT_FIRST 2
41 #define INSPECT_TRAILING 3
43 #define DLM_DEFAULT_NUM 8U
133 for (n = 0; n < size2; ++n, ++s) {
134 *s = f1->
data[size1];
136 if (size1 >= f1->
size) {
140 alpha_fld.
size = size2;
173 for (i = len - (
int)f2->
size; i >= 0; --i) {
177 for (j = 0; j < f2->
size; ++j) {
178 if (mark[i + j] != -1) {
184 for (j = 0; j < f2->
size; ++j) {
195 for (i = 0; i < (int)(len - f2->
size + 1); ++i) {
199 for (j = 0; j < f2->
size; ++j) {
200 if (mark[i + j] != -1) {
206 for (j = 0; j < f2->
size; ++j) {
237 inspect_var_copy = *var;
275 if (memcmp (p, str->
data, str->
size) == 0) {
288 if (memcmp (p, str->
data, str->
size) == 0) {
308 for (i = 0; i < len; ++i) {
310 mark[i] = f1->
data[0];
316 for (i = 0; i < len; ++i) {
376 for (j = 0; j < f1->
size; ++j) {
377 for (i = 0; i < len; ++i) {
410 string_dst_copy = *dst;
414 string_ptr_copy = *ptr;
434 string_dlm_copy = *dlm;
450 src_size = src->
size;
455 size = (int)(src_size - string_dlm->
size + 1);
456 for (i = 0; i < size; ++i) {
457 if (memcmp (src->
data + i, string_dlm->
data,
458 string_dlm->
size) == 0) {
489 unstring_src_copy = *src;
493 unstring_ptr_copy = *ptr;
509 if (unstring_offset < 0 || unstring_offset >= (
int)unstring_src->
size) {
529 unsigned char *dlm_data;
530 unsigned char *start;
554 srsize = (int) unstring_src->
size;
555 s = unstring_src->
data + srsize;
556 for (p = start; p < s; ++p) {
560 if (p + dlsize > s) {
563 if (!memcmp (p, dp, (
size_t)dlsize)) {
564 match_size = (int)(p - start);
570 for (p += dlsize ; p < s; p += dlsize) {
571 if (p + dlsize > s) {
574 if (memcmp (p, dp, (
size_t)dlsize)) {
663 str_cob_low.
size = 1;
static void inspect_common(cob_field *f1, cob_field *f2, const int type)
void cob_string_init(cob_field *dst, cob_field *ptr)
static size_t inspect_mark_size
void cob_free(void *mptr)
static int unstring_offset
#define COB_FIELD_IS_NUMDISP(f)
#define COB_FIELD_DATA(f)
void cob_unstring_init(cob_field *src, cob_field *ptr, const size_t num_dlm)
static void cob_str_memcpy(cob_field *dst, unsigned char *src, const int size)
static unsigned char * inspect_data
int cob_add_int(cob_field *, const int, const int)
void cob_inspect_before(const cob_field *str)
static cob_field * string_ptr
#define COB_FIELD_IS_NUMERIC(f)
void cob_move(cob_field *, cob_field *)
#define COB_TYPE_ALPHANUMERIC
static const cob_field_attr const_alpha_attr
#define COB_FIELD_TYPE(f)
static cob_field str_cob_low
void cob_unstring_finish(void)
static cob_field * inspect_var
void cob_inspect_leading(cob_field *f1, cob_field *f2)
static int unstring_count
void cob_inspect_init(cob_field *var, const cob_u32_t replacing)
void cob_inspect_characters(cob_field *f1)
void cob_string_append(cob_field *src)
static int * inspect_mark
static size_t inspect_size
int cob_get_int(cob_field *)
static cob_field inspect_var_copy
static cob_field * string_dst
void cob_unstring_tallying(cob_field *f)
void cob_string_finish(void)
void cob_string_delimited(cob_field *dlm)
static COB_INLINE int cob_min_int(const int x, const int y)
void cob_exit_strings(void)
static struct dlm_struct * dlm_list
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
static cob_field alpha_fld
static cob_field * unstring_ptr
static cob_field string_ptr_copy
int cob_get_exception_code(void)
void cob_set_exception(const int id)
static size_t dlm_list_size
static void alloc_figurative(const cob_field *f1, const cob_field *f2)
static unsigned char * inspect_end
void cob_set_int(cob_field *, const int)
#define COB_PUT_SIGN(f, s)
#define COB_TYPE_ALPHANUMERIC_ALL
void cob_inspect_finish(void)
void cob_inspect_start(void)
void cob_inspect_trailing(cob_field *f1, cob_field *f2)
static cob_field string_dst_copy
static const cob_field_attr const_strall_attr
static cob_u32_t inspect_replacing
static int unstring_ndlms
const cob_field_attr * attr
void cob_inspect_converting(const cob_field *f1, const cob_field *f2)
void cob_unstring_delimited(cob_field *dlm, const cob_u32_t all)
void * cob_malloc(const size_t size)
void cob_init_strings(void)
static unsigned char * figurative_ptr
void cob_inspect_after(const cob_field *str)
void * cob_fast_malloc(const size_t size)
static size_t figurative_size
static cob_field unstring_ptr_copy
static unsigned char * inspect_start
void cob_unstring_into(cob_field *dst, cob_field *dlm, cob_field *cnt)
static cob_field unstring_src_copy
void cob_inspect_first(cob_field *f1, cob_field *f2)
void cob_inspect_all(cob_field *f1, cob_field *f2)
static cob_field string_dlm_copy
static cob_field * unstring_src
#define COB_FIELD_SIZE(f)
static cob_field * string_dlm