NCBI C Toolkit Cross Reference

C/asnlib/asntypes.h


  1 /* asntypes.h
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *               National Center for Biotechnology Information
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's official duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government have not placed any restriction on its use or reproduction.
 13 *
 14 *  Although all reasonable efforts have been taken to ensure the accuracy
 15 *  and reliability of the software and data, the NLM and the U.S.
 16 *  Government do not and cannot warrant the performance or results that
 17 *  may be obtained by using this software or data. The NLM and the U.S.
 18 *  Government disclaim all warranties, express or implied, including
 19 *  warranties of performance, merchantability or fitness for any particular
 20 *  purpose.
 21 *
 22 *  Please cite the author in any work or product based on this material.
 23 *
 24 * ===========================================================================
 25 *
 26 * File Name: asntypes.h
 27 *
 28 * Author:  James Ostell
 29 *
 30 * Version Creation Date: 1/1/91
 31 *
 32 * $Revision: 6.2 $
 33 *
 34 * File Description:
 35 *   typedefs and prototypes for routines used internally by asntypes.c
 36 *
 37 * Modifications:
 38 * --------------------------------------------------------------------------
 39 * Date     Name        Description of modification
 40 * -------  ----------  -----------------------------------------------------
 41 *
 42 *
 43 * $Log: asntypes.h,v $
 44 * Revision 6.2  2000/12/12 15:56:14  ostell
 45 * added support BigInt
 46 *
 47 * Revision 6.1  1997/12/16 14:51:54  kans
 48 * header needed for asntool/asncode merge
 49 *
 50 * Revision 6.0  1997/08/25 18:10:27  madden
 51 * Revision changed to 6.0
 52 *
 53 * Revision 5.1  1996/12/03 21:43:48  vakatov
 54 * Adopted for 32-bit MS-Windows DLLs
 55 *
 56  * Revision 5.0  1996/05/28  14:00:29  ostell
 57  * Set to revision 5.0
 58  *
 59  * Revision 4.0  1995/07/26  13:47:38  ostell
 60  * force revision to 4.0
 61  *
 62  * Revision 2.4  1995/05/15  18:38:28  ostell
 63  * added Log line
 64  *
 65 *
 66 * ==========================================================================
 67 */
 68 
 69 #ifndef _ASNTYPES_
 70 #define _ASNTYPES_
 71 
 72 #undef NLM_EXTERN
 73 #ifdef NLM_IMPORT
 74 #define NLM_EXTERN NLM_IMPORT
 75 #else
 76 #define NLM_EXTERN extern
 77 #endif
 78 
 79 
 80         /*************************************************************************
 81         *
 82         *   tokens returned by AsnLexWord()
 83         *       superset returned by AsnLexTWord()
 84         *       301 - 350  are reserved for asn1 primitive types and map
 85         *                       to isa values
 86         *       351 - 400  are reserved for application specific tags and
 87         *               map to isa values
 88         *       401 - 500  are used for symbols and other reserved words
 89         *          a superset which includes ASN.1 additional reserved words
 90         *            for parsing syntax specifications are in asnlext.h
 91         *       AsnLexTMatchToken()  depends on the order of these defines and
 92         *               the strings in asnwords[]
 93         *
 94         *************************************************************************/
 95 
 96 
 97 #define EOF_TOKEN               401             /* End of file */
 98 #define ERROR_TOKEN     402             /* read error */
 99 #define START_STRING    403             /* found " string starts */
