Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
outform.c
Package: nasm-0.98.zip [view]
Upload User: yuppie_zhu
Upload Date: 2007-01-08
Package Size: 535k
Code Size: 2k
Category:
Compiler program
Development Platform:
C/C++
- /* outform.c manages a list of output formats, and associates
- * them with their relevant drivers. Also has a
- * routine to find the correct driver given a name
- * for it
- *
- * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
- * Julian Hall. All rights reserved. The software is
- * redistributable under the licence given in the file "Licence"
- * distributed in the NASM archive.
- */
- #include <stdio.h>
- #include <string.h>
- #define BUILD_DRIVERS_ARRAY
- #include "outform.h"
- static int ndrivers = 0;
- struct ofmt *ofmt_find(char *name) /* find driver */
- {
- int i;
- for (i=0; i<ndrivers; i++)
- if (!strcmp(name,drivers[i]->shortname))
- return drivers[i];
- return NULL;
- }
- struct dfmt *dfmt_find(struct ofmt *ofmt, char *name) /* find driver */
- {
- struct dfmt **dfmt = ofmt->debug_formats;
- while (*dfmt) {
- if (!strcmp(name, (*dfmt)->shortname))
- return (*dfmt);
- dfmt++;
- }
- return NULL;
- }
- void ofmt_list(struct ofmt *deffmt, FILE *fp)
- {
- int i;
- for (i=0; i<ndrivers; i++)
- fprintf(fp, " %c %-10s%sn",
- drivers[i] == deffmt ? '*' : ' ',
- drivers[i]->shortname,
- drivers[i]->fullname);
- }
- void dfmt_list(struct ofmt *ofmt, FILE *fp)
- {
- struct dfmt ** drivers = ofmt->debug_formats;
- while (*drivers) {
- fprintf(fp, " %c %-10s%sn",
- drivers[0] == ofmt->current_dfmt ? '*' : ' ',
- drivers[0]->shortname,
- drivers[0]->fullname);
- drivers++;
- }
- }
- struct ofmt *ofmt_register (efunc error) {
- for (ndrivers=0; drivers[ndrivers] != NULL; ndrivers++);
- if (ndrivers==0)
- {
- error(ERR_PANIC | ERR_NOFILE,
- "No output drivers given at compile time");
- }
- return (&OF_DEFAULT);
- }