renaming a member of the metadata struct

This commit is contained in:
tth 2022-04-17 04:03:38 +02:00
parent 8a663a95ee
commit 12c3218a93
2 changed files with 7 additions and 5 deletions

View File

@ -2,9 +2,10 @@
* floatimg.h * floatimg.h
* ugly code from tTh * ugly code from tTh
* http://la.buvette.org/photos/cumul * http://la.buvette.org/photos/cumul
* https://git.tetalab.org/tTh/FloatImg
*/ */
#define FIMG_VERSION (181) #define FIMG_VERSION (182)
#define RELEASE_NAME ("noname") #define RELEASE_NAME ("noname")
/* /*
* in memory descriptor * in memory descriptor
@ -35,7 +36,7 @@ typedef struct {
typedef struct { typedef struct {
char magic[8]; // this is not an asciiz ! char magic[8]; // this is not an asciiz !
struct timeval timestamp; struct timeval timestamp;
uint64_t pid; // process id of the creator uint64_t cpid; // process id of the creator
int32_t count; int32_t count;
float fval; float fval;
char idcam[32]; char idcam[32];

View File

@ -46,7 +46,7 @@ fprintf(stderr, "seconds sc. epoch = %ld\n", pmd->timestamp.tv_sec);
doubletime = (double)pmd->timestamp.tv_sec + \ doubletime = (double)pmd->timestamp.tv_sec + \
(double)pmd->timestamp.tv_usec / 1e6; (double)pmd->timestamp.tv_usec / 1e6;
fprintf(stderr, "dtime of day = %e\n", doubletime); fprintf(stderr, "dtime of day = %e\n", doubletime);
fprintf(stderr, "creator pid = %ld\n", pmd->pid); fprintf(stderr, "creator pid = %ld\n", pmd->cpid);
fprintf(stderr, "counter = %d\n", pmd->count); fprintf(stderr, "counter = %d\n", pmd->count);
fprintf(stderr, "float value = %.3f\n", pmd->fval); fprintf(stderr, "float value = %.3f\n", pmd->fval);
fprintf(stderr, "id camera = '%s'\n", pmd->idcam); fprintf(stderr, "id camera = '%s'\n", pmd->idcam);
@ -82,7 +82,7 @@ else {
memcpy(&(pmd->timestamp), &tvl, sizeof(struct timeval)); memcpy(&(pmd->timestamp), &tvl, sizeof(struct timeval));
} }
pmd->pid = getpid(); pmd->cpid = getpid();
pmd->count = 0; pmd->count = 0;
pmd->fval = 255.0; pmd->fval = 255.0;
strcpy(pmd->idcam, "<unknow>"); strcpy(pmd->idcam, "<unknow>");
@ -136,7 +136,8 @@ if (1 != foo) {
fclose(fp); /* got all needed datas */ fclose(fp); /* got all needed datas */
if (memcmp(metadata.magic, "metadata", 8)) { if (memcmp(metadata.magic, "metadata", 8)) {
fprintf(stderr, "'%s' invalid metadata.\n", fname); fprintf(stderr, "'%s' invalid metadata\n", fname);
puts_magic_8(metadata.magic, stderr);
return -6; return -6;
} }