43 main (
int argc,
char** argv)
52 for (
int i = 0; i < 16; ++i)
53 printf (
"\\%.3hho", *(((
char*)&luid)+i));
58 for (
int i = 1; i < argc; ++i)
60 FILE* in = fopen (argv[i],
"r");
63 fprintf (stderr,
"Failed to open file %s for reading: %s\n", argv[i], strerror (errno));
68 FILE* out = fopen (outname,
"wx");
71 fprintf (stderr,
"Failed to open file %s for writing: %s\n", outname, strerror (errno));
79 printf (
"Luidgen %s ", argv[i]); fflush (stdout);
81 while (fgets (buf, 4096, in))
84 while ((pos = strstr(buf,
"LUIDGEN")))
86 memmove (pos+66, pos+7, strlen (pos+7)+1);
88 sprintf (luidbuf,
"\""LUMIERA_UID_FMT
"\"", LUMIERA_UID_ELEMENTS(luid));
89 memcpy (pos, luidbuf, 66);
90 putchar (
'.'); fflush (stdout);
101 if (!!rename (argv[i], backup))
103 fprintf (stderr,
"Failed to create backupfile %s: %s\n", backup, strerror (errno));
107 if (!!rename (outname, argv[i]))
109 fprintf (stderr,
"Renaming %s to %s failed: %s\n", outname, argv[i], strerror (errno));
110 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.