Document of c-modernization-kit (util) 1.0.0
Loading...
Searching...
No Matches
trace-file-util.h
Go to the documentation of this file.
1#ifndef TRACE_FILE_UTIL_H
2#define TRACE_FILE_UTIL_H
3
18
19#include <stddef.h>
20
21/* ===== DLL エクスポート / インポート制御マクロ ===== */
22
23#ifdef DOXYGEN
24
38#define TRACE_FILE_UTIL_EXPORT
39
47#define TRACE_FILE_UTIL_API
48
49#else /* !DOXYGEN */
50
51#ifndef _WIN32
52 #define TRACE_FILE_UTIL_EXPORT
53 #define TRACE_FILE_UTIL_API
54#else /* _WIN32 */
55 #ifndef __INTELLISENSE__
56 #ifndef TRACE_FILE_UTIL_STATIC
57 #ifdef TRACE_FILE_UTIL_EXPORTS
58 #define TRACE_FILE_UTIL_EXPORT __declspec(dllexport)
59 #else /* !TRACE_FILE_UTIL_EXPORTS */
60 #define TRACE_FILE_UTIL_EXPORT __declspec(dllimport)
61 #endif /* TRACE_FILE_UTIL_EXPORTS */
62 #else /* TRACE_FILE_UTIL_STATIC */
63 #define TRACE_FILE_UTIL_EXPORT
64 #endif /* TRACE_FILE_UTIL_STATIC */
65 #else /* __INTELLISENSE__ */
66 #define TRACE_FILE_UTIL_EXPORT
67 #endif /* __INTELLISENSE__ */
68 #ifndef TRACE_FILE_UTIL_API
69 #define TRACE_FILE_UTIL_API __stdcall
70 #endif /* TRACE_FILE_UTIL_API */
71#endif /* _WIN32 */
72
73#endif /* DOXYGEN */
74
75/* ===== 設定定数 ===== */
76
83#define TRACE_FILE_DEFAULT_MAX_BYTES ((size_t)(10 * 1024 * 1024))
84
91#define TRACE_FILE_DEFAULT_GENERATIONS 5
92
93/* ===== トレースレベル定数 ===== */
94
98#define TRACE_FILE_LV_CRITICAL 0
100#define TRACE_FILE_LV_ERROR 1
102#define TRACE_FILE_LV_WARNING 2
104#define TRACE_FILE_LV_INFO 3
106#define TRACE_FILE_LV_VERBOSE 4
108
109/* ===== 不透明ハンドル型 ===== */
110
113
114/* ===== API 関数 ===== */
115
116#ifdef __cplusplus
117extern "C"
118{
119#endif /* __cplusplus */
120
150 trace_file_provider_init(const char *path, size_t max_bytes, int generations);
151
166 const char *message);
167
177
178#ifdef __cplusplus
179}
180#endif /* __cplusplus */
181
182#endif /* TRACE_FILE_UTIL_H */
ファイルトレースプロバイダハンドル構造体 (内部定義)。
char * path
ヒープ確保済みファイルパス文字列。
size_t max_bytes
ファイル 1 世代あたりの最大バイト数。
int generations
保持する旧世代数。
TRACE_FILE_UTIL_EXPORT int TRACE_FILE_UTIL_API trace_file_provider_write(trace_file_provider_t *handle, int level, const char *message)
ファイルへトレースメッセージを書き込む。
TRACE_FILE_UTIL_EXPORT trace_file_provider_t *TRACE_FILE_UTIL_API trace_file_provider_init(const char *path, size_t max_bytes, int generations)
ファイルトレースプロバイダを初期化する。
#define TRACE_FILE_UTIL_EXPORT
DLL エクスポート/インポート制御マクロ。
#define TRACE_FILE_UTIL_API
呼び出し規約マクロ。
TRACE_FILE_UTIL_EXPORT void TRACE_FILE_UTIL_API trace_file_provider_dispose(trace_file_provider_t *handle)
ファイルトレースプロバイダを終了する。
struct trace_file_provider trace_file_provider_t
ファイルトレースプロバイダハンドル (不透明型)。