Graphviz 14.1.3~dev.20260227.0545
Loading...
Searching...
No Matches
debug.h
Go to the documentation of this file.
1
3
4#pragma once
5
6#include <stddef.h>
7#include <stdio.h>
8#include <string.h>
9#include <time.h>
10#include <util/lockfile.h>
11
15#define GV_INFO(...) \
16 do { \
17 if (Verbose) { \
18 const char *const name_ = strrchr(__FILE__, '/') == NULL \
19 ? __FILE__ \
20 : strrchr(__FILE__, '/') + 1; \
21 lockfile(stderr); \
22 const time_t now_ = time(NULL); \
23 const struct tm *const now_tm_ = localtime(&now_); \
24 fprintf(stderr, "[Graphviz] %s:%d: %04d-%02d-%02d %02d:%02d:%02d ", \
25 name_, __LINE__, now_tm_->tm_year + 1900, now_tm_->tm_mon + 1, \
26 now_tm_->tm_mday, now_tm_->tm_hour, now_tm_->tm_min, \
27 now_tm_->tm_sec); \
28 fprintf(stderr, __VA_ARGS__); \
29 fprintf(stderr, "\n"); \
30 unlockfile(stderr); \
31 } \
32 } while (0)
33
40#define GV_DEBUG(...) GV_INFO(__VA_ARGS__)
platform abstraction over flockfile