Patch level :
Files correlati : Ricompilazione Demo : [ ] Commento : anagiu.h Aggiunte #define campi anagr.h Aggiunte #define campi applicat.cpp Aggiunto nome Tools a programmi apparteneti a moduli ignoti assoc.* Spostato out of line il distruttore dei THash_object cfven.h Aggiunte #define campi checks.* Aggiunte funzioni di trace per la memoria libera git-svn-id: svn://10.65.10.50/trunk@6946 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
6ecab4b3e0
commit
3adc6b1566
@ -2,9 +2,11 @@
|
|||||||
#define __ANAGIU_H
|
#define __ANAGIU_H
|
||||||
|
|
||||||
#define ANG_CODANAGR "CODANAGR"
|
#define ANG_CODANAGR "CODANAGR"
|
||||||
#define ANG_NATGIU "NATGIU"
|
|
||||||
#define ANG_COMRES "COMRES"
|
#define ANG_COMRES "COMRES"
|
||||||
//#define ANG_TIPOA "TIPOA"
|
|
||||||
|
#define ANG_NATGIU "NATGIU"
|
||||||
|
#define ANG_STATOSOC "STATOSOC"
|
||||||
|
#define ANG_SITSOC "SITSOC"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,21 +1,25 @@
|
|||||||
#ifndef __ANAGR_H
|
#ifndef __ANAGR_H
|
||||||
#define __ANAGR_H
|
#define __ANAGR_H
|
||||||
|
|
||||||
#define ANA_TIPOA "TIPOA"
|
#define ANA_TIPOA "TIPOA"
|
||||||
#define ANA_CODANAGR "CODANAGR"
|
#define ANA_CODANAGR "CODANAGR"
|
||||||
#define ANA_PAIV "PAIV"
|
#define ANA_PAIV "PAIV"
|
||||||
#define ANA_COFI "COFI"
|
#define ANA_COFI "COFI"
|
||||||
#define ANA_RAGSOC "RAGSOC"
|
#define ANA_RAGSOC "RAGSOC"
|
||||||
#define ANA_STATORES "STATORES"
|
#define ANA_STATORES "STATORES"
|
||||||
#define ANA_COMRES "COMRES"
|
#define ANA_COMRES "COMRES"
|
||||||
#define ANA_INDRES "INDRES"
|
#define ANA_INDRES "INDRES"
|
||||||
#define ANA_CIVRES "CIVRES"
|
#define ANA_CIVRES "CIVRES"
|
||||||
#define ANA_CAPRES "CAPRES"
|
#define ANA_CAPRES "CAPRES"
|
||||||
#define ANA_COMRF "COMRF"
|
#define ANA_COMRF "COMRF"
|
||||||
#define ANA_INDRF "INDRF"
|
#define ANA_INDRF "INDRF"
|
||||||
#define ANA_CIVRF "CIVRF"
|
#define ANA_CIVRF "CIVRF"
|
||||||
#define ANA_CAPRF "CAPRF"
|
#define ANA_CAPRF "CAPRF"
|
||||||
#define ANA_SOGGNRES "SOGGNRES"
|
#define ANA_SOGGNRES "SOGGNRES"
|
||||||
|
#define ANA_PTELRF "PTELRF"
|
||||||
|
#define ANA_TELRF "TELRF"
|
||||||
|
#define ANA_DVARSLORES "DVARSLORES"
|
||||||
|
#define ANA_DVARDF "DVARDF"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -440,6 +440,8 @@ const char* TApplication::get_module_name() const
|
|||||||
ok = has_module(aut);
|
ok = has_module(aut);
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
|
if (module.empty())
|
||||||
|
module = "Tools";
|
||||||
TToken_string em(extra_modules());
|
TToken_string em(extra_modules());
|
||||||
if (!em.empty_items())
|
if (!em.empty_items())
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
// @ccost:(INTERNAL) HASH_SIZE | 883 | Dimensione della tabella hash
|
// @ccost:(INTERNAL) HASH_SIZE | 883 | Dimensione della tabella hash
|
||||||
const int HASH_SIZE = 883;
|
const int HASH_SIZE = 883;
|
||||||
|
|
||||||
|
THash_object::~THash_object()
|
||||||
|
{
|
||||||
|
if (_obj != NULL)
|
||||||
|
delete _obj;
|
||||||
|
}
|
||||||
|
|
||||||
TArray& TAssoc_array::bucket(int index)
|
TArray& TAssoc_array::bucket(int index)
|
||||||
{
|
{
|
||||||
TArray* arr = (TArray*)_bucket.objptr(index);
|
TArray* arr = (TArray*)_bucket.objptr(index);
|
||||||
@ -129,7 +135,7 @@ TObject* TAssoc_array::pred_item()
|
|||||||
// @rdesc Ritorna TRUE se esisteva gia' un elemento con la stessa chiave
|
// @rdesc Ritorna TRUE se esisteva gia' un elemento con la stessa chiave
|
||||||
bool TAssoc_array::add(
|
bool TAssoc_array::add(
|
||||||
const char* key, // @parm Chiave d'ordinamento
|
const char* key, // @parm Chiave d'ordinamento
|
||||||
TObject* obj, // @parm Ogetto da inserire (default=NULL)
|
TObject* obj, // @parm Oggetto da inserire (default=NULL)
|
||||||
bool force) // @parm Permette di forzare l'inserimento se esiste gia'
|
bool force) // @parm Permette di forzare l'inserimento se esiste gia'
|
||||||
// un oggetto con la stessa chiave
|
// un oggetto con la stessa chiave
|
||||||
|
|
||||||
|
@ -39,11 +39,9 @@ public:
|
|||||||
THash_object(const char* k, TObject* o = NULL) : _key(k), _obj(o)
|
THash_object(const char* k, TObject* o = NULL) : _key(k), _obj(o)
|
||||||
{}
|
{}
|
||||||
// @cmember Distruttore
|
// @cmember Distruttore
|
||||||
virtual ~THash_object()
|
virtual ~THash_object();
|
||||||
{ if (_obj != NULL) delete _obj; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
// @class TAssoc_array | Tabella hash di oggetti generici
|
// @class TAssoc_array | Tabella hash di oggetti generici
|
||||||
|
@ -67,5 +67,7 @@
|
|||||||
#define CFV_VSDATAREG "VSDATAREG"
|
#define CFV_VSDATAREG "VSDATAREG"
|
||||||
#define CFV_NSPROT "NSNPROT"
|
#define CFV_NSPROT "NSNPROT"
|
||||||
#define CFV_NSDATAREG "NSDATAREG"
|
#define CFV_NSDATAREG "NSDATAREG"
|
||||||
|
#define CFV_SCONTOCL "SCONTOCL"
|
||||||
|
#define CFV_SCONTOR "SCONTOR"
|
||||||
|
#define CFV_CODSCINC "CODSCINC"
|
||||||
#endif
|
#endif
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <xvtility.h>
|
#include <xvtility.h>
|
||||||
#endif
|
#endif
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <os_dep.h>
|
||||||
#endif /* XVT */
|
#endif /* XVT */
|
||||||
|
|
||||||
|
|
||||||
@ -291,17 +292,25 @@ bool __trace(
|
|||||||
//
|
//
|
||||||
// @rdesc Ritorna non 0 se riesca ad aprire il file trace.log
|
// @rdesc Ritorna non 0 se riesca ad aprire il file trace.log
|
||||||
{
|
{
|
||||||
buildmsg();
|
static FILE* f = NULL;
|
||||||
FILE* f = fopen("trace.log", "a");
|
if (f == NULL)
|
||||||
|
f = fopen("trace.log", "w");
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
{
|
{
|
||||||
|
buildmsg();
|
||||||
fprintf(f, "%s\n", msg);
|
fprintf(f, "%s\n", msg);
|
||||||
fclose(f);
|
fflush(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return f != NULL;
|
return f != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool __tracemem(const char* msg)
|
||||||
|
{
|
||||||
|
unsigned long mem = os_get_free_memory() / 1024;
|
||||||
|
return __trace("%5lu Kb - %s", mem, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#else // FOXPRO
|
#else // FOXPRO
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -18,6 +18,7 @@ extern "C" {
|
|||||||
int yesnocancel_box(const char* fmt, ...);
|
int yesnocancel_box(const char* fmt, ...);
|
||||||
bool yesnofatal_box(const char* fmt, ...);
|
bool yesnofatal_box(const char* fmt, ...);
|
||||||
bool __trace(const char* fmt, ...);
|
bool __trace(const char* fmt, ...);
|
||||||
|
bool __tracemem(const char* fmt);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -94,8 +95,10 @@ extern "C" {
|
|||||||
|
|
||||||
// @msg TRACE | Macro che richiama la funzione <m __trace>
|
// @msg TRACE | Macro che richiama la funzione <m __trace>
|
||||||
#define TRACE __trace
|
#define TRACE __trace
|
||||||
|
#define TRACEMEM(msg) __tracemem(msg)
|
||||||
#else
|
#else
|
||||||
#define TRACE 1 ? 0 : __trace
|
#define TRACE 1 ? 0 : __trace
|
||||||
|
#define TRACEMEM(msg) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __CHECKS_H
|
#endif // __CHECKS_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user