NCBI C Toolkit Cross Reference

C/asn/general.asn


  1 --$Revision: 6.5 $
  2 --**********************************************************************
  3 --
  4 --  NCBI General Data elements
  5 --  by James Ostell, 1990
  6 --  Version 3.0 - June 1994
  7 --
  8 --**********************************************************************
  9 
 10 NCBI-General DEFINITIONS ::=
 11 BEGIN
 12 
 13 EXPORTS Date, Person-id, Object-id, Dbtag, Int-fuzz, User-object, User-field;
 14 
 15 -- StringStore is really a VisibleString.  It is used to define very
 16 --   long strings which may need to be stored by the receiving program
 17 --   in special structures, such as a ByteStore, but it's just a hint.
 18 --   AsnTool stores StringStores in ByteStore structures.
 19 -- OCTET STRINGs are also stored in ByteStores by AsnTool
 20 -- 
 21 -- typedef struct bsunit {             /* for building multiline strings */
 22    -- Nlm_Handle str;            /* the string piece */
 23    -- Nlm_Int2 len_avail,
 24        -- len;
 25    -- struct bsunit PNTR next; }       /* the next one */
 26 -- Nlm_BSUnit, PNTR Nlm_BSUnitPtr;
 27 -- 
 28 -- typedef struct bytestore {
 29    -- Nlm_Int4 seekptr,       /* current position */
 30       -- totlen,             /* total stored data length in bytes */
 31       -- chain_offset;       /* offset in ByteStore of first byte in curchain */
 32    -- Nlm_BSUnitPtr chain,       /* chain of elements */
 33       -- curchain;           /* the BSUnit containing seekptr */
 34 -- } Nlm_ByteStore, PNTR Nlm_ByteStorePtr;
 35 --
 36 -- AsnTool incorporates this as a primitive type, so the definition
 37 --   is here just for completeness
 38 -- 
 39 --  StringStore ::= [APPLICATION 1] IMPLICIT OCTET STRING
 40 --
 41 
 42 -- BigInt is really an INTEGER. It is used to warn the receiving code to expect
 43 --   a value bigger than Int4 (actually Int8). It will be stored in DataVal.bigintvalue
 44 --
 45 --   Like StringStore, AsnTool incorporates it as a primitive. The definition would be:
 46 --   BigInt ::= [APPLICATION 2] IMPLICIT INTEGER
 47 --
 48 
 49 -- Date is used to replace the (overly complex) UTCTtime, GeneralizedTime
 50 --  of ASN.1
 51 --  It stores only a date
 52 --
 53 
 54 Date ::= CHOICE {
 55     str VisibleString ,        -- for those unparsed dates
 56     std Date-std }             -- use this if you can
 57 
 58 Date-std ::= SEQUENCE {        -- NOTE: this is NOT a unix tm struct
 59     year INTEGER ,             -- full year (including 1900)
 60     month INTEGER OPTIONAL ,   -- month (1-12)
 61     day INTEGER OPTIONAL ,     -- day of month (1-31)
 62     season VisibleString OPTIONAL ,  -- for "spring", "may-june", etc
 63     hour INTEGER OPTIONAL ,    -- hour of day (0-23)
 64     minute INTEGER OPTIONAL ,  -- minute of hour (0-59)
 65     second INTEGER OPTIONAL }  -- second of minute (0-59)
 66 
 67 -- Dbtag is generalized for tagging
 68 -- eg. { "Social Security", str "023-79-8841" }
 69 -- or  { "member", id 8882224 }
 70 
 71 Dbtag ::= SEQUENCE {
 72     db VisibleString ,          -- name of database or system
 73     tag Object-id }         -- appropriate tag
 74 
 75 -- Object-id can tag or name anything
 76 --
 77 
 78 Object-id ::= CHOICE {
 79     id INTEGER ,
 80     str VisibleString }
 81 
 82 -- Person-id is to define a std element for people
 83 --
 84 
 85 Person-id ::= CHOICE {
 86     dbtag Dbtag ,               -- any defined database tag
 87     name Name-std ,             -- structured name
 88     ml VisibleString ,          -- MEDLINE name (semi-structured)
 89                                 --    eg. "Jones RM"
 90     str VisibleString,          -- unstructured name
 91     consortium VisibleString }  -- consortium name
 92 
 93 Name-std ::= SEQUENCE { -- Structured names
 94     last VisibleString ,
 95     first VisibleString OPTIONAL ,
 96     middle VisibleString OPTIONAL ,
 97     full VisibleString OPTIONAL ,    -- full name eg. "J. John Smith, Esq"
 98     initials VisibleString OPTIONAL,  -- first + middle initials
 99     suffix VisibleString OPTIONAL ,   -- Jr, Sr, III
100     title VisibleString OPTIONAL }    -- Dr., Sister, etc
101 
102 --**** Int-fuzz **********************************************
103 --*
104 --*   uncertainties in integer values
105 
106 Int-fuzz ::= CHOICE {
107     p-m INTEGER ,                    -- plus or minus fixed amount
108     range SEQUENCE {                 -- max to min
109         max INTEGER ,
110         min INTEGER } ,
111     pct INTEGER ,                    -- % plus or minus (x10) 0-1000
112     lim ENUMERATED {                 -- some limit value
113         unk (0) ,                    -- unknown
114         gt (1) ,                     -- greater than
115         lt (2) ,                     -- less than
116         tr (3) ,                     -- space to right of position
117         tl (4) ,                     -- space to left of position
118         circle (5) ,                 -- artificial break at origin of circle
119         other (255) } ,              -- something else
120     alt SET OF INTEGER }             -- set of alternatives for the integer
121 
122 
123 --**** User-object **********************************************
124 --*
125 --*   a general object for a user defined structured data item
126 --*    used by Seq-feat and Seq-descr
127 
128 User-object ::= SEQUENCE {
129     class VisibleString OPTIONAL ,   -- endeavor which designed this object
130     type Object-id ,                 -- type of object within class
131     data SEQUENCE OF User-field }    -- the object itself
132 
133 User-field ::= SEQUENCE {
134     label Object-id ,                -- field label
135     num INTEGER OPTIONAL ,           -- required for strs, ints, reals, oss
136     data CHOICE {                    -- field contents
137         str VisibleString ,
138         int INTEGER ,
139         real REAL ,
140         bool BOOLEAN ,
141         os OCTET STRING ,
142         object User-object ,         -- for using other definitions
143         strs SEQUENCE OF VisibleString ,
144         ints SEQUENCE OF INTEGER ,
145         reals SEQUENCE OF REAL ,
146         oss SEQUENCE OF OCTET STRING ,
147         fields SEQUENCE OF User-field ,
148         objects SEQUENCE OF User-object } }
149 
150 
151 
152 END
153 

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.