Open SCAP Library
|
00001 /* 00002 * Copyright 2009 Red Hat Inc., Durham, North Carolina. 00003 * All Rights Reserved. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 * 00019 * Authors: 00020 * "Daniel Kopecek" <dkopecek@redhat.com> 00021 */ 00022 00023 #pragma once 00024 #ifndef SEXP_DATATYPE 00025 #define SEXP_DATATYPE 00026 00027 #include <stdarg.h> 00028 #include <stdint.h> 00029 #include <sexp.h> 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 typedef void (*SEXP_datatypeOP_t) (SEXP_t *, const SEXP_t *, void *); 00036 00037 typedef struct SEXP_datatype SEXP_datatype_t; 00038 typedef struct SEXP_datatypeTbl SEXP_datatypeTbl_t; 00039 00040 extern SEXP_datatypeTbl_t g_datatypes; 00041 00042 /* const char *SEXP_datatype (const SEXP_t *sexp); */ 00043 00044 int SEXP_datatype_register (SEXP_datatypeTbl_t *t, const char *datatype); 00045 /* int SEXP_datatype_unregister (void); */ 00046 00047 int SEXP_datatype_op (uint8_t op, const SEXP_t *sexp, void *res, ...); 00048 int SEXP_datatype_op_safe (const char *datatype, uint8_t op, const SEXP_t *sexp, void *res, ...); 00049 00050 SEXP_datatype_t *SEXP_datatype_new(void); 00051 int SEXP_datatype_setflag(SEXP_datatype_t **dp, uint16_t flag, ...); 00052 int SEXP_datatype_unsetflag(SEXP_datatype_t **dp, uint16_t flag); 00053 int SEXP_datatype_addop(SEXP_datatype_t **dp, int opnum, SEXP_datatypeOP_t *op); 00054 int SEXP_datatype_delop(SEXP_datatype_t **dp, int opnum); 00055 00056 #ifdef __cplusplus 00057 } 00058 #endif 00059 00060 #endif /* SEXP_DATATYPE */