From e4956873b0ca4ec732e009f88be43549506f7819 Mon Sep 17 00:00:00 2001 From: Dmitri Pal Date: Mon, 29 Mar 2010 16:58:29 -0400 Subject: Adding metadata interface This patch: 1) Adds the definition of the metadata interface to the header file. The functions that were exposed for no good reason are now hidden. 2) Previously exposed functions and their descriptions are removed from the public header and placed into the source code for now. 3) The function that reads the config file no longer tries to close file in case of error. 4) Lines collection is still passed in into the reading function but as a collection itself not as a pointer to it. 5) All the parts related to processing lines are currently ifdefed using HAVE_VALIDATION that is currently is not defined. This is done to disable creation of the lines collection utill it is actually needed. I did not want to blindly remove it though and loose already done work that will be useful in future. 6) Version of the library and interface is updated 7) New header and source modules are introduced to hold functions related to the meta data. They are mostly stubbed out. This is incomplete patch. It builds and make check runs. It is created just to simplify the review a bit. --- common/ini/ini_metadata.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 common/ini/ini_metadata.h (limited to 'common/ini/ini_metadata.h') diff --git a/common/ini/ini_metadata.h b/common/ini/ini_metadata.h new file mode 100644 index 00000000..2839453a --- /dev/null +++ b/common/ini/ini_metadata.h @@ -0,0 +1,42 @@ +/* + INI LIBRARY + + Header file for the meta data related functions. + + Copyright (C) Dmitri Pal 2009 + + INI 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 3 of the License, or + (at your option) any later version. + + INI 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 INI Library. If not, see . +*/ + +#ifndef INI_METADATA_H +#define INI_METADATA_H + +#include +#include +#include "collection.h" + + +/* Prepare metadata */ +int prepare_metadata(uint32_t metaflags, + struct collection_item **metadata, + int *save_error); + +/* Collect metadata for the file */ +int collect_metadata(uint32_t metaflags, + struct collection_item **metadata, + FILE *config_file); + + + +#endif -- cgit