/* @(#)make_pptr.c 2.1 93/05/18 */ /******************************************************************************/ /* function : make_pptr.c */ /* */ /* subsystem : chgen */ /* */ /* input : current_table (tt ptr) , cp_table */ /* */ /* output : (writes _bcp and _fcp pinter fields to .h file) */ /* */ /* returns : void */ /* */ /* author : Steve Smith / Craig Smith */ /* */ /* created : July, 1991 */ /* */ /* revisions : 93s523: Output hcg_abbr_size chars from id's */ /* */ /* description : This routine will scan the cp_table, looking for entries */ /* whose firstid matches the specified table. For each found */ /* it represents a parent relation up from this child. */ /* Thus, the appropriate _pp, and (optionally) _fpp and _bpp */ /* pointer declarations are output to the schema .h file. */ /* */ /******************************************************************************/ #include #include #include "chgen_define.h" #include "chgen_externs.h" void make_pptr(current_table,cp_table) struct rr_type *cp_table; char current_table[]; { static char rcsid[] = "$Id: make_pptr.c,v 1.2.4.1 1999/05/04 17:00:12 jkarner Exp $"; char temp_string[ABBREV_NAME_LENGTH]; struct rr_type *tmp_ptr; /* to hold the current position */ tmp_ptr = cp_table; while(tmp_ptr) /* not end of list */ { if (strncmp(current_table,tmp_ptr->firstid,strlen(current_table)) == 0) { strncpy_null(temp_string, tmp_ptr->secondid, hcg_abbr_size); fprintf(schh_fp,"\nstruct %s *%s_pp;", temp_string, tmp_ptr->secondid); if (tmp_ptr->Singleton) fprintf(schh_fp," /* Singleton child, no need for fpp/bpp ptrs */"); fprintf(schh_fp,"\n"); if (!tmp_ptr->Singleton) { fprintf(schh_fp,"struct dummy_type *%s_fpp;\n",tmp_ptr->secondid); if ((!cli_nobp) && (tmp_ptr->HasBp)) fprintf(schh_fp,"struct dummy_type *%s_bpp;\n",tmp_ptr->secondid); } } tmp_ptr = tmp_ptr->next_ptr; } return; }