52 main (
int argc,
char** argv)
61 for (
int i = 0; i < 16; ++i)
62 printf (
"\\%.3hho", *(((
char*)&luid)+i));
67 for (
int i = 1; i < argc; ++i)
69 FILE* in = fopen (argv[i],
"r");
72 fprintf (stderr,
"Failed to open file %s for reading: %s\n", argv[i], strerror (errno));
77 FILE* out = fopen (outname,
"wx");
80 fprintf (stderr,
"Failed to open file %s for writing: %s\n", outname, strerror (errno));
88 printf (
"Luidgen %s ", argv[i]); fflush (stdout);
90 while (fgets (buf, 4096, in))
93 while ((pos = strstr(buf,
"LUIDGEN")))
95 memmove (pos+66, pos+7, strlen (pos+7)+1);
97 sprintf (luidbuf,
"\""LUMIERA_UID_FMT
"\"", LUMIERA_UID_ELEMENTS(luid));
98 memcpy (pos, luidbuf, 66);
99 putchar (
'.'); fflush (stdout);
110 if (!!rename (argv[i], backup))
112 fprintf (stderr,
"Failed to create backupfile %s: %s\n", backup, strerror (errno));
116 if (!!rename (outname, argv[i]))
118 fprintf (stderr,
"Renaming %s to %s failed: %s\n", outname, argv[i], strerror (errno));
119 rename (backup, argv[i]);
int main(int argc, const char *argv[])
run all tests or any single test specified in the first command line argument.
Round robin temporary buffers.
Lumiera unique object identifier.
void lumiera_uid_gen(lumiera_uid *luid)
Generate a new luid.
unsigned char lumiera_uid[16]
storage for a Lumiera unique ID, based on a 128bit random number
char * lumiera_tmpbuf_snprintf(size_t size, const char *fmt,...)
Construct a string in a tmpbuf.