Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / osf / uil / UilSarMod.c
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* 
24  *  @OSF_COPYRIGHT@
25  *  COPYRIGHT NOTICE
26  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
27  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
28  *  the full copyright text.
29 */ 
30 /* 
31  * HISTORY
32 */ 
33 #ifdef REV_INFO
34 #ifndef lint
35 static char rcsid[] = "$TOG: UilSarMod.c /main/13 1997/03/12 15:21:36 dbl $"
36 #endif
37 #endif
38
39 /*
40 *  (c) Copyright 1989, 1990, DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
41
42 /*
43 **++
44 **  FACILITY:
45 **
46 **      User Interface Language Compiler (UIL)
47 **
48 **  ABSTRACT:
49 **
50 **      This module contain the routines for processing the module construct.
51 **
52 **--
53 **/
54
55
56 /*
57 **
58 **  INCLUDE FILES
59 **
60 **/
61
62 #include "UilDefI.h"
63
64 /*
65 **
66 **  TABLE OF CONTENTS
67 **
68 */
69
70 /*
71 **
72 **  DEFINE and MACRO DEFINITIONS
73 **
74 **/
75
76
77
78 /*
79 **
80 **  EXTERNAL VARIABLE DECLARATIONS
81 **
82 **/
83
84 extern   yystype                        yylval;
85
86
87 /*
88 **
89 **  GLOBAL VARIABLE DECLARATIONS
90 **
91 **/
92
93 externaldef(uil_comp_glbl) src_source_record_type
94         *src_az_module_source_record;
95 externaldef(uil_comp_glbl) unsigned short int   
96         *uil_urm_variant = NULL;
97 externaldef(uil_comp_glbl) unsigned short int
98         *uil_arg_compr = NULL;
99 externaldef(uil_comp_glbl) unsigned short int
100         *uil_reas_compr = NULL;
101 externaldef(uil_comp_glbl) unsigned short int
102         *uil_widget_compr = NULL;
103 externaldef(uil_comp_glbl) unsigned short int
104         *uil_child_compr = NULL;
105
106 /*
107 **
108 **  OWN VARIABLE DECLARATIONS
109 **
110 **/
111
112 unsigned int    module_clauses;
113
114 #define m_version_clause        (1<<0)
115 #define m_names_clause          (1<<1)
116 #define m_charset_clause        (1<<2)
117 #define m_objects_clause        (1<<3)
118
119 #define m_after_names           (m_charset_clause)
120
121 \f
122 /*
123 **++
124 **  FUNCTIONAL DESCRIPTION:
125 **
126 **      This function initializes all static data structure for the semantic
127 **      action routines.
128 **
129 **  FORMAL PARAMETERS:
130 **
131 **      none
132 **
133 **  IMPLICIT INPUTS:
134 **
135 **      none
136 **
137 **  IMPLICIT OUTPUTS:
138 **
139 **      uil_urm_variant
140 **
141 **  FUNCTION VALUE:
142 **
143 **      void
144 **
145 **  SIDE EFFECTS:
146 **
147 **      global variables are initialized 
148 **
149 **--
150 **/
151
152 void    sar_initialize ()
153
154 {
155 int             i;      /* loop index */
156
157 /* BEGIN OSF Fix CR 5443 */
158 /* Initialize uil_sym_default_charset based on XmFALLBACK_CHARSET */
159 if (strcmp(XmFALLBACK_CHARSET, "ISO8859-1") != 0) /* Most common case. */
160   for (i = 0; i < (int)charset_lang_table_max; i++)
161     if (strcmp(XmFALLBACK_CHARSET, charset_lang_names_table[i]) == 0)
162       {
163         uil_sym_default_charset = charset_lang_codes_table[i];
164         break;
165       }
166 /* END OSF Fix CR 5443 */
167
168 /*
169  * Allocate vectors for the variant and usage vectors if they are NULL,
170  */
171 if ( uil_urm_variant == NULL )
172     uil_urm_variant = (unsigned short int *)
173         XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
174 if ( uil_arg_compr == NULL )
175     uil_arg_compr = (unsigned short int *)
176         XtMalloc(sizeof(unsigned short int)*(uil_max_arg+1));
177 if ( uil_reas_compr == NULL )
178     uil_reas_compr = (unsigned short int *)
179         XtMalloc(sizeof(unsigned short int)*(uil_max_reason+1));
180 if ( uil_widget_compr == NULL )
181     uil_widget_compr = (unsigned short int *)
182         XtMalloc(sizeof(unsigned short int)*(uil_max_object+1));
183 if ( uil_child_compr == NULL )
184     uil_child_compr = (unsigned short int *)
185         XtMalloc(sizeof(unsigned short int)*(uil_max_child+1));
186 /*
187  **     Loop throught the array of object variants and set them all to NULL.
188  */
189 for (i = 0; i<uil_max_object+1; i++)
190     uil_urm_variant[i] = 0;   
191
192 /*
193  ** Initialize all compression vectors
194  */
195 for ( i=0 ; i<uil_max_arg+1 ; i++ )
196     uil_arg_compr[i] = 0;
197 for ( i=0 ; i<uil_max_reason+1 ; i++ )
198     uil_reas_compr[i] = 0;
199 for ( i=0 ; i<uil_max_object+1 ; i++ )
200     uil_widget_compr[i] = 0;
201 for ( i=0 ; i<uil_max_child+1 ; i++ )
202     uil_child_compr[i] = 0;
203
204 }
205 \f
206 /*
207 **++
208 **  FUNCTIONAL DESCRIPTION:
209 **
210 **      This function creates the root entry node for the compilation.
211 **      The "root" entry is the root node of the symbol tree and is
212 **      what's passed back to the caller of the compiler.
213 **
214 **  FORMAL PARAMETERS:
215 **
216 **      root_frame      ptr to root frame that will remain on the stack
217 **                      throughout the compilation
218 **
219 **  IMPLICIT INPUTS:
220 **
221 **      none
222 **
223 **  IMPLICIT OUTPUTS:
224 **
225 **      sym_az_root_entry               global pointer used thoughout the compilation
226 **      sym_az_curent_section_entry     global pointer used thoughout the compilation
227 **      src_az_first_source_record      global pointer to the source record list
228 **
229 **  FUNCTION VALUE:
230 **
231 **      void
232 **
233 **  SIDE EFFECTS:
234 **
235 **      none
236 **
237 **--
238 **/
239
240 void    sar_create_root (root_frame)
241
242 yystype     *root_frame;
243
244 {
245     /*
246     ** Allocate the symbol nodes
247     */
248
249     sym_az_root_entry = (sym_root_entry_type *)
250                 sem_allocate_node (sym_k_root_entry, sym_k_root_entry_size);
251
252     /*
253     ** Create a place holder entry (tail) and change the "current" section list to it.
254     */
255
256     sym_az_current_section_entry = (sym_section_entry_type *) sem_allocate_node
257                             ( sym_k_section_entry, sym_k_section_entry_size );
258
259     sym_az_current_section_entry->header.b_type = sym_k_section_tail;
260
261     sym_az_root_entry->sections = sym_az_current_section_entry;
262     sym_az_root_entry->src_record_list = src_az_first_source_record;
263
264     /*
265     ** Save the file name and the expanded version of it.
266     */
267
268     strcpy (sym_az_root_entry->file_name, Uil_cmd_z_command.ac_source_file);
269     strcpy (sym_az_root_entry->full_file_name, src_az_source_file_table[0]->expanded_name);
270
271     /*
272     ** Save the symbol node in the root frame.
273     */
274
275     root_frame->b_tag = sar_k_root_frame;
276     root_frame->b_type = sym_k_root_entry;
277     root_frame->value.az_symbol_entry = (sym_entry_type *)sym_az_root_entry;
278
279 }
280
281 \f
282 /*
283 **++
284 **  FUNCTIONAL DESCRIPTION:
285 **
286 **      This function create the module entry symbol node for the compilation.
287 **
288 **  FORMAL PARAMETERS:
289 **
290 **      target_frame    ptr to module frame that will remain on the stack
291 **                      throughout the compilation
292 **      id_frame        ptr to token frame for the module name
293 **
294 **  IMPLICIT INPUTS:
295 **
296 **      sym_az_root_entry       global that points to the root entry
297 **
298 **  IMPLICIT OUTPUTS:
299 **
300 **      sym_az_module_entry     global that points to module entry
301 **
302 **  FUNCTION VALUE:
303 **
304 **      void
305 **
306 **  SIDE EFFECTS:
307 **
308 **      set second line of the listing title
309 **
310 **--
311 **/
312
313 void    sar_create_module(target_frame, id_frame, module_frame)
314
315 yystype     *target_frame;
316 yystype     *id_frame;
317 yystype     *module_frame;
318
319 {
320     sym_name_entry_type     *name_entry;
321
322     /*
323     **  Call standard routine to check name entry for id_frame.
324     **  This routine handles font name, color names, etc used as ids
325     */
326
327     name_entry = (sym_name_entry_type *) sem_dcl_name( id_frame );
328
329     /*
330     **  Allocate the module entry and fill it in
331     */
332
333     sym_az_module_entry = (sym_module_entry_type *)
334         sem_allocate_node (sym_k_module_entry, sym_k_module_entry_size);
335     sym_az_module_entry->obj_header.az_name = name_entry;
336     _sar_save_source_pos (&sym_az_module_entry->header, module_frame);
337
338     /* preserve module header comments */
339     sar_assoc_comment ((sym_obj_entry_type *)sym_az_module_entry);  
340
341     /*
342     ** Hang the module entry off the root entry
343     */
344
345     sym_az_root_entry->module_hdr = sym_az_module_entry;
346
347     /*
348     **  Have name entry point to the module entry too.  This stops the
349     **  name from being reused to name another construct.
350     */
351
352     name_entry->az_object = (sym_entry_type *) sym_az_module_entry;
353
354     /*
355     ** Save the source information about module name identifier
356     */
357
358     _sar_save_source_info ( &name_entry->header , module_frame , id_frame );
359
360     /*
361     **  Set up target frame
362     */
363
364     target_frame->b_tag = sar_k_module_frame;
365
366     /*
367     **  Set up listing title
368     */
369
370     if (Uil_cmd_z_command.v_listing_file)
371         sprintf(Uil_lst_c_title2, 
372                 "Module: %s", 
373                 name_entry->c_text );
374
375     /*
376     **  Set mask to no clauses seen
377     */
378
379     module_clauses = 0;
380 }
381 \f
382 /*
383 **++
384 **  FUNCTIONAL DESCRIPTION:
385 **
386 **      This function sets a version string for the module.
387 **
388 **  FORMAL PARAMETERS:
389 **
390 **      value_frame     ptr to value frame for version string
391 **
392 **  IMPLICIT INPUTS:
393 **
394 **      none
395 **
396 **  IMPLICIT OUTPUTS:
397 **
398 **      sym_az_module_entry     global that point to module entry
399 **
400 **  FUNCTION VALUE:
401 **
402 **      void
403 **
404 **  SIDE EFFECTS:
405 **
406 **      set up second line of the listing title
407 **
408 **--
409 **/
410
411 void    sar_process_module_version (value_frame, start_frame)
412
413 yystype     *value_frame;
414 yystype     *start_frame;
415
416 {
417     sym_value_entry_type    *value_entry;
418
419     _assert( value_frame->b_tag == sar_k_value_frame, "value frame missing" );
420
421     if ((module_clauses & m_version_clause) != 0)
422         diag_issue_diagnostic
423             ( d_single_occur,
424               _sar_source_position( value_frame ),
425               "UIL", "module", "version", "clause"
426             );
427
428     /*
429     ** FORWARD REFERENCING OF VERSION NO LONGER ALLOWED
430     ** If it's not a forward reference, verify its length and stick a pointer
431     ** to the value node of the version in the module entry.
432     */
433
434     if ((value_frame->b_flags & sym_m_forward_ref) != 0)
435       diag_issue_diagnostic(d_illegal_forward_ref,
436                             _sar_source_position(value_frame),
437                             "Module Version"
438             );
439
440     else
441         {
442         value_entry = (sym_value_entry_type *) 
443             value_frame->value.az_symbol_entry;
444
445         if (value_entry->w_length > 31)
446         {
447             diag_issue_diagnostic
448                 ( d_out_range,
449                   _sar_source_position( value_frame ),
450                   "version string",
451                   "0..31 characters"
452                 );
453
454             value_entry->w_length = 31;
455         }
456
457     sym_az_module_entry->az_version = value_entry;
458         }
459
460     /*
461     ** Save source info
462     */
463
464     _sar_save_source_info ( &sym_az_module_entry->az_version->header , start_frame , value_frame);
465
466     /*
467     **  Set up listing title
468     */
469
470     if (Uil_cmd_z_command.v_listing_file)
471         sprintf(Uil_lst_c_title2, 
472                 "Module: %s \t Version: %s", 
473                 sym_az_module_entry->obj_header.az_name->c_text,
474                 value_entry->value.c_value );
475
476     module_clauses |= m_version_clause;
477 }
478 \f
479 /*
480 **++
481 **  FUNCTIONAL DESCRIPTION:
482 **
483 **      This function sets the case sensitivity of names for the module.
484 **
485 **  FORMAL PARAMETERS:
486 **
487 **      token_frame     ptr to token frame for keyword sensitive or insensitive
488 **
489 **  IMPLICIT INPUTS:
490 **
491 **      sym_az_module_entry     global which points to module entry
492 **
493 **  IMPLICIT OUTPUTS:
494 **
495 **      uil_v_case_sensitive    global which control case sensitivity of names
496 **
497 **  FUNCTION VALUE:
498 **
499 **      void
500 **
501 **  SIDE EFFECTS:
502 **
503 **      none
504 **
505 **--
506 **/
507
508 void    sar_process_module_sensitivity (token_frame, start_frame)
509
510 yystype     *token_frame;
511 yystype     *start_frame;
512
513 {
514     _assert( token_frame->b_tag == sar_k_token_frame, "token frame missing" );
515
516     if ((module_clauses & m_names_clause) != 0)
517         diag_issue_diagnostic
518             ( d_single_occur,
519               _sar_source_position( token_frame ),
520               "UIL", "module", "names", "clause"
521             );
522
523     if ((module_clauses & m_after_names) != 0)
524         diag_issue_diagnostic
525             ( d_names,
526               _sar_source_position( token_frame )
527             );
528
529     uil_v_case_sensitive = (token_frame->b_type == CASE_SENSITIVE);
530
531     sym_az_module_entry->az_case_sense = (sym_value_entry_type *)
532                                          sem_allocate_node (sym_k_value_entry, sym_k_value_entry_size);
533
534     sym_az_module_entry->az_case_sense->header.b_type = uil_v_case_sensitive;
535
536     /*
537     ** Save source info
538     */
539
540     _sar_save_source_info ( &sym_az_module_entry->az_case_sense->header , start_frame , token_frame);
541
542     /* let the keyword table know of the sensitivity change */
543
544     key_initialize();
545
546
547     /*
548     **  The default for name sensitivity is SENSITIVE.
549     **  At the point that this semantic routine is called, the only valid
550     **  name seen so far is the module name.
551     */
552
553     module_clauses |= m_names_clause;
554 }
555 \f
556 /*
557 **++
558 **  FUNCTIONAL DESCRIPTION:
559 **
560 **      This function sets the default charset for the module.
561 **
562 **  FORMAL PARAMETERS:
563 **
564 **      token_frame     ptr to token frame for charset
565 **
566 **  IMPLICIT INPUTS:
567 **
568 **      sym_az_module_entry     global pointer to the module entry
569 **
570 **  IMPLICIT OUTPUTS:
571 **
572 **      Uil_lex_l_user_default_charset
573 **      Uil_lex_az_charset_entry
574 **
575 **  FUNCTION VALUE:
576 **
577 **      void
578 **
579 **  SIDE EFFECTS:
580 **
581 **      none
582 **
583 **--
584 **/
585
586 void    sar_process_module_charset(token_frame , start_frame)
587
588 yystype     *token_frame;
589 yystype     *start_frame;
590
591 {
592     sym_value_entry_type        *value_entry;
593
594     _assert( (token_frame->b_tag == sar_k_token_frame) ||
595              (token_frame->b_tag == sar_k_value_frame), "token or value frame missing" );
596
597     if ((module_clauses & m_charset_clause) != 0)
598         diag_issue_diagnostic
599             ( d_single_occur,
600               _sar_source_position( token_frame ),
601               "UIL", "module", "character_set", "clause"
602             );
603
604     /*
605     **  There are two different ways that the charset info may be specified.
606     **  If the charset_frame is a token frame, then we can just grab the
607     **  token class and map it into a charset value.  If it is a value frame
608     **  the it is the result of the CHARACTER_SET function and is a string
609     **  value representing the character set.
610     */
611     switch (token_frame->b_tag)
612     {
613         case sar_k_token_frame:
614             {
615             key_keytable_entry_type     *az_keyword_entry;
616             az_keyword_entry = token_frame->value.az_keyword_entry;
617
618             Uil_lex_l_user_default_charset = az_keyword_entry->b_subclass;
619
620             value_entry = sem_create_value_entry (
621                                  token_frame->value.az_keyword_entry->at_name,
622                                  token_frame->value.az_keyword_entry->b_length, sym_k_char_8_value );
623             break;
624             }
625      
626         case sar_k_value_frame:
627             {
628             Uil_lex_l_user_default_charset = lex_k_userdefined_charset;
629             Uil_lex_az_charset_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
630             value_entry = (sym_value_entry_type *)token_frame->value.az_symbol_entry;
631             break;
632             }
633     }
634
635     /* If charset specified for module, then localized strings not allowed */
636     Uil_lex_l_localized = FALSE;
637     
638     module_clauses |= m_charset_clause;
639     sym_az_module_entry->az_character_set = value_entry;
640
641     /*
642     ** Save source info
643     */
644
645     _sar_save_source_info ( &value_entry->header , start_frame , token_frame);
646
647 }
648 \f
649 /*
650 **++
651 **  FUNCTIONAL DESCRIPTION:
652 **
653 **      This function saves the source record for the module header
654 **      for possible later use in the machine code listing.
655 **
656 **  FORMAL PARAMETERS:
657 **
658 **      none
659 **
660 **  IMPLICIT INPUTS:
661 **
662 **      yylval          Current token information from the lexical analyzer
663 **
664 **  IMPLICIT OUTPUTS:
665 **
666 **      src_az_module_source_record     source record for the module header
667 **
668 **  FUNCTION VALUE:
669 **
670 **      void
671 **
672 **  SIDE EFFECTS:
673 **
674 **      none
675 **
676 **--
677 **/
678
679 void    sar_save_module_source ()
680
681 {
682
683     src_az_module_source_record = yylval.az_source_record;
684
685 }
686
687 \f
688 /*
689 **++
690 **  FUNCTIONAL DESCRIPTION:
691 **
692 **      This routine creates and saves a default object specification
693 **      for the module entry itself.
694 **
695 **  FORMAL PARAMETERS:
696 **
697 **      object_frame    ptr to token frame for "OBJECT" 
698 **
699 **  IMPLICIT INPUTS:
700 **
701 **      none
702 **
703 **  IMPLICIT OUTPUTS:
704 **
705 **      sym_az_module_entry     global pointer to the module entry
706 **
707 **  FUNCTION VALUE:
708 **
709 **      void
710 **
711 **  SIDE EFFECTS:
712 **
713 **      none
714 **
715 **--
716 **/
717
718 void    sar_make_def_obj (object_frame)
719
720 yystype     *object_frame;
721
722 {
723 sym_def_obj_entry_type  *def_obj_entry;
724
725 /*
726  * Make def_obj entry and link into the chain headed in the module
727  */
728 def_obj_entry = (sym_def_obj_entry_type *) sem_allocate_node
729     (sym_k_def_obj_entry, sym_k_def_obj_entry_size);
730 _sar_save_source_pos (&def_obj_entry->header, object_frame);
731 def_obj_entry->next = sym_az_module_entry->az_def_obj;
732 sym_az_module_entry->az_def_obj = def_obj_entry;
733
734 }
735
736 \f
737 /*
738 **++
739 **  FUNCTIONAL DESCRIPTION:
740 **
741 **      This function sets the default variants for objects which
742 **      are defined in the module.
743 **
744 **  FORMAL PARAMETERS:
745 **
746 **      type_frame      ptr to token frame for object type
747 **      variant_frame   ptr to token frame for variant
748 **
749 **  IMPLICIT INPUTS:
750 **
751 **      uil_gadget_variants     table to see if the gadget variant is supported
752 **      uil_urm_variant         table to see if the object type has been
753 **                              specified previously
754 **      sym_az_module_entry     global pointing to the module entry
755 **
756 **  IMPLICIT OUTPUTS:
757 **
758 **      uil_urm_variant         table to contain the default variant for this
759 **                              object type.
760 **
761 **  FUNCTION VALUE:
762 **
763 **      void
764 **
765 **  SIDE EFFECTS:
766 **
767 **      none
768 **
769 **--
770 **/
771
772 void    sar_process_module_variant  (obj_type_frame, variant_frame)
773
774 yystype     *obj_type_frame;
775 yystype     *variant_frame;
776
777 {
778
779     unsigned int                obj_type, obj_variant;
780     yystype                     *source_frame;
781     sym_def_obj_entry_type      *def_obj_entry;
782
783     source_frame = & yylval;
784
785     obj_type = obj_type_frame->value.az_keyword_entry->b_subclass;
786     obj_variant = variant_frame->b_type;
787
788 /*  See if this object type has been specified before.  */
789
790     if ( uil_urm_variant[obj_type] != 0 )
791         {
792         diag_issue_diagnostic
793             (d_supersede,
794              _sar_source_position ( source_frame ),
795              diag_object_text (obj_type),
796              diag_tag_text (obj_variant),
797              diag_tag_text (sym_k_module_entry),
798              "" );
799         }
800
801 /*  See if this object type supports gadgets.  */
802
803     if ( obj_variant == sym_k_gadget_entry )
804         {
805         if ( uil_gadget_variants[obj_type] == 0 )
806             {
807             diag_issue_diagnostic
808                 (d_gadget_not_sup,
809                  _sar_source_position ( source_frame ),
810                  diag_object_text (obj_type),
811                  diag_object_text (obj_type) );
812             obj_variant = sym_k_widget_entry;
813             }
814         }
815
816 /*  Save the default variant information  */
817     uil_urm_variant[obj_type] = obj_variant;
818
819 /*
820 ** get the latest def_obj entry and fill in
821 */
822     def_obj_entry = sym_az_module_entry->az_def_obj->next;
823     def_obj_entry->b_object_info = obj_type;
824     def_obj_entry->b_variant_info = obj_variant;
825
826 }
827 \f
828 /*
829 **++
830 **  FUNCTIONAL DESCRIPTION:
831 **
832 **      This procedure saves source info for the various sections declaration
833 **      lists in the Uil file (i.e. value, identifier, procedure, object, and
834 **      list).
835 **
836 **  FORMAL PARAMETERS:
837 **
838 **      header_frame    ptr to token frame for the section declaration
839 **      section_type    integer describing what section this is
840 **
841 **  IMPLICIT INPUTS:
842 **
843 **      none
844 **
845 **  IMPLICIT OUTPUTS:
846 **
847 **      sym_az_root_entry       global pointer to the root entry
848 **
849 **  FUNCTION VALUE:
850 **
851 **      void
852 **
853 **  SIDE EFFECTS:
854 **
855 **      none
856 **
857 **--
858 */
859
860 void    sar_save_section_source (header_frame, section_type)
861
862 yystype     *header_frame;
863 int         section_type;
864
865 {
866     sym_section_entry_type      *section_entry;
867
868     section_entry = (sym_section_entry_type *) sem_allocate_node
869                         ( sym_k_section_entry, sym_k_section_entry_size );
870
871     section_entry->header.b_type = section_type;
872
873     /*
874     ** Save source info
875     */
876
877     _sar_save_source_info ( &section_entry->header , header_frame, header_frame);
878
879     /*
880     ** Link this section into the current section list.
881     */
882
883     section_entry->next = (sym_entry_type *) sym_az_current_section_entry;
884     section_entry->prev_section = sym_az_current_section_entry->prev_section;
885     sym_az_current_section_entry = section_entry;
886
887 }