/* @(#)write_rr_table.c 2.1 93/05/18 */ /******************************************************************************/ /* function : write_rr_table.c */ /* */ /* subsystem : chgen */ /* */ /* input : (accesses pc_table and cp_table) */ /* */ /* output : (writes to schema .h file) */ /* */ /* returns : void */ /* */ /* author : Steve Smith / Craig Smith */ /* */ /* created : July, 1991 */ /* */ /* revisions : */ /* */ /* description : This routine write a comment to the output schema .h file */ /* that represents the pc_table and cp_table contents. */ /* It remains for historical reasons, and may be helpful */ /* to readers of the schema .h file. */ /* */ /******************************************************************************/ #include #include #include "chgen_define.h" #include "chgen_externs.h" void write_rr_table () { static char rcsid[] = "$Id: write_rr_table.c,v 1.2.4.1 1999/05/04 17:00:26 jkarner Exp $"; struct rr_type *tmp ; fprintf(schh_fp,"/******************************************************************************/\n"); fprintf(schh_fp,"/* The following comment is simply a listing of the parent<-->child pairs */\n"); fprintf(schh_fp,"/* found by CHGEN for the schema. The format is : */\n"); fprintf(schh_fp,"/* */\n"); fprintf(schh_fp,"/* parent:child has-bp singleton */\n"); fprintf(schh_fp,"/* */\n"); fprintf(schh_fp,"/* Where parent is the foreign key to the parent, as stored in the child */\n"); fprintf(schh_fp,"/* and child is the implied foreign key to the child, as stored in the parent */\n"); fprintf(schh_fp,"/* and has-bp indicates whether back-pointers along this relationship are */\n"); fprintf(schh_fp,"/* maintained. The singleton falg indicates if this child is supposed to be */\n"); fprintf(schh_fp,"/* the only-child under this parent (ie, no chain, usually occurs with an */\n"); fprintf(schh_fp,"/* is-a relation). Having this flag set minimizes the code generated to */\n"); fprintf(schh_fp,"/* link and manage children of this type. */\n"); fprintf(schh_fp,"/* */\n"); fprintf(schh_fp,"/******************************************************************************/\n"); fprintf(schh_fp,"/*\n"); tmp = pc_table; while (tmp != NULL) { fprintf(schh_fp,"%s:%s\t%d\t%d\n",tmp->firstid,tmp->secondid,tmp->HasBp,tmp->Singleton); tmp = tmp->next_ptr; } fprintf(schh_fp,"*/\n\n"); fprintf(schh_fp,"/******************************************************************************/\n"); fprintf(schh_fp,"/* The following comment is simply a listing of the child<-->parent pairs */\n"); fprintf(schh_fp,"/* found by CHGEN for the schema. The format is the same as the parent<--> */\n"); fprintf(schh_fp,"/* child listing, and is simply the reverse of that listings content. */\n"); fprintf(schh_fp,"/******************************************************************************/\n"); fprintf(schh_fp,"/*\n"); tmp = cp_table; while (tmp != NULL) { fprintf(schh_fp,"%s:%s\t%d\t%d\n",tmp->firstid,tmp->secondid,tmp->HasBp,tmp->Singleton); tmp = tmp->next_ptr; } fprintf(schh_fp,"*/\n\n\n"); return; }