⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asn_gen.h

📁 ASN.1语法解析代码
💻 H
字号:
/***
 *
 * FILE:        asn_gen.h
 * AUTHOR:     Charles W. Gardiner (gardiner@bbn.com)
 *
 * DESCRIPTION: Header file for the ASN_GEN program.
 *
 * This work is copyright (c) 1994 by Bolt Beranek and Newman, Inc. and
 * the BBN Systems and Technologies Division.
 */

/* sfcsid[] = "@(#)asn_gen.h 252P" */
#include <stdlib.h>
//#include <unistd.h>
#include <string.h>
#include <memory.h>

#define GLOBAL 0        /* states used in construct, print_hdr and tabulate */
#define IN_DEFINITION 1
#define SUB_DEFINITION 2
#define IN_ITEM       3
#define SUB_ITEM      4
#define PRE_GLOBAL   -1

#define BSIZE 128

struct tag_table
    {
    ulong tag;
    char *string, *classname, *define;
    };

struct name_table
    {
    char *name;
    long pos;
    ulong type, tag;
    long subtype;    /* used for SET/SEQ OF universal primitives to deal with
		    passthroughs */
    int flags, generation, min, max;
    struct parent
	{
	struct parent *next;
	int index,		/* of parent */
	    map_lth;
	char *mymap;		/* via this parent */
	} parent;
    };

struct id_table
    {
    char *name,
        *val;
    };

struct ub_table
    {
    char *name;
    int val;
    } *is_ub(char *);

struct name_area
    {
    char *name;
    unsigned item,       /* size of each item in area */
        chunk, 		 /* number of items to add ad each enlargement */
        limit;           /* upper limit of size -- prevent runaway */
    char *area;    /* pointer to a general name area */
    unsigned size,  /* number of items in the area */
        next;       /* index to next first free item in area */
    };

struct alt_subclass
    {
    struct alt_subclass *next;
    char name[BSIZE];
    };

extern char token[], itemname[], classname[], prevname[], path[],
    subclass[], defaultname[], numstring[], defined_by[],
    definer[], tablename[], inclass[], *source,
    asn_constr_id[], asn_gen_id[], asn_hdr_id[], asn_pproc_id[],
        asn_read_id[], asn_tabulate_id[],
    algid_w[], any_w[], application_w[], array_w[], begin_w[], choice_w[],
    components_w[], default_w[], defined_w[], definitions_w[],
    empty_w[], enumerated_w[], equals[], explicit_w[],
    from_w[], function_w[], implicit_w[], in_w[],
    null_w[], of_w[], imports_w[], *msgs[], optional_w[], prefixes[],
    size_w[], table_w[], tags_w[],
    *cat(char *, char *),
    *expand_area(struct name_area *),
    *find_child(char *),
    *find_class(ulong),
    *find_define(ulong),
    *find_typestring(ulong),
    *recalloc(char *, int, int);

extern struct tag_table tag_table[];
extern struct name_area name_area, id_area, ub_area;
extern struct alt_subclass *alt_subclassp;
extern int array, classcount, flags, min, max, option, state, explicit,
    add_child(char *, int, int, long, int),
    add_include_name(char *),
    add_name(char *, long, int),
    find_file(char *),
    find_ub(char *),
    get_token(int, char *, char),
    isreserved(char *),
    loop_test(struct name_table *, struct name_table *, int),
    putobjid(char *, int, int),
    putoct(char *, int),
    read_definition(int, int),
    read_global(int),
    read_item(int, int, void(*func)()),
    set_name_option(char *to, char *from),
    test_dup(char *, int *),
    wdcmp(char *, char *);
extern void add_ub(char *, int),
    bclr(char *, int),
    construct(int),
    do_hdr(int, int),
    end_definition(),
    end_item(),
    get_paren(int, char *, int *, int *, int),
    get_size(int, char *, int *, int *, int),
    pre_proc(int, FILE *, int),
    fatal(int, char *),
    get_expected(int, ulong, char *),
    mk_in_name(char *, char *, char *),
    syntax(char *),
    tabulate(int),
    warn(int, char *);
extern struct name_table *find_name(char *),
    *replace_name(char *);
extern ulong find_tag(char *), find_type(char *);
extern long tag, type, subtype, tablepos, real_start, curr_pos,
    get_tag(int, char *);
extern FILE *outstr, *mk_tempfile(char *, char *);
extern struct id_table *add_id(char *), *find_id(char *);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -