File: do-macros.c

package info (click to toggle)
esnacc 1.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 4,452 kB
  • sloc: ansic: 42,340; cpp: 13,880; yacc: 2,682; tcl: 1,587; lex: 688; sh: 573; makefile: 111
file content (861 lines) | stat: -rw-r--r-- 23,100 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
/*
 * compiler/core/do_macros.c
 *
 * Runs through type and value def lists and does any processing nec.
 * for any macro encountered.
 *
 * Processing could consist of making stubs for OPERATION macro etc.
 * What is done is very environment dependent.
 *
 * You should change this file to match your environment.
 *
 * Any Type Defs hidden in a MACRO Type are popped into the normal
 * type def list and REFERENCED from the macro (instead of being
 * defined there)
 *
 * SNMP Objectype macro fills the ANY Ref lists so the id to ANY
 * type hash table is filled.
 *
 * Mike Sample
 * 91/12/12
 *
 * Copyright (C) 1991, 1992 Michael Sample
 *            and the University of British Columbia
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * $Header: /baseline/SNACC/compiler/core/do-macros.c,v 1.9 2003/07/18 18:13:02 nicholar Exp $
 * $Log: do-macros.c,v $
 * Revision 1.9  2003/07/18 18:13:02  nicholar
 * Removed most of Deepak's changes
 *
 * Revision 1.8  2003/07/07 14:50:13  nicholar
 * Eliminated headers and cleaned up include references
 *
 * Revision 1.7  2003/04/29 21:09:35  leonberp
 * integerated Deepak's changes for IOB support
 *
 * Revision 1.6  2002/09/17 10:47:14  mcphersc
 * Fixed warnings
 *
 * Revision 1.5  2002/09/16 16:49:17  mcphersc
 * Fixed warnings
 *
 * Revision 1.4  2002/09/04 18:23:07  vracarl
 * got rid of c++ comments
 *
 * Revision 1.3  2002/02/28 19:45:23  nicholar
 * Added calls to Dash2Underscore() to remove dashes in ANYs.
 *
 * Revision 1.2  2000/10/24 14:54:51  rwc
 * Updated to remove high-level warnings (level 4 on MSVC++) for an easier build.
 * SOME warnings persist due to difficulty in modifying the SNACC compiler to
 * properly build clean source; also some files are built by Lex/Yacc.
 *
 * Revision 1.1.1.1  2000/08/21 20:35:59  leonberp
 * First CVS Version of SNACC.
 *
 * Revision 1.3  1995/07/25 19:41:23  rj
 * changed `_' to `-' in file names.
 *
 * Revision 1.2  1994/09/01  00:32:28  rj
 * snacc_config.h removed; do_macros.h includet.
 *
 * Revision 1.1  1994/08/28  09:49:03  rj
 * first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
 *
 */

#include <string.h>
#include <ctype.h>		/* for islower() */
#include "asn-incl.h"
#include "asn1module.h"
#include "str-util.h"
#include "snacc-util.h"
#include "lib-types.h"

/* Function Prototypes */
void AddAnyRefByOid PROTO ((AnyRefList **arl, char *enumIdName, AsnOid *oid));
void AddAnyRefByInt PROTO ((AnyRefList **arl, char *enumIdName, AsnInt intId));
void NormalizeValue PROTO ((Module *m, ValueDef *vd, Value *v, int quiet));
void ProcessMacrosInTypeDef PROTO ((Module *m, TypeDef *td));
void ProcessMacrosInValueDef PROTO ((Module *m, ValueDef *vd));
void ProcessMacrosInType PROTO ((Module *m, TypeDef *td, Type *t,
								ValueDef *v));
void ProcessMacrosInElmtTypes PROTO ((Module *m, TypeDef *td, NamedTypeList *e,
									 ValueDef *v));
void ProcessMacrosInBasicType PROTO ((Module  *m, TypeDef *td, Type *type,
									 BasicType *bt, ValueDef *v));
void DefineType PROTO ((Module *m, TypeDef *td, Type *t, char *name));
void ProcessRosOperationMacroType PROTO ((Module *m, TypeDef *td, Type *t,
										 BasicType *bt, RosOperationMacroType *op, ValueDef *v));
void ProcessRosErrorMacroType PROTO ((Module *m, TypeDef *td, Type *t,
									 BasicType *bt, RosErrorMacroType *err,
									 ValueDef *v));
void ProcessRosBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
									BasicType *bt, RosBindMacroType *bind,
									ValueDef *v));
void ProcessRosAseMacroType PROTO ((Module *m, TypeDef *td, Type *t,
								   BasicType *bt, RosAseMacroType *ase,
								   ValueDef *v));
void ProcessRosAcMacroType PROTO ((Module *m, TypeDef *td, Type *t,
								  BasicType *bt, RosAcMacroType *ac,
								  ValueDef *v));
void ProcessMtsasExtensionsMacroType PROTO ((Module *m, TypeDef *td, Type *t,
											BasicType *bt,
											MtsasExtensionsMacroType *exts,
											ValueDef *v));
void ProcessMtsasExtensionMacroType PROTO ((Module *m, TypeDef *td, Type *t,
										   BasicType *bt,
										   MtsasExtensionMacroType *ext,
										   ValueDef *v));
void ProcessMtsasExtensionAttributeMacroType PROTO ((Module *m, TypeDef *td,
													Type *t, BasicType *bt,
													MtsasExtensionAttributeMacroType *ext,
													ValueDef *v));
void ProcessMtsasTokenMacroType PROTO ((Module *m, TypeDef *td, Type *t,
									   BasicType *bt, MtsasTokenMacroType *tok,
									   ValueDef *v));
void ProcessMtsasTokenDataMacroType PROTO ((Module *m, TypeDef *td, Type *t,
										   BasicType *bt,
										   MtsasTokenDataMacroType *tok,
										   ValueDef *v));
void ProcessMtsasSecurityCategoryMacroType PROTO ((Module *m, TypeDef *td,
												  Type *t, BasicType *bt,
												  MtsasSecurityCategoryMacroType *sec,
												  ValueDef *v));
void ProcessAsnObjectMacroType PROTO ((Module *m, TypeDef *td, Type *t,
									  BasicType *bt, AsnObjectMacroType *obj,
									  ValueDef *v));
void ProcessAsnPortMacroType PROTO ((Module *m, TypeDef *td, Type *t,
									BasicType *bt, AsnPortMacroType *p,
									ValueDef *v));
void ProcessAsnAbstractBindMacroType PROTO ((Module *m, TypeDef *td, Type *t,
											BasicType *bt,
											AsnAbstractBindMacroType *bind,
											ValueDef *v));
void ProcessSnmpObjectTypeMacroType PROTO ((Module *m, TypeDef *td, Type *t,
										   BasicType *bt,
										   SnmpObjectTypeMacroType *bind,
										   ValueDef *v));


/*
static TypeDef  *snmpObjectSyntaxesG = NULL;
*/

/*
 * Hunts for macros in TypeDefs or ValueDefs and
 * might do something with them.
 */
void
ProcessMacros PARAMS ((m),
    Module *m)
{
    TypeDef *td;
    ValueDef *vd;

    /*
     * go through each type in typeList
     */
    FOR_EACH_LIST_ELMT (td, m->typeDefs)
    {
        ProcessMacrosInTypeDef (m, td);
    }

    /*
     *  go through each value in valueList and link
     */
    FOR_EACH_LIST_ELMT (vd, m->valueDefs)
    {
        ProcessMacrosInValueDef (m, vd);
    }

    /* add snmp object syntaxes choice to typedef list */
/*
    tmpTypeDefHndl = (TypeDef**) AsnListAppend (m->typeDefs);
    *tmpTypeDefHndl =  snmpObjectSyntaxesG;
    snmpObjectSyntaxesG = NULL;
*/


}   /* ProcessMacros */

/*
 * Given an AnyRefList, char string for an enum Id,
 *  and an OBJECT IDENTIFIER,
 * this routine puts the id and oid into the AnyRefList.
 * When the code is generated, the AnyInit routine for
 * the module to which the typeDef that owns the given AnyRefList
 * belongs, calls a routine that will cause the given oid to
 * hash to the TypeDef that owns the AnyRefList.
 * The enumId value at runtime is used for simple determination of
 * the ANY type by the user.
 */
void
AddAnyRefByOid PARAMS ((arl, enumId, oid),
    AnyRefList **arl _AND_
    char *enumId _AND_
    AsnOid *oid)
{
    AnyRef **anyRefHndl;

    if (*arl == NULL)
        *arl = AsnListNew (sizeof (void*));

    anyRefHndl = (AnyRef**)AsnListAppend (*arl);
    *anyRefHndl = MT (AnyRef);

    (*anyRefHndl)->anyIdName = Malloc (strlen (enumId)+1);
    strcpy ((*anyRefHndl)->anyIdName, enumId);

    (*anyRefHndl)->id = MT (OidOrInt);
    (*anyRefHndl)->id->choiceId = OIDORINT_OID;
    (*anyRefHndl)->id->a.oid = MT (AsnOid);
    (*anyRefHndl)->id->a.oid->octs = Malloc (oid->octetLen);
    memcpy ((*anyRefHndl)->id->a.oid->octs, oid->octs, oid->octetLen);
    (*anyRefHndl)->id->a.oid->octetLen =  oid->octetLen;

} /* AddAnyRefByOid */

/*
 * Like AddAnyRefByOid except that an int maps to the type def
 * instead of an OBJECT IDENTIFIER
 */
void
AddAnyRefByInt PARAMS ((arl, enumId, intId),
    AnyRefList **arl _AND_
    char *enumId _AND_
    AsnInt intId)
{
    AnyRef **anyRefHndl;

    if (*arl == NULL)
        *arl = AsnListNew (sizeof (void*));

    anyRefHndl = (AnyRef**)AsnListAppend (*arl);
    *anyRefHndl = MT (AnyRef);

    (*anyRefHndl)->anyIdName = Malloc (strlen (enumId)+1);
    strcpy ((*anyRefHndl)->anyIdName, enumId);
    (*anyRefHndl)->id = MT (OidOrInt);
    (*anyRefHndl)->id->choiceId = OIDORINT_INTID;
    (*anyRefHndl)->id->a.intId = intId;

} /* AddAnyRefByInt */


void
ProcessMacrosInValueDef PARAMS ((m, vd),
    Module *m _AND_
    ValueDef *vd)
{
   if (vd == NULL)
       return;

   /* turn linked oid's into encoded oids */
    if (vd->value->basicValue->choiceId == BASICVALUE_LINKEDOID)
        NormalizeValue (m, vd, vd->value, FALSE);

   ProcessMacrosInType (m, NULL, vd->value->type, vd);

} /* ProcessMacrosInValueDef */



void
ProcessMacrosInTypeDef PARAMS ((m,td),
    Module *m _AND_
    TypeDef *td)
{
   if (td == NULL)
       return;

   ProcessMacrosInType (m, td, td->type, NULL);	

} /* ProcessMacrosInTypeDef */



void
ProcessMacrosInType PARAMS ((m, td,t, v),
	Module *m _AND_
	TypeDef *td _AND_
	Type *t _AND_
	ValueDef *v)
{
	if (t == NULL)
		return;

	ProcessMacrosInBasicType (m, td, t, t->basicType, v);

} /* ProcessMacrosInTypeDef */



void
ProcessMacrosInElmtTypes PARAMS ((m, td, e, v),
    Module *m _AND_
    TypeDef *td _AND_
    NamedTypeList *e _AND_
    ValueDef *v)
{
    NamedType *nt;
    FOR_EACH_LIST_ELMT (nt, e)
    {
        ProcessMacrosInType (m, td, nt->type, v);
    }
}  /* ProcessElmtTypes */



void
ProcessMacrosInBasicType PARAMS ((m,td,type,bt, v),
    Module  *m _AND_
    TypeDef *td _AND_
    Type *type _AND_
    BasicType *bt _AND_
    ValueDef *v)
{

    if (bt == NULL)
        return;

    switch (bt->choiceId)
    {
        case BASICTYPE_SEQUENCE:
        case BASICTYPE_SET:
        case BASICTYPE_CHOICE:
            ProcessMacrosInElmtTypes (m, td, bt->a.set,v);
            break;



        case BASICTYPE_SEQUENCEOF:
        case BASICTYPE_SETOF:
            ProcessMacrosInType (m, td, bt->a.setOf, v);
            break;



        case BASICTYPE_MACROTYPE:
            switch (bt->a.macroType->choiceId)
            {
        case MACROTYPE_ASNABSTRACTOPERATION:
        case MACROTYPE_ROSOPERATION:

            ProcessRosOperationMacroType (m, td, type, bt, bt->a.macroType->a.rosOperation, v);
            break;

        case MACROTYPE_ROSERROR:
        case MACROTYPE_ASNABSTRACTERROR:
            ProcessRosErrorMacroType (m, td, type, bt, bt->a.macroType->a.rosError, v);
             break;

        case MACROTYPE_ROSBIND:
        case MACROTYPE_ROSUNBIND:
            ProcessRosBindMacroType (m, td, type, bt, bt->a.macroType->a.rosBind,v);
             break;

        case MACROTYPE_ROSASE:
            ProcessRosAseMacroType (m, td, type, bt, bt->a.macroType->a.rosAse,v);
             break;

        case MACROTYPE_MTSASEXTENSIONS:
            ProcessMtsasExtensionsMacroType (m, td, type, bt, bt->a.macroType->a.mtsasExtensions,v);
            break;

        case MACROTYPE_MTSASEXTENSION:
            ProcessMtsasExtensionMacroType (m, td, type, bt, bt->a.macroType->a.mtsasExtension,v);
            break;

        case MACROTYPE_MTSASEXTENSIONATTRIBUTE:
            ProcessMtsasExtensionAttributeMacroType (m, td, type, bt, bt->a.macroType->a.mtsasExtensionAttribute,v);
            break;

        case MACROTYPE_MTSASTOKEN:
            ProcessMtsasTokenMacroType (m, td, type, bt, bt->a.macroType->a.mtsasToken,v);
            break;

        case MACROTYPE_MTSASTOKENDATA:
            ProcessMtsasTokenDataMacroType (m, td, type, bt, bt->a.macroType->a.mtsasTokenData,v);
            break;

        case MACROTYPE_MTSASSECURITYCATEGORY:
            ProcessMtsasSecurityCategoryMacroType (m, td, type, bt, bt->a.macroType->a.mtsasSecurityCategory,v);
            break;

        case MACROTYPE_ASNOBJECT:
            ProcessAsnObjectMacroType (m, td, type, bt, bt->a.macroType->a.asnObject,v);
            break;

        case MACROTYPE_ASNPORT:
            ProcessAsnPortMacroType (m, td, type, bt, bt->a.macroType->a.asnPort,v);
            break;

        case MACROTYPE_ASNABSTRACTBIND:
        case MACROTYPE_ASNABSTRACTUNBIND:
            ProcessAsnAbstractBindMacroType (m, td, type, bt, bt->a.macroType->a.asnAbstractBind,v);
            break;

        case MACROTYPE_AFALGORITHM:
        case MACROTYPE_AFENCRYPTED:
        case MACROTYPE_AFPROTECTED:
        case MACROTYPE_AFSIGNATURE:
        case MACROTYPE_AFSIGNED:
            break;

        case MACROTYPE_SNMPOBJECTTYPE:
            ProcessSnmpObjectTypeMacroType (m, td, type, bt, bt->a.macroType->a.snmpObjectType,v);
            break;

        default:
           /* ignore any others */
        break;
    }

        default:
          /* the rest do not need processing */

        break;
    }
}  /* ProcessMacrosInBasicType */


/*
 * Given a Type referenced in a macro, makes up a name and defines
 * the type iff the type is not a simple type ref or library type.
 * Returns the typedef of the type given type. (may be new may
 * be from the typeref if t was a local or import type ref)
 */
void
DefineType PARAMS ((m, td, t, name),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    char *name)
{
   int digit;
   TypeDef *newDef;
   TypeDef **tmpTypeDefHndl;
   Type *tmpType;

   if (IsNewType (t))
   {
       newDef = (TypeDef*)Malloc (sizeof (TypeDef));
       newDef->exported = FALSE;
       newDef->type = (Type*)Malloc (sizeof (Type));
       memcpy (newDef->type, t, sizeof (Type));

	   newDef->definedName = Malloc (strlen (name) + 4);
       strcpy (newDef->definedName, name);

       if (islower (newDef->definedName[0]))
           newDef->definedName[0] =
               (char)toupper (newDef->definedName[0]);


       /* set up unique type name for new type */
       for (digit = 0;
           (LookupType (m->typeDefs, newDef->definedName) != NULL);
           digit++)
           AppendDigit (newDef->definedName, digit);

       /*
        * now put new typedef  at head of list
        */
       tmpTypeDefHndl = (TypeDef**)AsnListPrepend (m->typeDefs);
       *tmpTypeDefHndl = newDef;

       /* convert macro's type def into a ref */

       SetupType (&tmpType, BASICTYPE_LOCALTYPEREF, 0);
       memcpy (t, tmpType, sizeof (Type));
       Free (tmpType);
       t->implicit = FALSE;
       t->basicType->a.localTypeRef = (TypeRef*)Malloc (sizeof (TypeRef));
       t->basicType->a.localTypeRef->link = newDef;
       t->basicType->a.localTypeRef->module = m;
       t->basicType->a.localTypeRef->typeName = newDef->definedName;
       td = td;    /*AVOIDS compiler warning.*/

    }
} /* DefineType */


