Blame src/samp.h

Packit 1422b7
/**
Packit 1422b7
 * @file samples.h
Packit 1422b7
 * @brief Object to process log samples.
Packit 1422b7
 * @author Rainer Gerhards
Packit 1422b7
 *
Packit 1422b7
 * This object handles log samples, and in actual log sample files.
Packit 1422b7
 * It co-operates with the ptree object to build the actual parser tree.
Packit 1422b7
 *//*
Packit 1422b7
 *
Packit 1422b7
 * liblognorm - a fast samples-based log normalization library
Packit 1422b7
 * Copyright 2010-2015 by Rainer Gerhards and Adiscon GmbH.
Packit 1422b7
 *
Packit 1422b7
 * This file is part of liblognorm.
Packit 1422b7
 *
Packit 1422b7
 * This library is free software; you can redistribute it and/or
Packit 1422b7
 * modify it under the terms of the GNU Lesser General Public
Packit 1422b7
 * License as published by the Free Software Foundation; either
Packit 1422b7
 * version 2.1 of the License, or (at your option) any later version.
Packit 1422b7
 *
Packit 1422b7
 * This library is distributed in the hope that it will be useful,
Packit 1422b7
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 1422b7
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 1422b7
 * Lesser General PublicCH License for more details.
Packit 1422b7
 *
Packit 1422b7
 * You should have received a copy of the GNU Lesser General Public
Packit 1422b7
 * License along with this library; if not, write to the Free Software
Packit 1422b7
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 1422b7
 *
Packit 1422b7
 * A copy of the LGPL v2.1 can be found in the file "COPYING" in this distribution.
Packit 1422b7
 */
Packit 1422b7
#ifndef LIBLOGNORM_SAMPLES_H_INCLUDED
Packit 1422b7
#define	LIBLOGNORM_SAMPLES_H_INCLUDED
Packit 1422b7
#include <stdio.h>	/* we need es_size_t */
Packit 1422b7
#include <libestr.h>
Packit 1422b7
Packit 1422b7
Packit 1422b7
/**
Packit 1422b7
 * A single log sample.
Packit 1422b7
 */
Packit 1422b7
struct ln_samp {
Packit 1422b7
	es_str_t *msg;
Packit 1422b7
};
Packit 1422b7
Packit 1422b7
void ln_sampFree(ln_ctx ctx, struct ln_samp *samp);
Packit 1422b7
int ln_sampLoad(ln_ctx ctx, const char *file);
Packit 1422b7
int ln_sampLoadFromString(ln_ctx ctx, const char *string);
Packit 1422b7
Packit 1422b7
/* dual-use funtions for v1 engine */
Packit 1422b7
void ln_sampSkipCommentLine(ln_ctx ctx, FILE * const __restrict__ repo, const char **inpbuf);
Packit 1422b7
int ln_sampChkRunawayRule(ln_ctx ctx, FILE *const __restrict__ repo, const char **inpbuf);
Packit 1422b7
Packit 1422b7
#endif /* #ifndef LIBLOGNORM_SAMPLES_H_INCLUDED */