100 #define IN_STRING               404             /* found piece of string */
101 #define END_STRING              405             /* end of string found */
102 #define START_BITHEX    406             /* found ' bit or hex string starts */
103 #define IN_BITHEX               407             /* found piece of bit or hex string */
104 #define OCTETS                  408             /* bit or hex ends, was a hex string */
105 #define ASNBITS                 409             /* bit or hex ends, was a bit string */
106 #define COMMA                   410             /* , found */
107 #define OPEN_PAREN              413             /* ( found */
108 #define CLOSE_PAREN     414             /* ) found */
109 #define START_TAG               415             /* [ found */
110 #define END_TAG                 416             /* ] found */
111 #define ISDEF                   417             /* ::= found */
112 #define REF                             418             /* typereference (not ASN reserved word) */
113 #define IDENT                   419             /* identifier found (could be valuereference)*/
114 #define NUMBER                  420             /* number found */
115 #define SEMI_COLON              421             /* ; found */
116 
117                 /***** is token a predefined ASN.1 type ************/
118 #define ISA_ASNTYPE(x)  (((x) >= 301) && ((x) <= 350))
119             /***** is token a basic (end of chain) type ********/
120 #define ISA_BASETYPE(x)  (((x) >= 301) && ((x) <= 400))
121 
122 #define ISA_TAGCLASS(x)  (((x) >= 431) && ((x) <= 433))
123 
124 #define TAG_UNIVERSAL   0              /* for bits 7-8 = 00 */
125 #define TAG_APPLICATION 64                         /*                01 */
126 #define TAG_PRIVATE     192                        /*                11 */
127 #define TAG_CONTEXT     128                        /*                10 */
128 #define TAG_NONE                1              /* has no tag */
129 
130 #define TAG_BOOLEAN                             1               /* ASN.1 Universal tags */
131 #define TAG_INTEGER                             2
132 #define TAG_BIT_STRING                  3
133 #define TAG_OCTET_STRING                4
134 #define TAG_NULL                                5
135 #define TAG_OBJECT_IDENT                6
136 #define TAG_OBJECT_DESCR                7
137 #define TAG_EXTERNAL                    8
138 #define TAG_REAL                                9
139 #define TAG_ENUM                                10
140 #define TAG_SEQ                                 16              /* SEQ and SEQOF */
141 #define TAG_SET                                 17              /* SET and SETOF */
142 #define TAG_NUMERICSTRING               18
143 #define TAG_PRINTABLESTRING             19
144 #define TAG_TELETEXSTRING               20
145 #define TAG_VIDEOTEXSTRING              21
146 #define TAG_IA5STRING                   22
147 #define TAG_UTCTIME                             23
148 #define TAG_GENERALIZEDTIME             24
149 #define TAG_GRAPHICSSTRING              25
150 #define TAG_VISIBLESTRING               26
151 #define TAG_GENERALSTRING               27
152 #define TAG_CHARACTERSTRING             28
153 
154 #define TAG_STRSTORE                    1
155 
156         /* values for valueisa */
157 #define VALUE_ISA_PTR   1
158 #define VALUE_ISA_BOOL  2
159 #define VALUE_ISA_INT   3
160 #define VALUE_ISA_REAL  4
161 #define VALUE_ISA_DEFAULT(x)    (((x) >= VALUE_ISA_PTR) && ((x) <= VALUE_ISA_REAL))
162 #define VALUE_ISA_SUBTYPE       10              /* subtype chain */
163 #define VALUE_ISA_NAMED_INT 20          /* named int chain */
164 #define VALUE_ISA_BIGINT 5
165 
166 /*--
167  *
168  * Expanded to full AsnTypePtr for ease of integrating asncode into asntool.
169  *    so this new definition is not even needed, but will make equivalent
170  *    to AsnType, for safety.
171  *
172  *       -   Karl Sirotkin
173 OLD WAY:
174 typedef struct asnprimtype {
175         Int2 isa;
176         CharPtr name;
177         Uint1 tagclass;
178         Int2 tagnumber;
179 }       AsnPrimType, PNTR AsnPrimTypePtr;
180 ----------------------------------------------------*/
181 
182 typedef AsnType AsnPrimType  , PNTR AsnPrimTypePtr;
183 
184 
185 /*****************************************************************************
186 *
187 *   prototypes
188 *       AsnFindBaseType()
189 *       AsnTypeFind()
190 *       AsnFindPrimName()
191 *       AsnKillValue() prototyped in asngen.h
192 *
193 *****************************************************************************/
194 NLM_EXTERN void AsnTypeSetIndent PROTO((Boolean increase, AsnIoPtr aip, AsnTypePtr atp));
195 NLM_EXTERN Boolean AsnTypeValidateOut PROTO((AsnIoPtr aip, AsnTypePtr atp, DataValPtr dvp));
196 NLM_EXTERN AsnTypePtr AsnTypeFindType PROTO((AsnTypePtr atp, CharPtr str, AsnTypePtr PNTR typeptr, Int2 count, Boolean in_it));
197 
198 
199 #undef NLM_EXTERN
200 #ifdef NLM_EXPORT
201 #define NLM_EXTERN NLM_EXPORT
202 #else
203 #define NLM_EXTERN
204 #endif
205 
206 #endif
207 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.