#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <sys/stat.h>
#include <limits.h>
#include <getopt.h>
gboolean no_self_alias = FALSE;
gboolean always_private_struct = FALSE;
gboolean gtk3_ok = FALSE;
-
-gint prealloc = 0;
-
-
-
+gint npreallocs = 0;
gboolean use_m4 = FALSE; /* preprocess sources with m4 */
char *m4_commandline = NULL;
#define M4_INCLUDE_DIR PKGDATADIR "/m4"
"\t\t(GInstanceInitFunc) %s_init,\n"
"\t\tNULL\n"
"\t};\n\n",
- typebase, funcbase, typebase, prealloc, funcbase);
+ typebase, funcbase, typebase, npreallocs, funcbase);
}
static void
if (error)
goto end;
- if (! equal && unlink (old_filename) != 0) {
- error_printf (GOB_ERROR, 0, "Can't remove %s: %s",
- old_filename, g_strerror (errno));
+ if (!equal && remove(old_filename) != 0) {
+ error_printf(GOB_ERROR, 0, "Can't remove %s: %s",
+ old_filename, g_strerror (errno));
goto end;
}
}
if (equal) {
- if (unlink (new_filename) != 0)
- error_printf (GOB_ERROR, 0, "Can't remove %s: %s",
- new_filename, g_strerror (errno));
+ if (remove(new_filename) != 0) {
+ error_printf(GOB_ERROR, 0, "Can't remove %s: %s",
+ new_filename, g_strerror(errno));
+ }
} else {
- if (rename (new_filename, old_filename) != 0)
- error_printf (GOB_ERROR, 0, "Can't rename %s to %s: %s",
- new_filename, old_filename,
- g_strerror (errno));
+ if (rename(new_filename, old_filename) != 0) {
+ error_printf(GOB_ERROR, 0, "Can't rename %s to %s: %s",
+ new_filename, old_filename,
+ g_strerror(errno));
+ }
}
- end:
+end:
g_free (new_filename);
}