summaryrefslogtreecommitdiffstats
path: root/src/procfile.h
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 16:09:37 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-04-30 18:09:45 +0000
commitbed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521 (patch)
tree519e5945ec0db75bfb50583539caa408a5819e87 /src/procfile.h
parentTemporarily disable signature checking (diff)
downloadnetdata-bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521.tar.xz
netdata-bed7e5b6a0b9ea0ddfc76c6f77eb91df81b92521.zip
New upstream version 1.6.0+dfsg
Diffstat (limited to '')
-rw-r--r--src/procfile.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/procfile.h b/src/procfile.h
index a586ba48..98765697 100644
--- a/src/procfile.h
+++ b/src/procfile.h
@@ -58,15 +58,25 @@ typedef struct {
#define PROCFILE_FLAG_DEFAULT 0x00000000
#define PROCFILE_FLAG_NO_ERROR_ON_FILE_IO 0x00000001
+typedef enum procfile_separator {
+ PF_CHAR_IS_SEPARATOR,
+ PF_CHAR_IS_NEWLINE,
+ PF_CHAR_IS_WORD,
+ PF_CHAR_IS_QUOTE,
+ PF_CHAR_IS_OPEN,
+ PF_CHAR_IS_CLOSE
+} PF_CHAR_TYPE;
+
typedef struct {
- char filename[FILENAME_MAX + 1];
+ char filename[FILENAME_MAX + 1]; // not populated until profile_filename() is called
+
uint32_t flags;
int fd; // the file desriptor
size_t len; // the bytes we have placed into data
size_t size; // the bytes we have allocated for data
pflines *lines;
pfwords *words;
- char separators[256];
+ PF_CHAR_TYPE separators[256];
char data[]; // allocated buffer to keep file contents
} procfile;
@@ -89,6 +99,8 @@ extern void procfile_print(procfile *ff);
extern void procfile_set_quotes(procfile *ff, const char *quotes);
extern void procfile_set_open_close(procfile *ff, const char *open, const char *close);
+extern char *procfile_filename(procfile *ff);
+
// ----------------------------------------------------------------------------
// set this to 1, to have procfile adapt its initial buffer allocation to the max allocation used so far