typedef unsigned int size_t; typedef struct _IO_FILE FILE; extern struct _IO_FILE *stdin; enum { __LC_CTYPE = 0, __LC_NUMERIC = 1, __LC_TIME = 2, __LC_COLLATE = 3, __LC_MONETARY = 4, __LC_MESSAGES = 5, __LC_ALL = 6, __LC_PAPER = 7, __LC_NAME = 8, __LC_ADDRESS = 9, __LC_TELEPHONE = 10, __LC_MEASUREMENT = 11, __LC_IDENTIFICATION = 12 }; typedef struct yasm_objfmt_base { const char *extension; } yasm_objfmt_module; static char *obj_filename = ((void *)0), *in_filename = ((void *)0); static const yasm_objfmt_module *cur_objfmt_module = ((void *)0); static int preproc_only = 0; static int generate_make_dependencies = 0; static char *replace_extension(const char *orig, const char *ext, const char *def); static int do_preproc_only(FILE * in) { const char *base_filename; if (!obj_filename || generate_make_dependencies) { if (generate_make_dependencies && !obj_filename) { if (in == stdin) obj_filename = yasm__xstrdup("yasm.out"); else { if (base_filename[0] == '\0') obj_filename = yasm__xstrdup("yasm.out"); else obj_filename = replace_extension(base_filename, cur_objfmt_module-> extension, "yasm.out"); } } } } static int do_assemble(FILE * in) { const char *base_filename; if (!obj_filename) { if (in == stdin) obj_filename = yasm__xstrdup("yasm.out"); else { if (base_filename[0] == '\0') obj_filename = yasm__xstrdup("yasm.out"); else obj_filename = replace_extension(base_filename, cur_objfmt_module-> extension, "yasm.out"); } } } int main(int argc, char *argv[]) { FILE *in = ((void *)0); if (preproc_only) return do_preproc_only(in); return do_assemble(in); } static char *replace_extension(const char *orig, const char *ext, const char *def) { char *out, *outext; out = yasm_xmalloc(strlen(orig) + (ext ? (strlen(ext) + 2) : 1)); if (outext) { if (ext && __extension__( { size_t __s1_len, __s2_len; (__builtin_constant_p(outext) && __builtin_constant_p(ext) && (__s1_len = strlen(outext), __s2_len = strlen(ext), (!((size_t) (const void *) ((outext) + 1) - (size_t) (const void *)(outext) == 1) || __s1_len >= 4) && (!((size_t) (const void *) ((ext) + 1) - (size_t) (const void *)(ext) == 1) || __s2_len >= 4)) ? __builtin_strcmp(outext, ext) : (__builtin_constant_p(outext) && ((size_t) (const void *) ((outext) + 1) - (size_t) (const void *)(outext) == 1) && (__s1_len = strlen(outext), __s1_len < 4) ? (__builtin_constant_p(ext) && ((size_t) (const void *) ((ext) + 1) - (size_t) (const void *)(ext) == 1) ? __builtin_strcmp(outext, ext) : (__extension__( { __const unsigned char *__s2 = (__const unsigned char *) (__const char *) (ext); register int __result = (((__const unsigned char *)(__const char *)(outext))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { } __result;} ))): (__builtin_constant_p(ext) && ((size_t) (const void *)((ext) + 1) - (size_t) (const void *)(ext) == 1) && (__s2_len = strlen(ext), __s2_len < 4) ? (__builtin_constant_p(outext) && ((size_t) (const void *)((outext) + 1) - (size_t) (const void *)(outext) == 1) ? __builtin_strcmp(outext, ext) : (__extension__( { __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (outext); register int __result = __s1 [0] - ((__const unsigned char *)(__const char *)(ext))[0]; if (__s2_len > 0 && __result == 0) { } __result;} ))): __builtin_strcmp(outext, ext))));} ) == 0) { print_error(dcgettext (((void *)0), "file name already ends in `.%s': output will be in `%s'", __LC_MESSAGES), ext, def); } } }