mirror of https://github.com/yasm/yasm.git
parent
a2e07e1e10
commit
288401feff
14 changed files with 124 additions and 162 deletions
@ -1,60 +0,0 @@ |
||||
/*
|
||||
* YASM generic functions for all object formats |
||||
* |
||||
* Copyright (C) 2001 Peter Johnson |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
#include "util.h" |
||||
/*@unused@*/ RCSID("$IdPath$"); |
||||
|
||||
#include "module.h" |
||||
|
||||
#include "objfmt.h" |
||||
|
||||
|
||||
/* NULL-terminated list of all possibly available object format keywords.
|
||||
* Could improve this a little by generating automatically at build-time. |
||||
*/ |
||||
/*@-nullassign@*/ |
||||
const char *objfmts[] = { |
||||
"dbg", |
||||
"bin", |
||||
"coff", |
||||
NULL |
||||
}; |
||||
/*@=nullassign@*/ |
||||
|
||||
|
||||
void |
||||
yasm_list_objfmts(void (*printfunc) (const char *name, const char *keyword)) |
||||
{ |
||||
int i; |
||||
yasm_objfmt *of; |
||||
|
||||
/* Go through available list, and try to load each one */ |
||||
for (i = 0; objfmts[i]; i++) { |
||||
of = load_objfmt(objfmts[i]); |
||||
if (of) |
||||
printfunc(of->name, of->keyword); |
||||
} |
||||
} |
@ -1,58 +0,0 @@ |
||||
/*
|
||||
* YASM generic functions for all parsers |
||||
* |
||||
* Copyright (C) 2001 Peter Johnson |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions |
||||
* are met: |
||||
* 1. Redistributions of source code must retain the above copyright |
||||
* notice, this list of conditions and the following disclaimer. |
||||
* 2. Redistributions in binary form must reproduce the above copyright |
||||
* notice, this list of conditions and the following disclaimer in the |
||||
* documentation and/or other materials provided with the distribution. |
||||
* |
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND OTHER CONTRIBUTORS ``AS IS'' |
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS BE |
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
||||
* POSSIBILITY OF SUCH DAMAGE. |
||||
*/ |
||||
#include "util.h" |
||||
/*@unused@*/ RCSID("$IdPath$"); |
||||
|
||||
#include "module.h" |
||||
|
||||
#include "parser.h" |
||||
|
||||
|
||||
/* NULL-terminated list of all possibly available parser keywords.
|
||||
* Could improve this a little by generating automatically at build-time. |
||||
*/ |
||||
/*@-nullassign@*/ |
||||
const char *parsers[] = { |
||||
"nasm", |
||||
NULL |
||||
}; |
||||
/*@=nullassign@*/ |
||||
|
||||
|
||||
void |
||||
yasm_list_parsers(void (*printfunc) (const char *name, const char *keyword)) |
||||
{ |
||||
int i; |
||||
yasm_parser *p; |
||||
|
||||
/* Go through available list, and try to load each one */ |
||||
for (i = 0; parsers[i]; i++) { |
||||
p = load_parser(parsers[i]); |
||||
if (p) |
||||
printfunc(p->name, p->keyword); |
||||
} |
||||
} |
Loading…
Reference in new issue