home *** CD-ROM | disk | FTP | other *** search
- /*
- find_of: find the output format corresponding for the field whose
- name we are given.
-
- Kenneth Ingham
-
- Copyright (C) 1987 The University of New Mexico
- */
-
- #include "defs.h"
-
- find_of(type, name, of_head, of)
- int type;
- union out_fmt_u of_head, *of;
- char *name;
- {
- struct rel_out_st *rf;
- struct col_out_st *cf;
-
- switch(type) {
- case RELATIVE:
- for (rf=of_head.rel_fmt; rf; rf=rf->next)
- if (strcmp(name, rf->name) == 0) {
- (*of).rel_fmt = rf;
- return True;
- }
- break;
- case COLUMN:
- for (cf=of_head.col_fmt; cf; cf=cf->next)
- if (strcmp(name, cf->name) == 0) {
- (*of).col_fmt = cf;
- return True;
- }
- break;
- default:
- fprintf(stderr,"internal error; unknown type in find_of\n");
- exit(1);
- }
-
- return False;
- }
-