]>
git.saurik.com Git - apple/boot.git/blob - i386/nasm/outform.c
5b4cc161d7212244a7c3675502586c3680e63de2
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
25 /* outform.c manages a list of output formats, and associates
26 * them with their relevant drivers. Also has a
27 * routine to find the correct driver given a name
30 * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
31 * Julian Hall. All rights reserved. The software is
32 * redistributable under the licence given in the file "Licence"
33 * distributed in the NASM archive.
40 static struct ofmt
*drivers
[MAX_OUTPUT_FORMATS
];
41 static int ndrivers
= 0;
43 struct ofmt
*ofmt_find(char *name
) /* find driver */
47 for (i
=0; i
<ndrivers
; i
++)
48 if (!strcmp(name
,drivers
[i
]->shortname
))
54 void ofmt_list(struct ofmt
*deffmt
, FILE *fp
)
57 for (i
=0; i
<ndrivers
; i
++)
58 fprintf(fp
, " %c %-7s%s\n",
59 drivers
[i
] == deffmt
? '*' : ' ',
60 drivers
[i
]->shortname
,
61 drivers
[i
]->fullname
);
64 void ofmt_register (struct ofmt
*info
) {
65 drivers
[ndrivers
++] = info
;