Lines Matching +full:mem +full:- +full:array

1 /* misc - miscellaneous flex routines */
10 /* to contract no. DE-AC03-76SF00098 between the United States */
36 #define CMD_IF_TABLES_SER "%if-tables-serialization"
37 #define CMD_TABLES_YYDMAP "%tables-yydmap"
38 #define CMD_DEFINE_YYTABLES "%define-yytables"
39 #define CMD_IF_CPP_ONLY "%if-c++-only"
40 #define CMD_IF_C_ONLY "%if-c-only"
41 #define CMD_IF_C_OR_CPP "%if-c-or-c++"
42 #define CMD_NOT_FOR_HEADER "%not-for-header"
43 #define CMD_OK_FOR_HEADER "%ok-for-header"
46 #define CMD_IF_REENTRANT "%if-reentrant"
47 #define CMD_IF_NOT_REENTRANT "%if-not-reentrant"
48 #define CMD_IF_BISON_BRIDGE "%if-bison-bridge"
49 #define CMD_IF_NOT_BISON_BRIDGE "%if-not-bison-bridge"
82 *dc = sko_stack[sko_len-1].dc; in sko_peek()
87 sko_len--; in sko_pop()
118 while (len + action_index >= action_size - 10 /* slop */ ) { in add_action()
123 * on 16-bit machines. in add_action()
140 /* allocate_array - allocate memory for an integer array of the given size */
144 void *mem; in allocate_array() local
146 /* reallocarray has built-in overflow detection */ in allocate_array()
147 mem = reallocarray(NULL, (size_t) size, element_size); in allocate_array()
150 mem = (size && SIZE_MAX / (size_t) size < element_size) ? NULL : in allocate_array()
153 if (!mem) in allocate_array()
157 return mem; in allocate_array()
161 /* all_lower - true if a string is all lower-case */
175 /* all_upper - true if a string is all upper-case */
189 /* intcmp - compares two integers for use by qsort. */
193 return *(const int *) a - *(const int *) b; in intcmp()
197 /* check_char - checks a character to make sure it's within the range
210 ("scanner requires -8 flag to use the character %s"), in check_char()
216 /* clower - replace upper-case letter to lower-case */
235 /* cclcmp - compares two characters for use by qsort with '\0' sorting last. */
243 return - 1; in cclcmp()
245 return *(const unsigned char *) a - *(const unsigned char *) b; in cclcmp()
249 /* dataend - finish up a block of data declarations */
267 /* dataflush - flush generated data statements */
290 /* flexerror - report an error message and terminate */
299 /* flexfatal - report a fatal error message and terminate */
309 /* lerr - report an error message */
323 /* lerr_fatal - as lerr, but call flexfatal */
337 /* line_directive_out - spit out a "#line" statement */
354 s3 = &filename[sizeof (filename) - 2]; in line_directive_out()
383 /* mark_defs1 - mark the current position in the action array as
396 /* mark_prolog - mark the current position in the action array as
407 /* mk2data - generate a data statement for a two-dimensional array
409 * Generates a data statement initializing the current 2-D array to "value".
435 /* mkdata - generate a data statement
437 * Generates a data statement initializing the current array element to
463 /* myctoi - return the integer represented by a string of digits */
465 int myctoi (const char *array) in myctoi() argument
469 (void) sscanf (array, "%d", &val); in myctoi()
475 /* myesc - return character corresponding to escape sequence */
477 unsigned char myesc (unsigned char array[]) in myesc() argument
481 switch (array[1]) { in myesc()
508 array[sptr] >= '0' && array[sptr] <= '7') { in myesc()
512 c = array[sptr]; in myesc()
513 array[sptr] = '\0'; in myesc()
515 esc_char = (unsigned char) strtoul (array + 1, NULL, 8); in myesc()
517 array[sptr] = c; in myesc()
526 while (sptr <= 3 && isxdigit (array[sptr])) { in myesc()
534 c = array[sptr]; in myesc()
535 array[sptr] = '\0'; in myesc()
537 esc_char = (unsigned char) strtoul (array + 2, NULL, 16); in myesc()
539 array[sptr] = c; in myesc()
545 return array[1]; in myesc()
550 /* out - various flavors of outputing a (possibly formatted) string for the
611 /* readable_form - return the the human-readable form of a character
657 /* reallocate_array - increase the size of a dynamic array */
659 void *reallocate_array (void *array, int size, size_t element_size) in reallocate_array() argument
663 /* reallocarray has built-in overflow detection */ in reallocate_array()
664 new_array = reallocarray(array, (size_t) size, element_size); in reallocate_array()
668 realloc(array, num_bytes); in reallocate_array()
671 flexfatal (_("attempt to increase array size failed")); in reallocate_array()
677 /* skelout - write out one section of the skeleton file
680 * Copies skelfile or skel array to stdout until a line beginning with
697 * one, or from the skel[] array. in skelout()
706 /* copy from skel array */ in skelout()
710 if (buf[strlen (buf) - 1] == '\\') in skelout()
717 * So we'll use emacs-style-hyphenated-commands. in skelout()
718 * We might consider a hash if this if-else-if-else in skelout()
732 out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : ""); in skelout()
739 out_str("%s\n", buf[strlen (buf) - 1] =='\\' ? "\\" : ""); in skelout()
777 /* %- only for C */ in skelout()
787 /* %c begin linkage-only (non-header) code. */ in skelout()
791 /* %e end linkage-only code. */ in skelout()
805 /* transition_struct_out - output a yy_trans_info structure
822 if (datapos >= 79 - TRANS_STRUCT_PRINT_LENGTH) { in transition_struct_out()
852 * str can be any null-terminated string, or NULL.
864 --p; in chomp()
868 *p-- = 0; in chomp()