[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ossec-cvs] ossec-hids: hash_op.h (NEW) math_op.h (NEW) shared.h (HEAD) [dcid]
Module name: ossec-hids
Changes by: dcid 07/08/16 21:03:24
Modified files:
shared.h
Added files:
hash_op.h math_op.h
Log message:
Description: Adding headers for hash_op and math_op libs.
Reviewed by: dcid
Bug:
--- NEW FILE: hash_op.h ---
/* @(#) $Id: hash_op.h,v 1.1 2007/08/17 00:03:24 dcid Exp $ */
/* Copyright (C) 2003-2007 Daniel B. Cid <dcid@xxxxxxxxx>
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License (version 3) as published by the FSF - Free Software
* Foundation.
*
* License details at the LICENSE file included with OSSEC or
* online at: http://www.ossec.net/en/licensing.html
*/
/* Common API for dealing with directory trees */
#ifndef _OS_HASHOP
#define _OS_HASHOP
/* Node structure */
typedef struct _OSHashNode
{
struct _OSHashNode *next;
void *key;
void *data;
}OSHashNode;
typedef struct _OSHash
{
unsigned int rows;
unsigned int initial_seed;
unsigned int constant;
OSHashNode **table;
}OSHash;
/** Prototypes **/
/** OSHash *OSHash_Create();
* Creates and initializes hash.
*/
OSHash *OSHash_Create();
/** void OSHash_Add(OSHash *hash, char *key, void *data)
* Returns 0 on error.
* Returns 1 on duplicated key (not added)
* Returns 2 on success
* Key must not be NULL.
*/
int OSHash_Add(OSHash *hash, char *key, void *data);
/** void *OSHash_Get(OSHash *self, char *key)
* Returns NULL on error (key not found).
* Returns the key otherwise.
* Key must not be NULL.
*/
void *OSHash_Get(OSHash *self, char *key);
#endif
/* EOF */
--- NEW FILE: math_op.h ---
/* @(#) $Id: math_op.h,v 1.1 2007/08/17 00:03:24 dcid Exp $ */
/* Copyright (C) 2007 Daniel B. Cid <dcid@xxxxxxxxx>
* All rights reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
* License (version 3) as published by the FSF - Free Software
* Foundation
*
* License details at the LICENSE file included with OSSEC or
* online at: http://www.ossec.net/en/licensing.html
*/
#ifndef H_MATHOP_OS
#define H_MATHOP_OS
/** int os_getprime
* Get the first available prime after the provided value.
* Returns 0 on error.
*/
int os_getprime(int val);
#endif
/* EOF */
Index: shared.h
===================================================================
RCS file: /usr/cvsroot/ossec-hids/src/headers/shared.h,v
diff -u -r1.35 -r1.36
--- shared.h 10 Aug 2007 00:56:22 -0000 1.35
+++ shared.h 17 Aug 2007 00:03:24 -0000 1.36
@@ -172,6 +172,7 @@
#include "wait_op.h"
#include "file_op.h"
#include "mem_op.h"
+#include "math_op.h"
#include "mq_op.h"
#include "privsep_op.h"
#include "pthreads_op.h"
@@ -179,6 +180,7 @@
#include "sig_op.h"
#include "list_op.h"
#include "dirtree_op.h"
+#include "hash_op.h"
#include "store_op.h"
#include "rc.h"
#include "ar.h"
OSSEC home |
Main Index |
Thread Index
OSSEC project: www.ossec.net.
Mailling list information: http://www.ossec.net/en/mailing_lists.html.