From b07200963de2eafce5d8c96e248195d0813f5fa0 Mon Sep 17 00:00:00 2001 From: matteo Date: Wed, 22 Nov 1995 13:38:58 +0000 Subject: [PATCH] Aggiunti campi Memo git-svn-id: svn://10.65.10.50/trunk@2191 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- include/codeb.c | 24 ++++++++++++++++++++++++ include/codeb.h | 5 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/include/codeb.c b/include/codeb.c index b90339400..8ced240b2 100755 --- a/include/codeb.c +++ b/include/codeb.c @@ -830,6 +830,11 @@ int DB_build(const char * filename, RecDes *r) case _datefld: field_info[i].type=r4date; break; + case _memofld: + field_info[i].type=r4memo; + field_info[i].len = 10; + field_info[i].dec = 0; + break; case _charfld: default: field_info[i].type=r4str; @@ -1038,3 +1043,22 @@ long DB_changed(int handle) return(i4changed(i)); } + +char* DB_memoptr( const int handle, const char * fieldname ) +{ + FIELD4 * f; + f = d4field( dbdata[ handle ], ( char *)fieldname ); + return f4memo_ptr( f ); +} + +int DB_memowrite( const int handle, const char * fieldname, const char * data ) +{ + int ret; + + FIELD4 * f; + f = d4field( dbdata[ handle ], fieldname ); + ret = f4memo_assign( f, ( char * )data ); + d4flush_data( dbdata[ handle ] ); + return ret; +} + diff --git a/include/codeb.h b/include/codeb.h index 3a81a8cd5..8e180bf90 100755 --- a/include/codeb.h +++ b/include/codeb.h @@ -48,6 +48,7 @@ extern "C" { int DB_delkey(int handle, char* key, long recno); int DB_flush(int handle); int DB_rewrite(int handle); + bool DB_has_memo(int handle); int DB_add(int handle); int DB_lockfile(int handle); /* Per sbloccare il record basta la DB_unlock()*/ int DB_packfile(short vis, const char * filename, long eod); @@ -58,7 +59,9 @@ extern "C" { int DB_index_seek(int handle, char* from); long DB_index_recno(int handle); long DB_index_next(int handle); - char* DB_index_getkey(int handle); + char* DB_index_getkey(int handle); + char* DB_memoptr(const int handle, const char * fieldname ); + int DB_memowrite(const int handle, const char * fieldname, const char * data ) ; int DB_index_eof(int handle); int DB_lock_rec(int handle,long nrec); int DB_file_locked(int handle);