File.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #ifndef SQUID_SRC_LOG_FILE_H
10 #define SQUID_SRC_LOG_FILE_H
11 
12 #include "cbdata.h"
13 #include "dlink.h"
14 
15 #if HAVE_SYS_PARAM_H
16 #include <sys/param.h>
17 #endif
18 
20 {
21 public:
22  char *buf;
23  int size;
24  int len;
27 };
28 
29 class Logfile;
30 
31 typedef void LOGLINESTART(Logfile *);
32 typedef void LOGWRITE(Logfile *, const char *, size_t len);
33 typedef void LOGLINEEND(Logfile *);
34 typedef void LOGFLUSH(Logfile *);
35 typedef void LOGROTATE(Logfile *, const int16_t);
36 typedef void LOGCLOSE(Logfile *);
37 
38 class Logfile
39 {
41 
42 public:
43  explicit Logfile(const char *aPath);
44  ~Logfile() {}
45 
47 
48  struct {
49  unsigned int fatal;
50  } flags;
51 
52  int64_t sequence_number;
53 
54 public:
55  void *data;
56 
63 };
64 
65 /* Legacy API */
66 Logfile *logfileOpen(const char *path, size_t bufsz, int);
67 void logfileClose(Logfile * lf);
68 void logfileRotate(Logfile * lf, int16_t rotateCount);
69 void logfileWrite(Logfile * lf, char *buf, size_t len);
70 void logfileFlush(Logfile * lf);
71 void logfilePrintf(Logfile * lf, const char *fmt,...) PRINTF_FORMAT_ARG2;
72 void logfileLineStart(Logfile * lf);
73 void logfileLineEnd(Logfile * lf);
74 
75 #endif /* SQUID_SRC_LOG_FILE_H */
76 
LOGFLUSH * f_flush
Definition: File.h:60
void logfileLineStart(Logfile *lf)
Definition: File.cc:134
~Logfile()
Definition: File.h:44
LOGWRITE * f_linewrite
Definition: File.h:58
void logfileFlush(Logfile *lf)
Definition: File.cc:147
Definition: File.h:38
CBDATA_CLASS(Logfile)
unsigned int fatal
Definition: File.h:49
#define MAXPATHLEN
Definition: stdio.h:62
int64_t sequence_number
Unique sequence number per log line.
Definition: File.h:52
void LOGROTATE(Logfile *, const int16_t)
Definition: File.h:35
void logfilePrintf(Logfile *lf, const char *fmt,...) PRINTF_FORMAT_ARG2
Definition: File.cc:112
#define PRINTF_FORMAT_ARG2
int written_len
Definition: File.h:25
LOGLINEEND * f_lineend
Definition: File.h:59
dlink_node node
Definition: File.h:26
void * data
Definition: File.h:55
char path[MAXPATHLEN]
Definition: File.h:46
void LOGLINESTART(Logfile *)
Definition: File.h:31
char * buf
Definition: File.h:22
void LOGWRITE(Logfile *, const char *, size_t len)
Definition: File.h:32
Logfile * logfileOpen(const char *path, size_t bufsz, int)
Definition: File.cc:38
void logfileWrite(Logfile *lf, char *buf, size_t len)
Definition: File.cc:106
int unsigned int const char *desc STUB void int len
Definition: stub_fd.cc:20
void const char * buf
Definition: stub_helper.cc:16
LOGLINESTART * f_linestart
Definition: File.h:57
void LOGFLUSH(Logfile *)
Definition: File.h:34
struct Logfile::@85 flags
Logfile(const char *aPath)
Definition: File.cc:23
void logfileClose(Logfile *lf)
Definition: File.cc:90
LOGROTATE * f_rotate
Definition: File.h:61
void LOGCLOSE(Logfile *)
Definition: File.h:36
void LOGLINEEND(Logfile *)
Definition: File.h:33
void logfileRotate(Logfile *lf, int16_t rotateCount)
Definition: File.cc:99
void logfileLineEnd(Logfile *lf)
Definition: File.cc:140
LOGCLOSE * f_close
Definition: File.h:62

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors