/usr/include/collectd/utils_tail.h is in collectd-dev 4.10.1-2.1ubuntu7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | /**
* collectd - src/utils_tail.h
* Copyright (C) 2007-2008 C-Ware, Inc.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; only version 2 of the License is applicable.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* Author:
* Luke Heberling <lukeh at c-ware.com>
*
* DESCRIPTION
* Facilitates reading information that is appended to a file, taking into
* account that the file may be rotated and a new file created under the
* same name.
**/
#ifndef UTILS_TAIL_H
#define UTILS_TAIL_H 1
struct cu_tail_s;
typedef struct cu_tail_s cu_tail_t;
typedef int tailfunc_t(void *data, char *buf, int buflen);
/*
* NAME
* cu_tail_create
*
* DESCRIPTION
* Allocates a new tail object..
*
* PARAMETERS
* `file' The name of the file to be tailed.
*/
cu_tail_t *cu_tail_create (const char *file);
/*
* cu_tail_destroy
*
* Takes a tail object returned by `cu_tail_create' and destroys it, freeing
* all internal memory.
*
* Returns 0 when successful and non-zero otherwise.
*/
int cu_tail_destroy (cu_tail_t *obj);
/*
* cu_tail_readline
*
* Reads from the file until `buflen' characters are read, a newline
* character is read, or an eof condition is encountered. `buf' is
* always null-terminated on successful return and isn't touched when non-zero
* is returned.
*
* You can check if the EOF condition is reached by looking at the buffer: If
* the length of the string stored in the buffer is zero, EOF occurred.
* Otherwise at least the newline character will be in the buffer.
*
* Returns 0 when successful and non-zero otherwise.
*/
int cu_tail_readline (cu_tail_t *obj, char *buf, int buflen);
/*
* cu_tail_readline
*
* Reads from the file until eof condition or an error is encountered.
*
* Returns 0 when successful and non-zero otherwise.
*/
int cu_tail_read (cu_tail_t *obj, char *buf, int buflen, tailfunc_t *callback,
void *data);
#endif /* UTILS_TAIL_H */
|