Eliminate tutte le dipendenze dal sistema operativo ricorrendo
all'header os_dep.h git-svn-id: svn://10.65.10.50/trunk@6249 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
5fd426004a
commit
d70d456f1e
125
ba/ba0.cpp
125
ba/ba0.cpp
@ -1,18 +1,14 @@
|
|||||||
#define STRICT
|
|
||||||
#define XVT_INCL_NATIVE
|
|
||||||
|
|
||||||
#include <xinclude.h>
|
#include <xinclude.h>
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <msksheet.h>
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
|
#include <msksheet.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <stack.h>
|
#include <stack.h>
|
||||||
#include <tabutil.h>
|
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
|
|
||||||
@ -553,7 +549,7 @@ bool TMenuitem::enabled() const
|
|||||||
for (int e = 0; ext[e]; e++)
|
for (int e = 0; ext[e]; e++)
|
||||||
{
|
{
|
||||||
name.ext(ext[e]);
|
name.ext(ext[e]);
|
||||||
if (fexist(name))
|
if (name.exist())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
yes = ext[e] != NULL;
|
yes = ext[e] != NULL;
|
||||||
@ -988,7 +984,6 @@ protected: // TApplication
|
|||||||
virtual bool create();
|
virtual bool create();
|
||||||
virtual bool destroy();
|
virtual bool destroy();
|
||||||
virtual bool menu(MENU_TAG m);
|
virtual bool menu(MENU_TAG m);
|
||||||
virtual bool build_firm_data(long cod, bool flagcom = FALSE);
|
|
||||||
virtual long handler(WINDOW win, EVENT* ep);
|
virtual long handler(WINDOW win, EVENT* ep);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -1018,120 +1013,6 @@ inline TMenu_application& app()
|
|||||||
{ return (TMenu_application&)main_app(); }
|
{ return (TMenu_application&)main_app(); }
|
||||||
|
|
||||||
|
|
||||||
bool TMenu_application::build_firm_data(long codditta, bool flagcom)
|
|
||||||
{
|
|
||||||
const char * const ndir = "/dir.gen";
|
|
||||||
const char * const ntrc = "/trc.gen";
|
|
||||||
TFilename s(firm2dir(codditta)); s << ndir;
|
|
||||||
bool exist = fexist(s);
|
|
||||||
|
|
||||||
if (!exist)
|
|
||||||
{
|
|
||||||
s = s.path(); s.rtrim(1); s << ntrc;
|
|
||||||
exist = fexist(s);
|
|
||||||
}
|
|
||||||
if (exist)
|
|
||||||
return message_box("Direttorio dati danneggiato, impossibile attivare la ditta %ld", codditta);
|
|
||||||
if (!yesno_box("Gli archivi della ditta %ld non esistono: si desidera generarli?", codditta))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
TLocalisamfile ditte(LF_NDITTE);
|
|
||||||
ditte.zero();
|
|
||||||
ditte.put(NDT_CODDITTA,codditta);
|
|
||||||
if (ditte.read(_isequal,_testandlock) == _islocked)
|
|
||||||
{
|
|
||||||
message_box("Archivi della ditta %ld in fase di creazione da parte di un altro utente.",codditta);
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
set_autoload_new_files(yesno_box("Si desidera precaricare gli archivi standard"));
|
|
||||||
s = s.path(); s.rtrim(1);
|
|
||||||
|
|
||||||
if (!fexist(s) && !make_dir(s))
|
|
||||||
return error_box("Impossibile creare il direttorio della ditta %ld (%s)",
|
|
||||||
codditta, (const char*)s);
|
|
||||||
|
|
||||||
s << ndir;
|
|
||||||
if (!fcopy(&ndir[1], s))
|
|
||||||
return error_box("Impossibile copiare il file %s della ditta %ld",
|
|
||||||
&ndir[1], codditta);
|
|
||||||
s = s.path(); s << ntrc;
|
|
||||||
if (!fcopy(&ntrc[1], s))
|
|
||||||
return error_box("Impossibile copiare il file %s della ditta %ld",
|
|
||||||
ntrc, codditta);
|
|
||||||
|
|
||||||
TDir dir, dir1;
|
|
||||||
TTrec rec;
|
|
||||||
|
|
||||||
prefix().set("");
|
|
||||||
dir1.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
|
||||||
const long maxeod0 = dir1.eod();
|
|
||||||
|
|
||||||
prefix().set_codditta(codditta);
|
|
||||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
|
||||||
if (dir.eod() == 0)
|
|
||||||
{
|
|
||||||
dir1.eod() = 1L;
|
|
||||||
dir1.put(LF_DIR, _nordir, _sysdirop);
|
|
||||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
|
||||||
}
|
|
||||||
const long maxeod1 = dir.eod();
|
|
||||||
|
|
||||||
if (maxeod0 > maxeod1)
|
|
||||||
{
|
|
||||||
dir.get(LF_DIR, _nolock, _nordir, _sysdirop);
|
|
||||||
dir.eod() = maxeod0;
|
|
||||||
dir.put(LF_DIR, _nordir, _sysdirop);
|
|
||||||
rec.zero();
|
|
||||||
}
|
|
||||||
TString mess("Generazione archivi della ditta "); mess << codditta;
|
|
||||||
TProgind p(maxeod0 ? maxeod0 : 1, mess, FALSE, TRUE, 70);
|
|
||||||
|
|
||||||
for (int i = LF_DIR + 1; i <= maxeod0; i++)
|
|
||||||
{
|
|
||||||
p.addstatus(1);
|
|
||||||
prefix().set("");
|
|
||||||
dir.get(i, _nolock, _nordir, _sysdirop);
|
|
||||||
rec.get(i);
|
|
||||||
bool create_now = dir.is_active();
|
|
||||||
|
|
||||||
prefix().set_codditta(codditta);
|
|
||||||
dir.put(i, _nordir, _sysdirop);
|
|
||||||
rec.put(i);
|
|
||||||
const char* name = dir.name();
|
|
||||||
dir.flags() = 0L;
|
|
||||||
create_now = create_now && (flagcom ? dir.is_com() : dir.is_firm());
|
|
||||||
|
|
||||||
if (dir.is_valid() && create_now)
|
|
||||||
{
|
|
||||||
TSystemisamfile f(i);
|
|
||||||
f.build(30);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dir.put(i, _nordir, _sysdirop);
|
|
||||||
rec.put(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
TConfig c(CONFIG_STUDIO, "cg");
|
|
||||||
|
|
||||||
if (c.get_bool("StiReg"))
|
|
||||||
{
|
|
||||||
TTable reg("REG");
|
|
||||||
for (reg.first(_lock); reg.good(); reg.next(_lock))
|
|
||||||
{
|
|
||||||
reg.put("B9", "X");
|
|
||||||
reg.rewrite();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ditte.reread(_unlock);
|
|
||||||
|
|
||||||
set_firm(codditta);
|
|
||||||
set_autoload_new_files(TRUE);
|
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
bool TMenu_application::menu_item_handler(TMask_field&f, KEY k)
|
||||||
{
|
{
|
||||||
@ -1390,13 +1271,11 @@ bool TMenu_application::check_user()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
|
||||||
if (ok && utente != "PRASSI")
|
if (ok && utente != "PRASSI")
|
||||||
{
|
{
|
||||||
TConfig prawin(CONFIG_INSTALL, "Main");
|
TConfig prawin(CONFIG_INSTALL, "Main");
|
||||||
prawin.set("User", utente);
|
prawin.set("User", utente);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
123
ba/ba1100.cpp
123
ba/ba1100.cpp
@ -1,39 +1,21 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <share.h>
|
#include <share.h>
|
||||||
|
|
||||||
// Serve per GetFreeSpace
|
|
||||||
#define XVT_INCL_NATIVE
|
|
||||||
#define STRICT
|
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <extcdecl.h>
|
||||||
|
#include <execp.h>
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
|
#include <os_dep.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <printer.h>
|
#include <printer.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <urldefid.h>
|
#include <urldefid.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
#include <validate.h>
|
|
||||||
#include <extcdecl.h>
|
|
||||||
#include <execp.h>
|
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
#include "ba1100.h"
|
#include "ba1100.h"
|
||||||
|
|
||||||
#if XVT_OS==XVT_OS_SCOUNIX
|
|
||||||
#define DIRSIZ 14
|
|
||||||
struct direct
|
|
||||||
{
|
|
||||||
unsigned short d_ino;
|
|
||||||
char d_name[DIRSIZ];
|
|
||||||
};
|
|
||||||
#else
|
|
||||||
#include <errno.h>
|
|
||||||
#include <dos.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define History_file "conv.his"
|
#define History_file "conv.his"
|
||||||
#define Dir_file "dir.gen"
|
#define Dir_file "dir.gen"
|
||||||
#define Trc_file "trc.gen"
|
#define Trc_file "trc.gen"
|
||||||
@ -105,49 +87,6 @@ HIDDEN bool browse_file_handler(TMask_field& f, KEY k)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
HIDDEN void build_filelist(const char *path, TArray & list)
|
|
||||||
{
|
|
||||||
#if XVT_OS==XVT_OS_SCOUNIX
|
|
||||||
struct directx
|
|
||||||
{
|
|
||||||
ino_t d_ino;
|
|
||||||
char d_name[DIRSIZ + 1];
|
|
||||||
} dlink;
|
|
||||||
int fd;
|
|
||||||
|
|
||||||
if ((fd = open(path, 0)) == -1)
|
|
||||||
return;
|
|
||||||
dlink.d_name[DIRSIZ] = '\0';
|
|
||||||
while(read(fd, &dlink, sizeof(struct direct)) ==
|
|
||||||
sizeof(struct direct))
|
|
||||||
{
|
|
||||||
if (dlink.d_ino > 0)
|
|
||||||
{
|
|
||||||
TFixed_string dname(dlink.d_name);
|
|
||||||
|
|
||||||
if (dname.find(".des") > 0 && dname[0] == 'd' && !isdigit(dname[1]))
|
|
||||||
list.add(dname.mid(1,3));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
close(fd);
|
|
||||||
#else
|
|
||||||
_find_t f;
|
|
||||||
|
|
||||||
if (_dos_findfirst("recdesc/d???.des", _A_NORMAL, &f) == 0)
|
|
||||||
{
|
|
||||||
bool one_to_add = TRUE;
|
|
||||||
while (one_to_add)
|
|
||||||
{
|
|
||||||
TString80 dname(f.name);
|
|
||||||
|
|
||||||
if (!isdigit(dname[1]))
|
|
||||||
list.add(dname.mid(1,3));
|
|
||||||
one_to_add = _dos_findnext(&f) == 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
TManutenzione_app::TManutenzione_app() : _browse(NULL), _rec(NULL), _mask(NULL), _firm(0), _level(0)
|
TManutenzione_app::TManutenzione_app() : _browse(NULL), _rec(NULL), _mask(NULL), _firm(0), _level(0)
|
||||||
{
|
{
|
||||||
if (!fexist(Dir_file)) // controlla l'esistenza dei direttori standard (dir.gen e trc.gen)
|
if (!fexist(Dir_file)) // controlla l'esistenza dei direttori standard (dir.gen e trc.gen)
|
||||||
@ -334,16 +273,17 @@ void TManutenzione_app::print()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete pi;
|
delete pi;
|
||||||
TArray list;
|
|
||||||
|
|
||||||
build_filelist(DESCDIR, list);
|
TString_array list;
|
||||||
items = list.items();
|
items = list_files("recdesc/d???.des", list);
|
||||||
|
|
||||||
pi = new TProgind(items,"Stampa descrizione tabelle", TRUE, TRUE, 63);
|
pi = new TProgind(items,"Stampa descrizione tabelle", TRUE, TRUE, 63);
|
||||||
|
|
||||||
|
TString16 tab;
|
||||||
for (i = 0; !pi->iscancelled() && i < items; i++)
|
for (i = 0; !pi->iscancelled() && i < items; i++)
|
||||||
{
|
{
|
||||||
TString & tab = (TString &) list[i];
|
tab = list.row(i).right(7);
|
||||||
|
tab.cut(3);
|
||||||
TRec_sheet r(4, tab);
|
TRec_sheet r(4, tab);
|
||||||
|
|
||||||
pi->addstatus(1);
|
pi->addstatus(1);
|
||||||
@ -556,12 +496,7 @@ void TManutenzione_app::dump_trc(const char * dir, const bool des_too, const lon
|
|||||||
const char* TManutenzione_app::dumpfilename(const FileDes& dep) const
|
const char* TManutenzione_app::dumpfilename(const FileDes& dep) const
|
||||||
{
|
{
|
||||||
TFilename n; n.tempdir();
|
TFilename n; n.tempdir();
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
n.add(dep.SysName);
|
||||||
n << '/';
|
|
||||||
#else
|
|
||||||
n << '\\';
|
|
||||||
#endif
|
|
||||||
n << dep.SysName;
|
|
||||||
n.strip("$%");
|
n.strip("$%");
|
||||||
n.ext("txt");
|
n.ext("txt");
|
||||||
n.lower();
|
n.lower();
|
||||||
@ -700,7 +635,7 @@ void TManutenzione_app::edit_riga (long riga_sel, TToken_string& riga)
|
|||||||
f.packfile();
|
f.packfile();
|
||||||
f.packindex();
|
f.packindex();
|
||||||
//Pack supplementare tramite FOXPRO (da togliere con CodeBase 6)
|
//Pack supplementare tramite FOXPRO (da togliere con CodeBase 6)
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_WIN32
|
||||||
if (logicnum > 2 && logicnum < 6 && f.status() == NOERR)
|
if (logicnum > 2 && logicnum < 6 && f.status() == NOERR)
|
||||||
if (fexist("packaga.exe"))
|
if (fexist("packaga.exe"))
|
||||||
{
|
{
|
||||||
@ -814,9 +749,7 @@ void TManutenzione_app::update_dir()
|
|||||||
prompt = "Aggiornamento direttorio ";
|
prompt = "Aggiornamento direttorio ";
|
||||||
if (is_com) prompt << "comune";
|
if (is_com) prompt << "comune";
|
||||||
else prompt << " della ditta " << atol(pref) <<".";
|
else prompt << " della ditta " << atol(pref) <<".";
|
||||||
#if XVT_OS == XVT_OS_WIN
|
prompt << " Memoria libera: " << long(os_get_free_memory()/1024) << " Kbytes.";
|
||||||
prompt << " Memoria libera: " << (long)GetFreeSpace(0)/1024 << " Kbytes.";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TProgind p(update_items ? update_items : 1, prompt, FALSE, TRUE, 70);
|
TProgind p(update_items ? update_items : 1, prompt, FALSE, TRUE, 70);
|
||||||
p.setstatus(1);
|
p.setstatus(1);
|
||||||
@ -1075,9 +1008,7 @@ void TManutenzione_app::convert_dir()
|
|||||||
if (is_com) s << "comuni.";
|
if (is_com) s << "comuni.";
|
||||||
else s << "della ditta " << atol (pref) << ".";
|
else s << "della ditta " << atol (pref) << ".";
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
s << " Memoria libera: " << long(os_get_free_memory()/1024) << " Kbytes.";
|
||||||
s << " Memoria libera: " << (long)GetFreeSpace(0)/1024 << " Kbytes.";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TProgind p(update_items ? update_items : 1, s, FALSE, TRUE, 70);
|
TProgind p(update_items ? update_items : 1, s, FALSE, TRUE, 70);
|
||||||
p.setstatus(1);
|
p.setstatus(1);
|
||||||
@ -1201,11 +1132,8 @@ void TManutenzione_app::load_des()
|
|||||||
TFilename fn;
|
TFilename fn;
|
||||||
TDir td,new_dir;
|
TDir td,new_dir;
|
||||||
TTrec tr;
|
TTrec tr;
|
||||||
#if XVT_OS == XVT_OS_WIN
|
|
||||||
struct _find_t c_file;
|
|
||||||
#endif
|
|
||||||
int ln = items,last_newln = items;
|
int ln = items,last_newln = items;
|
||||||
bool firstime = TRUE,ok;
|
|
||||||
tr.zero();
|
tr.zero();
|
||||||
fn << DESCDIR << "/level.dir";
|
fn << DESCDIR << "/level.dir";
|
||||||
|
|
||||||
@ -1219,22 +1147,18 @@ void TManutenzione_app::load_des()
|
|||||||
//unlink(fn);
|
//unlink(fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// scandisce *.dir in RECDESC tramite dos_findfirst e _dos_findnext
|
// scandisce *.dir in RECDESC
|
||||||
// eventuali "buchi" oltre al numero attuale di items vengono rimpiazzati
|
// eventuali "buchi" oltre al numero attuale di items vengono rimpiazzati
|
||||||
// con tracciati vuoti.
|
// con tracciati vuoti.
|
||||||
|
|
||||||
fn.format("%s/f*.dir",DESCDIR);
|
fn.format("%s/f*.dir",DESCDIR);
|
||||||
#if XVT_OS == XVT_OS_WIN
|
|
||||||
do
|
TString_array list;
|
||||||
{
|
const int totfiles = list_files(fn, list);
|
||||||
if (firstime)
|
|
||||||
{
|
for (int n = 0; n < totfiles; n++)
|
||||||
ok = _dos_findfirst(fn, _A_NORMAL, &c_file ) == 0;
|
|
||||||
firstime = FALSE;
|
|
||||||
}
|
|
||||||
fn.format("%s/%s",DESCDIR,c_file.name);
|
|
||||||
if (ok)
|
|
||||||
{
|
{
|
||||||
|
fn = list.row(n);
|
||||||
infile.open(fn);
|
infile.open(fn);
|
||||||
infile >> td;
|
infile >> td;
|
||||||
ln = td.num();
|
ln = td.num();
|
||||||
@ -1256,8 +1180,6 @@ void TManutenzione_app::load_des()
|
|||||||
infile.close();
|
infile.close();
|
||||||
//unlink(fn);
|
//unlink(fn);
|
||||||
}
|
}
|
||||||
} while( _dos_findnext( &c_file ) == 0 );
|
|
||||||
#endif
|
|
||||||
// Aggiorna il numero di files presenti in totale nel direttorio
|
// Aggiorna il numero di files presenti in totale nel direttorio
|
||||||
if (last_newln > items) // rialloca openf altrimenti la TPrefix::closeall() provoca un grazioso errore in applicazione
|
if (last_newln > items) // rialloca openf altrimenti la TPrefix::closeall() provoca un grazioso errore in applicazione
|
||||||
{
|
{
|
||||||
@ -1401,9 +1323,8 @@ void TManutenzione_app::update()
|
|||||||
const TRecnotype rec = ditte.recno();
|
const TRecnotype rec = ditte.recno();
|
||||||
const long codditta = ditte.get_long("CODDITTA");
|
const long codditta = ditte.get_long("CODDITTA");
|
||||||
mxs = s;
|
mxs = s;
|
||||||
#if XVT_OS == XVT_OS_WIN
|
mxs << " Ditta " << codditta << ". Memoria libera: "
|
||||||
mxs << " Ditta " << codditta << ". Memoria libera: " << (long)GetFreeSpace(0)/1024 << " Kbytes.";
|
<< long(os_get_free_memory()/1024) << " Kbytes.";
|
||||||
#endif
|
|
||||||
p.addstatus(1);
|
p.addstatus(1);
|
||||||
p.set_text(mxs);
|
p.set_text(mxs);
|
||||||
if (codditta > _history_firm && prefix().exist(codditta))
|
if (codditta > _history_firm && prefix().exist(codditta))
|
||||||
|
@ -797,7 +797,7 @@ bool TAttivazione_moduli::aggiorna_listino_handler(TMask_field& fld, KEY key)
|
|||||||
TInstall_ini ini;
|
TInstall_ini ini;
|
||||||
TFilename name = ini.get("DiskPath");
|
TFilename name = ini.get("DiskPath");
|
||||||
name.add(ini.default_name());
|
name.add(ini.default_name());
|
||||||
while (!fexist(name))
|
while (!name.exist())
|
||||||
{
|
{
|
||||||
TMask msk("Aggiornamento listino", 1, -1, -1, 60, 4);
|
TMask msk("Aggiornamento listino", 1, -1, -1, 60, 4);
|
||||||
msk.add_string(DLG_USER, 0, "Percorso", 1, 1, 50);
|
msk.add_string(DLG_USER, 0, "Percorso", 1, 1, 50);
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
#include <dos.h>
|
|
||||||
|
|
||||||
#define XVT_INCL_NATIVE
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
|
#include <defmask.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
#include <golem.h>
|
#include <golem.h>
|
||||||
#include <msksheet.h>
|
#include <msksheet.h>
|
||||||
|
#include <os_dep.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <urldefid.h>
|
|
||||||
#include <utility.h>
|
|
||||||
|
|
||||||
#include <text.h>
|
#include <text.h>
|
||||||
|
#include <utility.h>
|
||||||
|
|
||||||
#include "ba1.h"
|
#include "ba1.h"
|
||||||
#include "ba1600.h"
|
#include "ba1600.h"
|
||||||
@ -991,22 +988,12 @@ bool TFascicolator_mask::move_file(const TFilename& file, const char* dir) const
|
|||||||
bool space_ok = FALSE;
|
bool space_ok = FALSE;
|
||||||
while (!space_ok)
|
while (!space_ok)
|
||||||
{
|
{
|
||||||
int disk = 0;
|
space_ok = ::os_test_disk_free_space(dest, filesize);
|
||||||
if (dest[1] == ':')
|
|
||||||
{
|
|
||||||
const char letter = toupper(dest[0]);
|
|
||||||
disk = 'A' - letter + 1;
|
|
||||||
}
|
|
||||||
struct _diskfree_t drive;
|
|
||||||
_dos_getdiskfree(disk, &drive);
|
|
||||||
|
|
||||||
const unsigned requested_clusters = unsigned(filesize / drive.sectors_per_cluster / drive.bytes_per_sector) + 1;
|
|
||||||
space_ok = requested_clusters <= drive.avail_clusters;
|
|
||||||
if (!space_ok)
|
if (!space_ok)
|
||||||
{
|
{
|
||||||
TString msg(128);
|
TString msg(128);
|
||||||
msg << "Lo spazio sull'unita' e' insufficiente";
|
msg << "Lo spazio sull'unita' e' insufficiente";
|
||||||
if (GetDriveType(disk-1) == DRIVE_REMOVABLE)
|
if (::os_is_removable_drive(dest))
|
||||||
{
|
{
|
||||||
msg << ":\nInserire un nuovo disco e ritentare?";
|
msg << ":\nInserire un nuovo disco e ritentare?";
|
||||||
if (!yesno_box(msg))
|
if (!yesno_box(msg))
|
||||||
@ -1267,13 +1254,12 @@ bool TFascicolator_mask::zip_module(const TString& main_module, bool agg, int pa
|
|||||||
ini.set("Dischi", disks, main_module); // Aggiorna install.ini
|
ini.set("Dischi", disks, main_module); // Aggiorna install.ini
|
||||||
ini.export_paragraph(main_module, sommario); // Aggiorna sommario
|
ini.export_paragraph(main_module, sommario); // Aggiorna sommario
|
||||||
|
|
||||||
const char drive = toupper(path[0]);
|
const bool floppy = ::os_is_removable_drive(path);
|
||||||
const bool floppy = (GetDriveType(drive - 'A') == DRIVE_REMOVABLE) && (path[1] == ':');
|
|
||||||
|
|
||||||
for (int d = 1; d <= disks && !aborted; d++)
|
for (int d = 1; d <= disks && !aborted; d++)
|
||||||
{
|
{
|
||||||
if (floppy)
|
if (floppy)
|
||||||
message_box("Inserire il disco %d di %d nell'unita' %c:", d, disks, drive);
|
message_box("Inserire il disco %d di %d nell'unita':", d, disks);
|
||||||
|
|
||||||
// Costruisco il nome del file da copiare su dischetto
|
// Costruisco il nome del file da copiare su dischetto
|
||||||
TFilename src(archivio);
|
TFilename src(archivio);
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
#include <dos.h>
|
|
||||||
|
|
||||||
#define XVT_INCL_NATIVE
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <colors.h>
|
||||||
#include <execp.h>
|
#include <execp.h>
|
||||||
|
#include <os_dep.h>
|
||||||
#include <progind.h>
|
#include <progind.h>
|
||||||
#include <sheet.h>
|
#include <sheet.h>
|
||||||
#include <utility.h>
|
#include <utility.h>
|
||||||
@ -13,6 +11,7 @@
|
|||||||
#include "ba1500.h"
|
#include "ba1500.h"
|
||||||
#include "ba1600.h"
|
#include "ba1600.h"
|
||||||
#include "ba1700a.h"
|
#include "ba1700a.h"
|
||||||
|
|
||||||
// definizioni delle colonne dello sheet
|
// definizioni delle colonne dello sheet
|
||||||
#define C_MODULE 1
|
#define C_MODULE 1
|
||||||
#define C_CODE 2
|
#define C_CODE 2
|
||||||
@ -24,14 +23,6 @@
|
|||||||
#define C_CURRDATAREL 8
|
#define C_CURRDATAREL 8
|
||||||
#define C_ISPATCH 9
|
#define C_ISPATCH 9
|
||||||
|
|
||||||
HIDDEN int noyes_box(const char* msg)
|
|
||||||
{
|
|
||||||
MessageBeep(MB_ICONQUESTION);
|
|
||||||
int r = MessageBox(GetFocus(), msg, "RICHIESTA",
|
|
||||||
MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2);
|
|
||||||
return r == IDYES;
|
|
||||||
}
|
|
||||||
|
|
||||||
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
|
HIDDEN int compare_version(const char* v1, int p1, const char* v2, int p2)
|
||||||
{
|
{
|
||||||
TString16 ver1(v1), ver2(v2);
|
TString16 ver1(v1), ver2(v2);
|
||||||
@ -419,16 +410,13 @@ bool TInstaller_mask::move_file(const TFilename& from, const TFilename& file, co
|
|||||||
const char letter = toupper(dest[0]);
|
const char letter = toupper(dest[0]);
|
||||||
disk = 'A' - letter + 1;
|
disk = 'A' - letter + 1;
|
||||||
}
|
}
|
||||||
struct _diskfree_t drive;
|
|
||||||
_dos_getdiskfree(disk, &drive);
|
|
||||||
|
|
||||||
const unsigned requested_clusters = unsigned(filesize / drive.sectors_per_cluster / drive.bytes_per_sector) + 1;
|
space_ok = ::os_test_disk_free_space(dest, filesize);
|
||||||
space_ok = requested_clusters <= drive.avail_clusters;
|
|
||||||
if (!space_ok)
|
if (!space_ok)
|
||||||
{
|
{
|
||||||
TString msg;
|
TString msg;
|
||||||
msg << "Lo spazio sull'unita' e' insufficiente";
|
msg << "Lo spazio sull'unita' e' insufficiente";
|
||||||
if (GetDriveType(disk-1) == DRIVE_REMOVABLE)
|
if (::os_is_removable_drive(dest))
|
||||||
{
|
{
|
||||||
msg << ":\nInserire un nuovo disco e ritentare?";
|
msg << ":\nInserire un nuovo disco e ritentare?";
|
||||||
if (!yesno_box(msg))
|
if (!yesno_box(msg))
|
||||||
@ -558,11 +546,8 @@ bool TInstaller_mask::install(const TString& module, int patchlevel)
|
|||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
struct _diskfree_t drive;
|
|
||||||
_dos_getdiskfree(0, &drive);
|
|
||||||
const long required = fsize(cmdline) * (dischi-d+1) * 4;
|
const long required = fsize(cmdline) * (dischi-d+1) * 4;
|
||||||
const unsigned requested_clusters = unsigned(required / drive.sectors_per_cluster / drive.bytes_per_sector) + 1;
|
if (::os_test_disk_free_space("", required))
|
||||||
if (requested_clusters >= drive.avail_clusters)
|
|
||||||
{
|
{
|
||||||
ok = yesno_box("Lo spazio su disco potrebbe essere insufficiente:\n"
|
ok = yesno_box("Lo spazio su disco potrebbe essere insufficiente:\n"
|
||||||
"Si desidera continuare ugualmente?");
|
"Si desidera continuare ugualmente?");
|
||||||
@ -859,8 +844,7 @@ TInstaller_mask::TInstaller_mask()
|
|||||||
set(F_PATH, path);
|
set(F_PATH, path);
|
||||||
|
|
||||||
const char lettera = toupper(path[0]);
|
const char lettera = toupper(path[0]);
|
||||||
const bool floppy = (path.len() > 1) && path[1] == ':' &&
|
const bool floppy = ::os_is_removable_drive(path);
|
||||||
GetDriveType(lettera - 'A') == DRIVE_REMOVABLE;
|
|
||||||
if (path.not_empty() && !floppy)
|
if (path.not_empty() && !floppy)
|
||||||
autoload();
|
autoload();
|
||||||
|
|
||||||
|
@ -17,10 +17,6 @@ int main(int argc, char** argv)
|
|||||||
rt = ba2100(argc, argv); break;
|
rt = ba2100(argc, argv); break;
|
||||||
case 1:
|
case 1:
|
||||||
rt = ba2200(argc, argv); break;
|
rt = ba2200(argc, argv); break;
|
||||||
#if XVT_OS == XVT_OS_SCOUNIX
|
|
||||||
case 2:
|
|
||||||
rt = ba2300(argc, argv) ; break;
|
|
||||||
#endif
|
|
||||||
case 3:
|
case 3:
|
||||||
rt = ba2400(argc, argv) ; break;
|
rt = ba2400(argc, argv) ; break;
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -1,33 +1,22 @@
|
|||||||
#include <direct.h>
|
|
||||||
|
|
||||||
#define XVT_INCL_NATIVE
|
|
||||||
#define STRICT
|
|
||||||
|
|
||||||
#include <applicat.h>
|
#include <applicat.h>
|
||||||
#include <colors.h>
|
#include <archives.h>
|
||||||
#include <config.h>
|
|
||||||
#include <isam.h>
|
#include <isam.h>
|
||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <prefix.h>
|
#include <prefix.h>
|
||||||
#include <progind.h>
|
|
||||||
#include <urldefid.h>
|
|
||||||
#include <utility.h>
|
|
||||||
#include <archives.h>
|
|
||||||
|
|
||||||
#include "ba2200.h"
|
#include "ba2200.h"
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Archiving application
|
// Archiving application
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
|
|
||||||
class TArchive_app : public TApplication
|
class TArchive_app : public TSkeleton_application
|
||||||
{
|
{
|
||||||
TArchive _arc;
|
TArchive _arc;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool create();
|
virtual bool create();
|
||||||
virtual bool menu(MENU_TAG);
|
virtual void main_loop();
|
||||||
static bool test_firm(TMask_field& f, KEY k);
|
static bool test_firm(TMask_field& f, KEY k);
|
||||||
KEY query(long& firm, char& floppy, TString& desc, bool& tmp) const;
|
KEY query(long& firm, char& floppy, TString& desc, bool& tmp) const;
|
||||||
|
|
||||||
@ -40,8 +29,6 @@ public:
|
|||||||
|
|
||||||
bool TArchive_app::create()
|
bool TArchive_app::create()
|
||||||
{
|
{
|
||||||
TApplication::create();
|
|
||||||
|
|
||||||
bool ok = TRUE;
|
bool ok = TRUE;
|
||||||
|
|
||||||
TIsamfile utenti(LF_USER, FALSE);
|
TIsamfile utenti(LF_USER, FALSE);
|
||||||
@ -58,7 +45,7 @@ bool TArchive_app::create()
|
|||||||
utenti.close();
|
utenti.close();
|
||||||
|
|
||||||
if (ok)
|
if (ok)
|
||||||
dispatch_e_menu(BAR_ITEM(1));
|
ok = TSkeleton_application::create();
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
@ -97,12 +84,12 @@ KEY TArchive_app::query(long& firm, char& floppy, TString& desc, bool& temp) con
|
|||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TArchive_app::menu(MENU_TAG)
|
void TArchive_app::main_loop()
|
||||||
{
|
{
|
||||||
KEY k;
|
KEY k;
|
||||||
long firm;
|
long firm;
|
||||||
char floppy;
|
char floppy;
|
||||||
TString80 desc;
|
TString desc(80);
|
||||||
bool temp;
|
bool temp;
|
||||||
|
|
||||||
while ((k = query(firm, floppy, desc, temp)) != K_QUIT)
|
while ((k = query(firm, floppy, desc, temp)) != K_QUIT)
|
||||||
@ -110,8 +97,6 @@ bool TArchive_app::menu(MENU_TAG)
|
|||||||
if (k == K_SAVE) _arc.backup(firm, floppy, desc);
|
if (k == K_SAVE) _arc.backup(firm, floppy, desc);
|
||||||
else _arc.restore(firm, floppy, temp);
|
else _arc.restore(firm, floppy, temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int ba2200(int argc, char* argv[])
|
int ba2200(int argc, char* argv[])
|
||||||
|
@ -4,9 +4,6 @@
|
|||||||
// ************************************************************************
|
// ************************************************************************
|
||||||
|
|
||||||
#include "ba6100.h"
|
#include "ba6100.h"
|
||||||
static const char sep[] =
|
|
||||||
"-----------------------------------------------------------------"
|
|
||||||
"-----------------------------------------------------------------" ;
|
|
||||||
|
|
||||||
void TAnaprint_app::set_scheda_anagiu()
|
void TAnaprint_app::set_scheda_anagiu()
|
||||||
{
|
{
|
||||||
@ -945,24 +942,14 @@ void TAnaprint_app::set_headers()
|
|||||||
{
|
{
|
||||||
case anafis:
|
case anafis:
|
||||||
case anagiu:
|
case anagiu:
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
|
||||||
set_background("W1l{1 2 132 2}W4l{1 4 132 4}");
|
set_background("W1l{1 2 132 2}W4l{1 4 132 4}");
|
||||||
#else
|
|
||||||
set_header(2,(const char*)sep);
|
|
||||||
set_header(4,(const char*)sep);
|
|
||||||
#endif
|
|
||||||
set_header(1,"@bRUBRICA PERSONE %s@40gStudio@53gData @< pag. @#",
|
set_header(1,"@bRUBRICA PERSONE %s@40gStudio@53gData @< pag. @#",
|
||||||
_pr_what == anagiu ? "GIURIDICHE" : "FISICHE");
|
_pr_what == anagiu ? "GIURIDICHE" : "FISICHE");
|
||||||
set_header(3,"@iCodice Cognome e nome");
|
set_header(3,"@iCodice Cognome e nome");
|
||||||
set_header(5,"");
|
set_header(5,"");
|
||||||
break;
|
break;
|
||||||
case nditte:
|
case nditte:
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
|
||||||
set_background("W1l{1 2 132 2}W4l{1 4 132 4}");
|
set_background("W1l{1 2 132 2}W4l{1 4 132 4}");
|
||||||
#else
|
|
||||||
set_header(2,(const char*)sep);
|
|
||||||
set_header(4,(const char*)sep);
|
|
||||||
#endif
|
|
||||||
set_header(1,"@bRUBRICA DITTE@40gStudio@53gData @< pag. @#");
|
set_header(1,"@bRUBRICA DITTE@40gStudio@53gData @< pag. @#");
|
||||||
set_header(3,"@iCodice Cognome e nome");
|
set_header(3,"@iCodice Cognome e nome");
|
||||||
set_header(5,"");
|
set_header(5,"");
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
#include <mask.h>
|
#include <mask.h>
|
||||||
#include <printapp.h>
|
#include <printapp.h>
|
||||||
#include <relation.h>
|
|
||||||
#include <tabutil.h>
|
|
||||||
#include <utility.h>
|
|
||||||
#include <sort.h>
|
|
||||||
|
|
||||||
#include <lffiles.h>
|
|
||||||
#include <comuni.h>
|
#include <comuni.h>
|
||||||
|
|
||||||
#include "ba6.h"
|
#include "ba6.h"
|
||||||
#include "ba6200.h"
|
#include "ba6200.h"
|
||||||
|
|
||||||
const MAXSTR = 128;
|
|
||||||
static char __tmp [MAXSTR];
|
|
||||||
static TFixed_string tmp (__tmp, MAXSTR);
|
|
||||||
|
|
||||||
class BA6200_application : public TPrintapp
|
class BA6200_application : public TPrintapp
|
||||||
{
|
{
|
||||||
TRelation* _rel;
|
TRelation* _rel;
|
||||||
@ -269,11 +260,8 @@ bool BA6200_application::user_destroy()
|
|||||||
|
|
||||||
int ba6200(int argc, char* argv[])
|
int ba6200(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
|
|
||||||
BA6200_application a;
|
BA6200_application a;
|
||||||
|
|
||||||
a.run(argc, argv, "Stampa Comuni");
|
a.run(argc, argv, "Stampa Comuni");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user