mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add auto-generated headers.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6290 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
655da7feb4
commit
c27faf98fd
@ -1,3 +1,9 @@
|
|||||||
|
2001-12-09 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/backend/postgres: add autogenerated headers
|
||||||
|
|
||||||
|
* configure.in: add new default warnings
|
||||||
|
|
||||||
2001-12-08 Dave Peticolas <dave@krondo.com>
|
2001-12-08 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
* src/bin/overrides/gnucash-build-env.in: add report-gnome dir
|
* src/bin/overrides/gnucash-build-env.in: add report-gnome dir
|
||||||
|
@ -6,9 +6,12 @@ Makefile
|
|||||||
Makefile.in
|
Makefile.in
|
||||||
a.out
|
a.out
|
||||||
base-autogen.c
|
base-autogen.c
|
||||||
|
base-autogen.h
|
||||||
check-autogen.c
|
check-autogen.c
|
||||||
|
check-autogen.h
|
||||||
functions.c
|
functions.c
|
||||||
kvp-autogen.c
|
kvp-autogen.c
|
||||||
|
kvp-autogen.h
|
||||||
table-audit.c
|
table-audit.c
|
||||||
table-create.c
|
table-create.c
|
||||||
table-drop.c
|
table-drop.c
|
||||||
|
@ -26,11 +26,14 @@ libgncmod_backend_postgres_la_SOURCES = \
|
|||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
PostgresBackend.h \
|
PostgresBackend.h \
|
||||||
account.h \
|
account.h \
|
||||||
|
base-autogen.h \
|
||||||
builder.h \
|
builder.h \
|
||||||
checkpoint.h \
|
checkpoint.h \
|
||||||
|
check-autogen.h \
|
||||||
escape.h \
|
escape.h \
|
||||||
events.h \
|
events.h \
|
||||||
gncquery.h \
|
gncquery.h \
|
||||||
|
kvp-autogen.h \
|
||||||
kvp-sql.h \
|
kvp-sql.h \
|
||||||
price.h \
|
price.h \
|
||||||
putil.h \
|
putil.h \
|
||||||
@ -42,10 +45,13 @@ EXTRA_DIST = \
|
|||||||
.cvsignore \
|
.cvsignore \
|
||||||
README \
|
README \
|
||||||
base-objects.m4 \
|
base-objects.m4 \
|
||||||
|
base-objects-header.m4 \
|
||||||
check-objects.m4 \
|
check-objects.m4 \
|
||||||
|
check-objects-header.m4 \
|
||||||
design.txt \
|
design.txt \
|
||||||
functions.sql \
|
functions.sql \
|
||||||
kvp-objects.m4 \
|
kvp-objects.m4 \
|
||||||
|
kvp-objects-header.m4 \
|
||||||
table.m4 \
|
table.m4 \
|
||||||
table-audit.sql \
|
table-audit.sql \
|
||||||
table-create.sql \
|
table-create.sql \
|
||||||
@ -58,21 +64,27 @@ AM_CFLAGS = -I.. -I../.. -I../../engine -I../../gnc-module ${GLIB_CFLAGS}
|
|||||||
# Some of the required C files are built with the m4 pre-processor
|
# Some of the required C files are built with the m4 pre-processor
|
||||||
# As a result, we need to manually specify dependencies, clean targets.
|
# As a result, we need to manually specify dependencies, clean targets.
|
||||||
|
|
||||||
PostgresBackend.o: base-autogen.c table-audit.c table-create.c table-version.c table-drop.c functions.c
|
PostgresBackend.o: base-autogen.c base-autogen.h table-audit.c table-create.c table-version.c table-drop.c functions.c
|
||||||
PostgresBackend.lo: base-autogen.c table-audit.c table-create.c table-version.c table-drop.c functions.c
|
PostgresBackend.lo: base-autogen.c base-autogen.h table-audit.c table-create.c table-version.c table-drop.c functions.c
|
||||||
|
|
||||||
checkpoint.o: check-autogen.c
|
checkpoint.o: check-autogen.c check-autogen.h
|
||||||
checkpoint.lo: check-autogen.c
|
checkpoint.lo: check-autogen.c check-autogen.h
|
||||||
|
|
||||||
kvp-sql.o: kvp-autogen.c
|
kvp-sql.o: kvp-autogen.c kvp-autogen.h
|
||||||
kvp-sql.lo: kvp-autogen.c
|
kvp-sql.lo: kvp-autogen.c kvp-autogen.h
|
||||||
|
|
||||||
|
base-autogen.h: table.m4 base-objects-header.m4
|
||||||
|
m4 base-objects-header.m4 > base-autogen.h
|
||||||
base-autogen.c: table.m4 base-objects.m4
|
base-autogen.c: table.m4 base-objects.m4
|
||||||
m4 base-objects.m4 > base-autogen.c
|
m4 base-objects.m4 > base-autogen.c
|
||||||
|
|
||||||
|
check-autogen.h: table.m4 check-objects-header.m4
|
||||||
|
m4 check-objects-header.m4 > check-autogen.h
|
||||||
check-autogen.c: table.m4 check-objects.m4
|
check-autogen.c: table.m4 check-objects.m4
|
||||||
m4 check-objects.m4 > check-autogen.c
|
m4 check-objects.m4 > check-autogen.c
|
||||||
|
|
||||||
|
kvp-autogen.h: table.m4 kvp-objects-header.m4
|
||||||
|
m4 kvp-objects-header.m4 > kvp-autogen.h
|
||||||
kvp-autogen.c: table.m4 kvp-objects.m4
|
kvp-autogen.c: table.m4 kvp-objects.m4
|
||||||
m4 kvp-objects.m4 > kvp-autogen.c
|
m4 kvp-objects.m4 > kvp-autogen.c
|
||||||
|
|
||||||
@ -106,5 +118,6 @@ table-version.c: table-version.sql
|
|||||||
cat table-version.sql >> table-version.c
|
cat table-version.sql >> table-version.c
|
||||||
echo \" >> table-version.c
|
echo \" >> table-version.c
|
||||||
|
|
||||||
CLEANFILES = base-autogen.c check-autogen.c kvp-autogen.c \
|
CLEANFILES = base-autogen.c base-autogen.h check-autogen.c check-autogen.h \
|
||||||
|
kvp-autogen.c kvp-autogen.h \
|
||||||
table-drop.c table-create.c table-version.c functions.c
|
table-drop.c table-create.c table-version.c functions.c
|
||||||
|
@ -214,6 +214,7 @@ get_version_cb (PGBackend *be, PGresult *result, int j, gpointer data)
|
|||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
/* include the auto-generated code */
|
/* include the auto-generated code */
|
||||||
|
|
||||||
|
#include "base-autogen.h"
|
||||||
#include "base-autogen.c"
|
#include "base-autogen.c"
|
||||||
|
|
||||||
static const char *table_audit_str =
|
static const char *table_audit_str =
|
||||||
|
39
src/backend/postgres/base-objects-header.m4
Normal file
39
src/backend/postgres/base-objects-header.m4
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
divert(-1)
|
||||||
|
|
||||||
|
/* include definitions for setter macros */
|
||||||
|
include(`table.m4')
|
||||||
|
|
||||||
|
divert
|
||||||
|
|
||||||
|
store_one_only_header(account);
|
||||||
|
store_one_only_header(modity);
|
||||||
|
store_one_only_header(session);
|
||||||
|
store_one_only_header(split);
|
||||||
|
store_one_only_header(transaction);
|
||||||
|
store_one_only_header(price);
|
||||||
|
|
||||||
|
store_audit_header(account);
|
||||||
|
store_audit_header(modity);
|
||||||
|
store_audit_header(split);
|
||||||
|
store_audit_header(transaction);
|
||||||
|
store_audit_header(price);
|
||||||
|
|
||||||
|
compare_one_only_header(account);
|
||||||
|
compare_one_only_header(modity);
|
||||||
|
compare_one_only_header(split);
|
||||||
|
compare_one_only_header(transaction);
|
||||||
|
compare_one_only_header(price);
|
||||||
|
|
||||||
|
put_one_only_header(account);
|
||||||
|
put_one_only_header(modity);
|
||||||
|
put_one_only_header(split);
|
||||||
|
put_one_only_header(transaction);
|
||||||
|
put_one_only_header(price);
|
||||||
|
|
||||||
|
compare_version_header(account);
|
||||||
|
compare_version_header(transaction);
|
||||||
|
compare_version_header(price);
|
||||||
|
|
||||||
|
is_deleted_header(account);
|
||||||
|
is_deleted_header(transaction);
|
||||||
|
is_deleted_header(price);
|
8
src/backend/postgres/check-objects-header.m4
Normal file
8
src/backend/postgres/check-objects-header.m4
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
divert(-1)
|
||||||
|
|
||||||
|
/* include definitions for setter macros */
|
||||||
|
include(`table.m4')
|
||||||
|
|
||||||
|
divert
|
||||||
|
|
||||||
|
store_one_only_header(checkpoint);
|
@ -63,6 +63,7 @@ static short module = MOD_BACKEND;
|
|||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
/* include autogenerated code */
|
/* include autogenerated code */
|
||||||
|
|
||||||
|
#include "check-autogen.h"
|
||||||
#include "check-autogen.c"
|
#include "check-autogen.c"
|
||||||
|
|
||||||
/* ============================================================= */
|
/* ============================================================= */
|
||||||
|
34
src/backend/postgres/kvp-objects-header.m4
Normal file
34
src/backend/postgres/kvp-objects-header.m4
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
divert(-1)
|
||||||
|
|
||||||
|
/* include definitions for setter macros */
|
||||||
|
include(`table.m4')
|
||||||
|
|
||||||
|
divert
|
||||||
|
|
||||||
|
store_one_only_header(kvp_gint64);
|
||||||
|
store_one_only_header(kvp_double);
|
||||||
|
store_one_only_header(kvp_numeric);
|
||||||
|
store_one_only_header(kvp_string);
|
||||||
|
store_one_only_header(kvp_guid);
|
||||||
|
store_one_only_header(kvp_timespec);
|
||||||
|
|
||||||
|
store_audit_header(kvp_gint64);
|
||||||
|
store_audit_header(kvp_double);
|
||||||
|
store_audit_header(kvp_numeric);
|
||||||
|
store_audit_header(kvp_string);
|
||||||
|
store_audit_header(kvp_guid);
|
||||||
|
store_audit_header(kvp_timespec);
|
||||||
|
|
||||||
|
compare_one_only_header(kvp_gint64);
|
||||||
|
compare_one_only_header(kvp_double);
|
||||||
|
compare_one_only_header(kvp_numeric);
|
||||||
|
compare_one_only_header(kvp_string);
|
||||||
|
compare_one_only_header(kvp_guid);
|
||||||
|
compare_one_only_header(kvp_timespec);
|
||||||
|
|
||||||
|
put_one_only_header(kvp_gint64);
|
||||||
|
put_one_only_header(kvp_double);
|
||||||
|
put_one_only_header(kvp_numeric);
|
||||||
|
put_one_only_header(kvp_string);
|
||||||
|
put_one_only_header(kvp_guid);
|
||||||
|
put_one_only_header(kvp_timespec);
|
@ -199,6 +199,7 @@ typedef struct store_data_s {
|
|||||||
} u;
|
} u;
|
||||||
} store_data_t;
|
} store_data_t;
|
||||||
|
|
||||||
|
#include "kvp-autogen.h"
|
||||||
#include "kvp-autogen.c"
|
#include "kvp-autogen.c"
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -219,18 +219,20 @@ define(`version_function', `version_function_r(firstrec($@))')
|
|||||||
|
|
||||||
/* -------- */
|
/* -------- */
|
||||||
|
|
||||||
define(`store_one_only',
|
define(`store_one_only_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine stores/updates one record in the database.
|
/* This routine stores/updates one record in the database.
|
||||||
* It does not do any traversals, it does not lock.
|
* It does not do any traversals, it does not lock.
|
||||||
* It just pokes the data in.
|
* It just pokes the data in.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
pgendStoreOne`'func_name($@)`'Only (PGBackend *be,
|
pgendStoreOne`'func_name($@)`'Only (PGBackend *be,
|
||||||
xacc_type($@) *ptr,
|
xacc_type($@) *ptr,
|
||||||
sqlBuild_QType update)
|
sqlBuild_QType update)')
|
||||||
|
|
||||||
|
define(`store_one_only',
|
||||||
|
`store_one_only_header($@)
|
||||||
{
|
{
|
||||||
const char *buf;
|
const char *buf;
|
||||||
ENTER ("be=%p, xacc_type($@)=%p", be, ptr);
|
ENTER ("be=%p, xacc_type($@)=%p", be, ptr);
|
||||||
@ -250,7 +252,7 @@ pgendStoreOne`'func_name($@)`'Only (PGBackend *be,
|
|||||||
|
|
||||||
')
|
')
|
||||||
|
|
||||||
define(`compare_one_only',
|
define(`compare_one_only_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine returns a positive int if the indicated object
|
/* This routine returns a positive int if the indicated object
|
||||||
@ -258,9 +260,11 @@ define(`compare_one_only',
|
|||||||
* number if theres an error.
|
* number if theres an error.
|
||||||
* It does not do any traversals, it does not lock.
|
* It does not do any traversals, it does not lock.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
pgendCompareOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)
|
pgendCompareOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)')
|
||||||
|
|
||||||
|
define(`compare_one_only',
|
||||||
|
`compare_one_only_header($@)
|
||||||
{
|
{
|
||||||
const char *buf;
|
const char *buf;
|
||||||
PGresult *result;
|
PGresult *result;
|
||||||
@ -296,16 +300,18 @@ pgendCompareOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)
|
|||||||
|
|
||||||
')
|
')
|
||||||
|
|
||||||
define(`put_one_only',
|
define(`put_one_only_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine inserts or updates, as appropriate
|
/* This routine inserts or updates, as appropriate
|
||||||
* It does not do any traversals, it does not lock.
|
* It does not do any traversals, it does not lock.
|
||||||
* It just updates.
|
* It just updates.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
pgendPutOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)
|
pgendPutOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)')
|
||||||
|
|
||||||
|
define(`put_one_only',
|
||||||
|
`put_one_only_header($@)
|
||||||
{
|
{
|
||||||
int ndiffs;
|
int ndiffs;
|
||||||
ndiffs = pgendCompareOne`'func_name($@)`'Only (be, ptr);
|
ndiffs = pgendCompareOne`'func_name($@)`'Only (be, ptr);
|
||||||
@ -326,7 +332,7 @@ pgendPutOne`'func_name($@)`'Only (PGBackend *be, xacc_type($@) *ptr)
|
|||||||
|
|
||||||
')
|
')
|
||||||
|
|
||||||
define(`compare_version',
|
define(`compare_version_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine compares the version number of the object in
|
/* This routine compares the version number of the object in
|
||||||
@ -336,9 +342,11 @@ define(`compare_version',
|
|||||||
* if the sql version is newer. It returns zero if the
|
* if the sql version is newer. It returns zero if the
|
||||||
* two are equal.
|
* two are equal.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
pgend`'func_name($@)`'CompareVersion (PGBackend *be, xacc_type($@) *ptr)
|
pgend`'func_name($@)`'CompareVersion (PGBackend *be, xacc_type($@) *ptr)')
|
||||||
|
|
||||||
|
define(`compare_version',
|
||||||
|
`compare_version_header($@)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int sql_version = 0;
|
int sql_version = 0;
|
||||||
@ -356,7 +364,7 @@ pgend`'func_name($@)`'CompareVersion (PGBackend *be, xacc_type($@) *ptr)
|
|||||||
|
|
||||||
')
|
')
|
||||||
|
|
||||||
define(`is_deleted',
|
define(`is_deleted_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine looks at the audit trail to see if the
|
/* This routine looks at the audit trail to see if the
|
||||||
@ -364,9 +372,11 @@ define(`is_deleted',
|
|||||||
* it returns the version number of the deleted object;
|
* it returns the version number of the deleted object;
|
||||||
* otherwise it returns -1.
|
* otherwise it returns -1.
|
||||||
*/
|
*/
|
||||||
|
int
|
||||||
|
pgend`'func_name($@)`'GetDeletedVersion (PGBackend *be, xacc_type($@) *ptr)')
|
||||||
|
|
||||||
int
|
define(`is_deleted',
|
||||||
pgend`'func_name($@)`'GetDeletedVersion (PGBackend *be, xacc_type($@) *ptr)
|
`is_deleted_header($@)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
int sql_version = -1;
|
int sql_version = -1;
|
||||||
@ -383,18 +393,20 @@ pgend`'func_name($@)`'GetDeletedVersion (PGBackend *be, xacc_type($@) *ptr)
|
|||||||
|
|
||||||
')
|
')
|
||||||
|
|
||||||
define(`store_audit',
|
define(`store_audit_header',
|
||||||
`
|
`
|
||||||
/* ------------------------------------------------------ */
|
/* ------------------------------------------------------ */
|
||||||
/* This routine stores one autdit record in the database.
|
/* This routine stores one autdit record in the database.
|
||||||
* It does not do any traversals, it does not lock.
|
* It does not do any traversals, it does not lock.
|
||||||
* It just pokes the data in.
|
* It just pokes the data in.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
pgendStoreAudit`'func_name($@)`' (PGBackend *be,
|
pgendStoreAudit`'func_name($@)`' (PGBackend *be,
|
||||||
xacc_type($@) *ptr,
|
xacc_type($@) *ptr,
|
||||||
sqlBuild_QType update)
|
sqlBuild_QType update)')
|
||||||
|
|
||||||
|
define(`store_audit',
|
||||||
|
`store_audit_header($@)
|
||||||
{
|
{
|
||||||
const char *buf;
|
const char *buf;
|
||||||
ENTER ("be=%p, xacc_type($@)=%p", be, ptr);
|
ENTER ("be=%p, xacc_type($@)=%p", be, ptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user