/************************************************************************* * * (c) Copyright 1992,1993,1994 by G & A Technical Software, Inc., * 28 Research Drive, Hampton, Virginia, 23666. * * All Rights Reserved. No part of this software or publication may be * reproduced, stored in a retrieval system, or transmitted, in any form * or by any means, electronic, mechanical, photocopying, recording, or * otherwise without the prior written permission of G & A Technical * Software, Inc. * ************************************************************************* * * Filename: s3_parser_funcs.c * * Purpose: * * Author: John Burton * * Date: 5/31/94 * ************************************************************************* * * Modification History: * * $Log: s3_parser_funcs.c,v $ * Revision 2.1 1994/07/08 17:52:25 jcburt * Updated typedefs, defines and function protypes to allow recursive * parsing of pct files. Enabled use of sub-PDT files and scoping of * datasets. Datasets used in a pct must be defined either in the * associated pdt file or the pdt file associated with the direct * ancestors of the current pct file. * * DataSet functions and subroutines now have an additional parameter * passed to them, indicating the number of parameters passed in the * dataset list, i.e. was: function(DataSet **dl) * now: function(int nargs, DataSet **dl) * Parameters passed to the dataset routines from the PCT level are all * still contained in the dataset list, nargs is during the function or * subroutine call from s3_exec_enode * * Revision 2.0.0.1 1994/06/28 18:48:27 jcburt * S3 Version 2.0 Initial Source * * ************************************************************************* * * Revision Control Information: */ static char rcsid[] = "$Id: s3_parser_funcs.c,v 2.1 1994/07/08 17:52:25 jcburt Exp $"; static char rcsrev[] = "$Revision: 2.1 $"; /************************************************************************* * * Include Files * *************************************************************************/ #include #include #include #include #include #include #include #include "s3_defines.h" #include "s3_typedefs.h" #include "s3_externals.h" #include "s3_globals.h" #include "s3_parser.tab.h" #include "dlfcn.h" #include "s3_parser_globals.h" /************************************************************************* * * Global Variables * *************************************************************************/ /************************************************************************* * * Module: s3_add_to_list * * Description: * * Syntax: ST_entry **s3_add_to_list(ST_entry **list,ST_entry **entries, * int *ncurr,int nadd) * * Inputs: list: * entries: * ncurr: * nadd: * * Outputs: * * Returns: * * Modules Called: * *************************************************************************/ ST_entry **s3_add_to_list(ST_entry **list,ST_entry **entries,int *ncurr,int nadd) { int i,j,nl,ns; nl = *ncurr; if(nl == 0) list = (ST_entry **)xrealloc(NULL,nadd*sizeof(ST_entry *)); else list = (ST_entry **)xrealloc(list,(nl+nadd)*sizeof(ST_entry *)); for(i=0,j=nl;iname = strsave(entry); tmp->nmod = 0; tmp->mod_list = NULL; tmp->next = NULL; if(list == NULL) return tmp; curr = list; while(curr->next != NULL) curr = curr->next; curr->next = tmp; return list; }