1 /* outform.c manages a list of output formats, and associates
2 * them with their relevant drivers. Also has a
3 * routine to find the correct driver given a name
6 * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
7 * Julian Hall. All rights reserved. The software is
8 * redistributable under the licence given in the file "Licence"
9 * distributed in the NASM archive.
16 static struct ofmt
*drivers
[MAX_OUTPUT_FORMATS
];
17 static int ndrivers
= 0;
19 struct ofmt
*ofmt_find(char *name
) /* find driver */
23 for (i
=0; i
<ndrivers
; i
++)
24 if (!strcmp(name
,drivers
[i
]->shortname
))
30 void ofmt_list(struct ofmt
*deffmt
)
33 for (i
=0; i
<ndrivers
; i
++)
34 fprintf(stderr
," %c %-7s%s\n",
35 drivers
[i
] == deffmt
? '*' : ' ',
36 drivers
[i
]->shortname
,
37 drivers
[i
]->fullname
);
40 void ofmt_register (struct ofmt
*info
) {
41 drivers
[ndrivers
++] = info
;