char *output_dir = NULL;
-static char file_sep = '-';
+char file_sep = '-';
static int signals = 0; /* number of signals */
static int set_properties = 0; /* number of named (set) properties */
FILE *out = NULL;
FILE *outh = NULL;
FILE *outph = NULL;
-FILE *devnull = NULL;
gboolean no_touch = FALSE;
gboolean no_touch_headers = FALSE;
}
- if (no_write) {
- devnull = fopen ("/dev/null", "w");
- if (devnull == NULL)
- error_print (GOB_ERROR, 0, "Cannot open null device");
- out = devnull;
- outh = devnull;
- if (outfileph != NULL)
- outph = devnull;
- } else {
+ if ( ! no_write) {
out = fopen (outfile, "w");
if (out == NULL) {
error_printf (GOB_ERROR, 0,
/* if we are creating a private header see if it was included */
if(outph) {
- p = g_strconcat(filebase, "-private.h", NULL);
+ char sep[2] = {0,0};
+ if (file_sep != 0)
+ sep[0] = file_sep;
+ p = g_strconcat(filebase, sep, "private.h", NULL);
if( ! g_list_find_custom(include_files, p,
(GCompareFunc)strcmp)) {
- out_printf(out, "#include \"%s-private.h\"\n\n",
- filebase);
+ out_printf(out, "#include \"%s%cprivate.h\"\n\n",
+ filebase,
+ file_sep);
if(found_header)
error_printf(GOB_WARN, 0,
"Implicit private header include "
generate_outfiles ();
- if (devnull) {
- fclose (devnull);
- } else {
+ if (out)
fclose (out);
+ if (outh)
fclose (outh);
- if (outph)
- fclose (outph);
- }
+ if (outph)
+ fclose (outph);
if (! no_write) {
if (no_touch) {