Annotation of coherent/f/etc/conf/bin/src/read.h, revision 1.1.1.1

1.1       root        1: #ifndef        READ_H
                      2: #define        READ_H
                      3: 
                      4: /*
                      5:  *-IMPORTS:
                      6:  *     <sys/compat.h>
                      7:  *             CONST
                      8:  *             EXTERN_C_BEGIN
                      9:  *             EXTERN_C_END
                     10:  *             PROTO ()
                     11:  */
                     12: 
                     13: #include <sys/compat.h>
                     14: 
                     15: 
                     16: /*
                     17:  * Structure of an input source.
                     18:  */
                     19: 
                     20: #ifndef        INPUT_T
                     21: #define        INPUT_T
                     22: typedef struct input   input_t;
                     23: #endif
                     24: 
                     25: #ifndef        BUILD_T
                     26: #define        BUILD_T
                     27: typedef        struct builder  build_t;
                     28: #endif
                     29: 
                     30: #ifndef        LEX_T
                     31: #define        LEX_T
                     32: typedef        struct lexinfo  lex_t;
                     33: #endif
                     34: 
                     35: #ifndef        TOKEN_T
                     36: #define        TOKEN_T
                     37: typedef struct token   token_t;
                     38: #endif
                     39: 
                     40: 
                     41: /*
                     42:  * Structure of a token returned by read_token (), which reflects the method
                     43:  * used to parse the token. In order to reduce data copying, we permit input
                     44:  * sources to provide a way of getting a token into memory without using the
                     45:  * object-builder system (since for sources such as strings, that involves
                     46:  * a large amount of totally unnecessary work).
                     47:  *
                     48:  * If "tok_heap" is not NULL, then it points to a build heap where the data
                     49:  * for the token was copied as it was read. If is it NULL, then "tok_data" and
                     50:  * "tok_len" may point to token data, or may be NULL and 0 respectively to
                     51:  * indicate that no token was read.
                     52:  */
                     53: 
                     54: struct token {
                     55:        CONST unsigned char *
                     56:                        tok_data;
                     57:        size_t          tok_len;
                     58:        build_t       * tok_heap;
                     59: };
                     60: 
                     61: 
                     62: /*
                     63:  * EOF value returned by the functions defined here; must be the same value as
                     64:  * IN_EOF, since typically we just return values from the in... () functions.
                     65:  */
                     66: 
                     67: enum {
                     68:        READ_EOF        = -1
                     69: };
                     70: 
                     71: 
                     72: /*
                     73:  * Flags for numeric input
                     74:  */
                     75: 
                     76: enum {
                     77:        UNSIGNED        = 0,
                     78:        SIGNED          = 1
                     79: };
                     80: 
                     81: 
                     82: /*
                     83:  * For determining whether read_ints () is allowed to read a range or not.
                     84:  */
                     85: 
                     86: enum {
                     87:        NO_RANGE        = 0,
                     88:        RANGE           = 1
                     89: };
                     90: 
                     91: 
                     92: EXTERN_C_BEGIN
                     93: 
                     94: int            read_char       PROTO ((input_t * _input));
                     95: void           unread_char     PROTO ((input_t * _input));
                     96: void           read_error      PROTO ((input_t * _input));
                     97: void           read_close      PROTO ((input_t * _input));
                     98: 
                     99: int            read_long       PROTO ((input_t * _input, long * _longp,
                    100:                                        int _radix));
                    101: int            read_ulong      PROTO ((input_t * _input,
                    102:                                        unsigned long * _ulongp, int _radix));
                    103: 
                    104: void           read_flush      PROTO ((input_t * _input, lex_t * _lexp));
                    105: 
                    106: int            read_token      PROTO ((input_t * _input, lex_t * _lexp,
                    107:                                        build_t * _heap, token_t * _tok));
                    108: 
                    109: void           token_discard   PROTO ((token_t * _tok));
                    110: void           token_end       PROTO ((token_t * _tok));
                    111: void           token_copy      PROTO ((token_t * _tok, build_t * _heap));
                    112: 
                    113: void           check_not_eol   PROTO ((int _ch));
                    114: int            expect_eol      PROTO ((input_t * _input, lex_t * _lexp,
                    115:                                        int _ch));
                    116: 
                    117: int            read_ulongs     PROTO ((input_t * _input, lex_t * _lexp,
                    118:                                        unsigned long * _numbers,
                    119:                                        int _rangeflag));
                    120: int            read_longs      PROTO ((input_t * _input, lex_t * _lexp,
                    121:                                        long * _numbers, int _rangeflag));
                    122: int            read_ints       PROTO ((input_t * _input, lex_t * _lexp,
                    123:                                        int * _numbers, int _rangeflag));
                    124: int            read_uints      PROTO ((input_t * _input, lex_t * _lexp,
                    125:                                        unsigned int * _numbers,
                    126:                                        int _rangeflag));
                    127: 
                    128: EXTERN_C_END
                    129: 
                    130: 
                    131: #endif /* ! defined (READ_H) */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.