void
ProcessRosOperationMacroType PARAMS ((m, td, t, bt, op, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    RosOperationMacroType *op _AND_
    ValueDef *v)
{
	if (v == NULL)
		return;

    if (op->arguments != NULL)
        DefineType (m, td, op->arguments->type, v->definedName);

    if (op->result != NULL)
        DefineType (m, td, op->result->type, v->definedName);
    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
}  /* ProcessRosOperationMacroType */



void
ProcessRosErrorMacroType PARAMS ((m, td, t, bt, err, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    RosErrorMacroType *err _AND_
    ValueDef *v)
{
	if (v == NULL)
		return;

    if ((err != NULL) && (err->parameter != NULL))
        DefineType (m, td, err->parameter->type, v->definedName);

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
}   /* ProcessRosErrorMacroType */


void
ProcessRosBindMacroType PARAMS ((m, td, t, bt, bind, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    RosBindMacroType *bind _AND_
    ValueDef *v)
{
	if (v == NULL)
		return;

    if (bind != NULL)
    {
        DefineType (m, td, bind->argument->type, v->definedName);
        DefineType (m, td, bind->result->type, v->definedName);
        DefineType (m, td, bind->error->type, v->definedName);
    }
    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
}   /* ProcessRosBindMacroType */


void
ProcessRosAseMacroType PARAMS ((m, td, t, bt, ase, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    RosAseMacroType *ase _AND_
    ValueDef *v)
{
    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    ase = ase;
    v = v;     /*AVOIDS compiler warning.*/
}  /* ProcessRosAseMacroType */



void
ProcessRosAcMacroType PARAMS ((m, td, t, bt, ac, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    RosAcMacroType *ac  _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    v = v;
    ac = ac;
    td = td;
    m = m;
}  /* ProcessRosAcMacroType */



void
ProcessMtsasExtensionsMacroType PARAMS ((m, td, t, bt, exts, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasExtensionsMacroType *exts _AND_
    ValueDef *v)
{
    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    exts = exts;
    v = v;     /*AVOIDS compiler warning.*/
}  /* ProcessMtsasExtensionsMacroType */


void
ProcessMtsasExtensionMacroType PARAMS ((m, td, t, bt, ext, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasExtensionMacroType *ext _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    ext = ext;
}  /* ProcessMtsasExtensionMacroType */


void
ProcessMtsasExtensionAttributeMacroType PARAMS ((m, td, t, bt, ext, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasExtensionAttributeMacroType *ext _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    ext = ext;
}  /* ProcessMtsasExtensionAttributeMacroType */


void
ProcessMtsasTokenMacroType PARAMS ((m, td, t, bt, tok, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasTokenMacroType *tok _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    tok = tok;
}  /* ProcessMtsasTokenMacroType */


void
ProcessMtsasTokenDataMacroType PARAMS ((m, td, t, bt, tok, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasTokenDataMacroType *tok _AND_
    ValueDef *v)
{


    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    tok = tok;
}  /* ProcessMtsasTokenDataMacroType */


void
ProcessMtsasSecurityCategoryMacroType PARAMS ((m, td, t, bt, sec, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    MtsasSecurityCategoryMacroType *sec _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    sec = sec;
}  /* ProcessMtsasSecurityCategoryMacroType */



void
ProcessAsnObjectMacroType PARAMS ((m, td, t, bt, obj, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    AsnObjectMacroType *obj _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v ;
    obj = obj;
}  /* ProcessAsnObjectMacroType */


void
ProcessAsnPortMacroType PARAMS ((m, td, t, bt, p, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    AsnPortMacroType *p _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m  = m;
    v = v;
    p = p;
}  /* ProcessAsnPortMacroType */



void
ProcessAsnAbstractBindMacroType PARAMS ((m, td, t, bt, bind, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    AsnAbstractBindMacroType *bind _AND_
    ValueDef *v)
{

    bt = bt;     /*AVOIDS compiler warning.*/
    t = t;
    td = td;
    m = m;
    v = v;
    bind = bind;
}  /* ProcessAsnBindMacroType */


void
ProcessSnmpObjectTypeMacroType  PARAMS ((m, td, t, bt, ot, v),
    Module *m _AND_
    TypeDef *td _AND_
    Type *t _AND_
    BasicType *bt _AND_
    SnmpObjectTypeMacroType *ot _AND_
    ValueDef *v)
{
    NamedType *nt = NULL;
    char anyId[256];
    AnyRefList **arlHndl;

    if ((ot != NULL) && (ot->syntax != NULL))
         DefineType (m, td, ot->syntax, v->definedName);

    /*
     * add ANY ref stuff to type ref'd by this macro so it is
     * included in the ANY hash table.
     */

    /*
     * do this since the SNMP spec doesn't have an ANY type
     * but uses the mechanism. (SNMP uses an OCTET STRING
     * where the 'ANY' value is
     */
    m->hasAnys = TRUE;

    strcpy (anyId, v->definedName);
    Dash2Underscore (anyId, strlen (anyId));
    strcat (anyId, "_ANY_ID");

    arlHndl = GetAnyRefListHndl (ot->syntax);


    if (v->value->basicValue->choiceId == BASICVALUE_OID)
        AddAnyRefByOid (arlHndl, anyId, v->value->basicValue->a.oid);

    /*  integer types are not allowed, but relax constraints anyway */
    else
        AddAnyRefByInt (arlHndl, anyId, v->value->basicValue->a.integer);

/* REN -- 1/12/98 -- Also need to add a reference to the global ref table
for importTypeRefs since GetAnyRefListHndl() and 
AddAnyRefByInt() only adds the ref to the Type (basic or localTypeRef).  
Note:  For imported Types, GetAnyRefListHndl() will never return a handle 
into the global ref table. */
	
	/* Only add this type if it's an importTypeRef  */
    if ((ot->syntax != NULL) && 
		(ot->syntax->basicType->choiceId == BASICTYPE_IMPORTTYPEREF))
	{
		arlHndl = LIBTYPE_GET_ANY_REFS_HNDL(ot->syntax->basicType->choiceId);
		if (v->value->basicValue->choiceId == BASICVALUE_OID)
			AddAnyRefByOid (arlHndl, anyId, v->value->basicValue->a.oid);
		else
			AddAnyRefByInt (arlHndl, anyId, v->value->basicValue->a.integer);
	}
/* REN -- end */

    /* make a choice with all the object type elmts */
    /*   USING THE ANY HASH TABLE NOW
    if (snmpObjectSyntaxesG == NULL)
    {
        snmpObjectSyntaxesG = (TypeDef*) Malloc (sizeof (TypeDef));
        SetupType (&snmpObjectSyntaxesG->type, BASICTYPE_CHOICE, 0);
        snmpObjectSyntaxesG->type->basicType->a.choice =
            AsnListNew (sizeof (void*));
        snmpObjectSyntaxesG->definedName = "SnmpOpaqueTypes";

    }
    */

    /*  NOT DONE ANYMORE
     * make each field in the choice the same as the object
     * types SYNTAX field type (adjusted by Define type)
     * make choice field name same as OBJ-TYPE value Defs name
     *
     * NOTE - using ptrs to type/fieldname, not duplicating them
     * this may cause freeing probs
     */
    /*
    nt = MT (NamedType);
    nt->fieldName = v->definedName;
    nt->type = ot->syntax;

    tmpNtHndl = (NamedType**)
        AsnListAppend (snmpObjectSyntaxesG->type->basicType->a.choice);
    *tmpNtHndl = nt;
    */
    bt=bt;     /*AVOIDS compiler warning.*/
    t = t;
    nt = nt;

}  /* ProcessSnmpObjectTypeMacro */