/usr/include/libee/primitivetype.h is in libee-dev 0.3.2-1.
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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | /**
* @file primitivetype.h
* @brief Primitive data types.
* @class ee_primitiveType primitivetype.h
*
*//*
*
* Libee - An Event Expression Library inspired by CEE
* Copyright 2010 by Rainer Gerhards and Adiscon GmbH.
*
* This file is part of libee.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* A copy of the LGPL v2.1 can be found in the file "COPYING" in this distribution.
*/
#ifndef LIBEE_PRIMITIVETYPE_H_INCLUDED
#define LIBEE_PRIMITIVETYPE_H_INCLUDED
/**
* Representation of a primitive data type.
*
* @extends ee_obj
*
* A primitive data type is also called a "base type" in CEE. It is at the root
* of all type hierarchie. Note that libee primitives include types which do
* not seem to be very primitive from a generic programming language type of
* view. For us, primitives are those that are very frequently used on logs.
* We also try to avoid regexes, as these can be very time-consuming. So we
* have things like IPv4Address or FQDN names as primitive types.
*/
struct ee_primitiveType {
struct ee_obj o; /*<< the base object */
int (*parse)(ee_ctx ctx, char *p, struct ee_field* newField);
};
/**
* Constructor for the ee_primitiveType object.
*
* @memberof ee_primitiveType
* @public
*
* @return new library context or NULL if an error occured
*/
struct ee_primitiveType* ee_newPrimitiveType(void);
/**
* Destructor for the ee_primitiveType object.
*
* @memberof ee_primitiveType
* @public
*
* @param primitiveType The primitiveType to be discarded.
*/
void ee_deletePrimitiveType(struct ee_primitiveType *primitiveType);
/**
* Parser interface.
* @param[in] ctx current context
* @param[in] str input string
* @param[in/out] offs offset where parsing has to start inside str.
* Updated on exist. \b Note: if the parser consumed all characters,
* offs equals strlen(str) on exit. This is part of the interface and
* the predicate for the caller to detect end of parsing.
* @param[in] ed string with extra data
* @param[out] newVal new value object created if parsing was successful
* @return 0 on success, something else otherwise
*/
/**
* Parser for RFC5424 date.
*/
int ee_parseRFC5424Date(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parser for RFC3164 date.
*/
int ee_parseRFC3164Date(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parser for numbers.
*/
int ee_parseNumber(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parser for Words (SP-terminated strings).
*/
int ee_parseWord(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parse everything up to a specific character.
*/
int ee_parseCharTo(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parse a quoted string.
*/
int ee_parseQuotedString(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parse an ISO date.
*/
int ee_parseISODate(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parse a timestamp in 12hr format.
*/
int ee_parseTime12hr(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parse a timestamp in 24hr format.
*/
int ee_parseTime24hr(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
/**
* Parser for IPv4 addresses.
*/
int ee_parseIPv4(ee_ctx ctx, es_str_t *str, es_size_t *offs, es_str_t *ed, struct ee_value **newVal);
#endif /* #ifndef LIBEE_PRIMITIVETYPE_H_INCLUDED */
|