gnats/gnats/ds-file Makefile.in db.c ds-file.h ...
Mel Hatzis <[email protected]> Sat, 23 Apr 2005 01:15:21 -0400
| Newsgroups | gmane.comp.bug-tracking.gnats.cvs |
|---|---|
| Message-ID | <[email protected]> |
CVSROOT: /cvsroot/gnats Module name: gnats Branch: Changes by: Mel Hatzis <[email protected]> 05/04/23 05:15:21 Added files: gnats/ds-file : Makefile.in db.c ds-file.h fld.c index.c index.h pr.c t-fconfig Log message: * configure.in: Added the beginnings for supporting multiple backend datastores. A lot of the funtionality dealing directly with the flat-file datastore has been moved into it's own library (libds-file.a) which is pulled in unconditionally for now - since there are no alternative backend datastores to configure. * Makefile.in: Moved most of the logic dealing with the flat-file backend into a ds-file sub-directory for which we generate a libds-file.a library. Modified all binary targets to link against this library - the name of the datastore library to link with is actually supplied by configure. Note that the index file is now part of the flat-file datastore library; GNATS_LIBS now includes a $(DS_LIB) macro defined by configure; a ds-libs target has been added for building the datastore library; fconfig.y is now generated (see the note about fconfig.y below). * ds.mk: New file. Used to generate the Makefile in all datastore implementations. Contains all the common elements of a datastore Makefile. * aclocal.m4: Regenerated. * autoconf.h.in: Regenerated. * configure: Regenerated. * cmds.c (do_server_query, GNATS_lock, GNATS_unlk, GNATS_edit): Function renames for the datastore API - iterate_prs, prExists and readPRWithNum renamed to db_query, pr_exists and pr_load_by_id respectively. The renames are to conform to a standard naming convention used by the datastore API to assist with datastore implementation. (GNATS_rset): Removed references to the index, which is now only relevant when GNATS if configured with the flat-file datastore. This change involves a modification to the message accompanying the return code when the index is reloaded - since the index is no longer always relevant, it makes no sense for the GNATS server to refer to it in the client/server protocol. * database.c (struct databaseInfo, newDatabaseInfo): Replaced indexDesc with a void ds_private pointer which is intended to cache any datastore specific information (such as the indexDesc). The indexDesc is now defined and exclusively used in the flat-file datastore library and is pulled in via ds_private when needed. (getIndexDesc, setIndexDesc, clearIndexDesc): Moved to index.c in the flat-file datastore library since this is no longer generically relevant. (getDatastorePrivate, setDatastorePrivate): New functions. Used for managing the datastore specific database elements such as the index in the flat-file datastore implementation. (loadDatabase): Replaced all flat-file datastore specific functionality with a new "db_init" function which is part of the new GNATS datastore API. (freeDatabaseInfo): Replaced all references to functions which free the index with a call to a new "db_destroy" function which is part of the new GNATS datastore API. * database.h (setIndexDesc, setDatastorePrivate): Replaced setIndexDesc with setDatastorePrivate - setIndexDesc now declared in ds-file/index.h. Any datastore specific configuration elements defined in the dbconfig (via ds-file/t-fconfig) are cached in the DatabaseInfo struct via setDatastorePrivate. (getIndexDesc, getDatastorePrivate): Replaced getIndexDesc with getDatastorePrivate - getIndexDesc now declared in ds-file/index.h. * edit.c (processPRChanges): No need to check if the PR has been completely read into memory...all callers of this function do so. Furthermore, the idea of reading a PR partially is not desirable for a generalized backend datastore. (rewrite_pr): Moved all the logic associated with reading/writing to a PR file and dealing with the index into a new 'pr_update' function in ds-file/pr.c. (replace_pr): Renamed prExists to pr_exists, readPRWithNum to pr_load_by_id and fillInPR with pr_load. These functions are all part of the datastore API and have been renamed for clarity. * ds-file/t-fconfig, fconfig.y, fconfig.y.in: fconfig.y renamed to fconfig.y.in which no longer contains any datastore specific grammar. The datastore specific items are now pulled in from a t-fconfig file located in the ds-file directory. The fconfig.y file is generated by concatenating fconfig.y.in with t-fconfig. To accomodate this, fconfig.y.in now contains a dsDescription section which all datastore's must define. * file-pr.c (createNewPRFile): Renamed to createNewPR since we'll eventually be using alternatives to files for the backend. Also, moved all the logic associated with reading/writing to a PR file dealing with the index into a new 'pr_create' function in ds-file/pr.c. (run_atpr): Pass in an int for the PR number since we no longer refer to a string representation of it in createNewPR. (checkIfReply, append_report): Function renames for datastore API. (getBugNumber): Moved to ds-file/pr.c - only relevant to flat-file datastore. (submit_pr): Function rename for multiple backend datastore support. * gnats.h: No longer pull in index.h...this is only used for the flat-file datastore. * index.c, index.h, ds-file/index.c, ds-file/index.h: Moved the index.[ch] files into the new ds-file sub-directory which implements the flat-file backend datastore. The index is now only applicable if GNATS is configured with the flat-file backend datastore. All references to the index in the DatabaseInfo and PR data structures have been replaced with an opaque 'ds_private' field, which is used to cache all datastore specific data. The getIndexDesc/setIndexDesc function definitions were moved out of database.c into index.c since these functions are specific to the flat-file datastore. * pr.c (allocPR): Replaced allocIndex with a call to the new pr_init function in the datastore API. The flat-file datastore implementation of pr_init is where allocIndex is now called. Also handle the case where there are no fields in the dbconfig without corrupting memory. (get_pr, get_pr_from_index, get_pr_path, pr_file_readable): These functions have been relocated to ds-file/pr.c since they are specific to the flat-file datastore. (fillInPR): Renamed to pr_load and moved to ds-file/pr.c since the implementation of this function is datastore specific. (field_value): Replaced the call to indexValue which retrieves the field value from the flat-file index with a datastore API function call named field_cache_value. This allows for datastore implementations to utilize a cache (such as the flat-file index), for keeping some field values in memory. (free_pr): Replaced calls related to freeing the index with a new datastore API function named pr_destroy. The flat-file datastore implementation of pr_destroy is where the index is now free'd. (prExists): Renamed to pr_exists and moved to ds-file/pr.c since the implementation of this function is datastore specific. (readPRWithNum): Renamed to pr_load_by_id and moved to ds-file/pr.c since the implementation of this function is datastore specific. (pr_delete): Moved to ds-file/pr.c since the implementation of this function is datastore specific. * pr.h (PR_struct): Replaced the index pointer with an opaque pointer to a struct containing datastore specific data. The index is now defined within this opaque datastore data structure only when GNATS is linked with the flat-file datastore library. (fillInPR): Renamed to pr_load and moved to ds.h. * query.h (index.h): Removed index.h since the index is no longer a generic part of the GNATS datastore; index.h is now only pulled in when GNATS is configured with the flat-file backend. (*QueryItem, SearchItem, *QueryTree, struct queryExpr): Imported from query.c since these is required by the datastore library. (*QueryFunc): Moved to ds.h since this is an integral part of the datastore query functionality from which it is referenced. (iterate_prs): Renamed to db_query and moved to ds.h since this is now a part of the GNATS backend datastore API. The function was renamed to conform to a standard naming convention used by the datastore API to assist with datastore implementation. * query.c (*QueryItem, SearchItem, *QueryTree, struct queryExpr): Moved to query.h since these are now referenced from the datastore library. (fieldCompare, process_format): The index is now only relevant when GNATS is configured with the flat-file backend. The check for whether a PR is only partially in memory or whether we're only referencing an indexed field is no longer relevant in all cases. The datastore is now responsible for implementing a partial PR cache (such as the index). (pr_matches_tree): No longer a static - referenced by the datastore backend. (iterate_prs): Renamed to db_query and moved into the datastore library - this is a member of the datastore API. * ds.h: New File. Contains function declarations for all functions implementing the GNATS datastore API. All datastore implementations are required to define these functions. * ds-file/Makefile.in, ds-file/ds-file.h, ds-file/db.c, ds-file/pr.c, ds-file/fld.c: New files. Collectively implement the GNATS flat-file datastore. * gen-index.c: We will eventually only build this as part of the flat-file datastore. For now, pull in the index include file from the ds-file directory. * getclose.c (do_prlist): Reworked so as not to use the flat-file index. Use a query to get the relevant PRs for processing. * pr-age.c (main): Function rename for multiple backend datastore. * pr-edit.c (main): Function renames for multiple backend datastore. * query-pr.c (main): Function renames for multiple backend datastore. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/Makefile.in?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/db.c?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/ds-file.h?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/fld.c?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/index.c?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/index.h?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/pr.c?rev=1.1 http://savannah.gnu.org/cgi-bin/viewcvs/gnats/gnats/gnats/ds-file/t-fconfig?rev=1.1