home *** CD-ROM | disk | FTP | other *** search
- #include "microlib.h"
-
- #ifdef __TURBOC__
- extern unsigned _stklen = 10000; /* Provide enough stack. */
- #endif
-
- #include "messages.c"
- #include "files.c"
-
- #define NORMAL_MODE 1
-
- /* Global variables definitions. */
- int custom[26]; /* Customization. */
- int srow[40]; /* Screen coordinates - row */
- int scol[40]; /* - column */
- int set_confirm; /* Confirmation on g4read(). */
- char chksn[44]; /* S/N */
- char space_line[80] = " ";
- char codename[7+1];
- char user[7]; /* User ID. */
- char privileges[10]; /* User Privileges. */
- char wordprocessor[50]; /* Word Processor's Name. */
- char viewer[50]; /* Viewer's Name. */
- char soldrive[3];
- char solpath[50];
- int doccreate;
- char docdrive[3];
- char docpath[50];
- H4FILE net;
- char pattern[13];
- char search_code[7+1];
- int wordproccounter;
- int maxsubdirlen;
- char comm_drive[3];
- char comm_path[50];
- char comm_program[50];
- int filtdoc_flag = 0;
- char helpline_save[150];
- char statusline_save[150];
-
- X4FILTER gl_filter;
- D4DATA *gl_dbfile;
-
- C4CODE set; /* Code Base Settings structure. */
-
- static int menu_char_entry();
-
- main(argc, argv)
- int argc;
- char *argv[];
- {
- int quit();
- int go_system();
- int sol_wref;
- int main_mref, basicfiles_mref, utilities_mref;
- int client_mref, opponent_mref, backup_mref;
- int office_mref, pr_basic_mref;
- int multiuser_mref;
- int documents_mref, case_mref;
- int filtcase_mref, filtdoc_mref;
- int main_wref;
- int count;
- int ret_val;
-
- int filt_kw_doc();
- int filt_kw_case();
- int pfiltcas();
- int backup();
- int restore();
-
- d4init(&set);
- /* Initial settings for Code Base 4.5 */
- set.auto_open = 1;
- set.safety = 0;
-
- set.wait = TRUE;
- set.read_lock = FALSE;
-
- set_confirm = TRUE;
-
- /* Read settings from .INI file */
- read_default_values();
- strcpy(search_code, " ");
- strcpy(codename, " ");
-
-
- if(argc > 1) {
- memcpy(codename, argv[1], strlen(argv[1]));
-
- if( ! check_password(codename, argv[2])) {
- d4close_all(&set);
- w4clear(-1);
- w4exit(1);
- }
- else {
- wordproccounter = 0;
- strcpy(search_code, argv[3]);
- #ifndef SOL_DEMO
- check_sn(! NORMAL_MODE);
- #endif
- }
- }
- else {
- wordproccounter = 100;
- }
-
- /* Main Window definition */
- main_wref = w4define(0, 0, 24, 79);
- w4attribute(custom[MAIN_N]);
- w4activate(main_wref);
- w4clear(0);
- #ifdef SOL_DEMO
- w4num_att(0, 0, " Solicitor DEMO version (c)1992 Microland Ltd. ", 80, custom[STAT_N]);
- #else
- w4num_att(0, 0, " Solicitor v.1.0 (c)1992 Microland Ltd. ", 80, custom[STAT_N]);
- #endif
- for(count = 1; count <= 24; count ++)
- w4num_att(count, 0, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░", 80, custom[MAIN_N]);
-
- if(argc <= 1) {
- sol_wref = w4define(12, 1, 22, 78);
- w4border(SINGLE, custom[MAIN_N]);
- w4popup();
- w4memory();
- w4attribute(custom[MAIN_N]);
- w4activate(sol_wref);
- w4cursor(-1, -1);
- if(screen_file(screens(12), 8, 78)) /* Microland Logo */
- w4exit(1);
- if(! login()) {
- w4deactivate(sol_wref);
- w4close(sol_wref);
- w4deactivate(main_wref);
- w4close(main_wref);
- w4clear(-1);
- w4exit(0);
- }
- w4deactivate(sol_wref);
- w4close(sol_wref);
-
- #ifndef SOL_DEMO
- check_sn(NORMAL_MODE);
- #endif
- }
-
-
- statline(mes[MS+2]);
- helpline(mes[MH+3]);
-
- #ifndef SOL_DEMO
- w4num_att(0, 60, "s/n: ", 5, custom[STAT_N]);
- w4num_att(0, 65, chksn ,14, custom[STAT_N]);
- #endif
-
- /* Calculate maximum sub-directory length. */
- /* maxsubdirlen = 127 - (codename + password + employee code +
- len(wordprocessor) + filename + loadername) */
- maxsubdirlen = 127 - (45 + strlen(wordprocessor));
-
- /* Main Pulldown menu definition */
- main_mref = w4define( 1, 0, 1, 79);
- w4attribute(custom[MENU_N]);
- n4attribute(custom[MENU_N], custom[MENU_S], custom[MENU_F]);
- n4("üÿ⌐áíß Ç¿«£σÿ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&basicfiles_mref);
- n4("Äúÿ¢ªºªáπ⌐£á¬/äí½¼ºΘ⌐£á¬ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&pr_basic_mref);
- n4("âáÿ«£σ¿á⌐₧ é¿ÿ¡£σª¼ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&office_mref);
- n4("ä¿Üÿ⌐圪 ");
- n4reaction(n4sub_menu);
- n4ptr_save(&utilities_mref);
-
- basicfiles_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("ôºªƒΓ⌐£á¬... ");
- n4key('Y', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&case_mref);
- n4skip_over( n4("────────────────────"), 1);
- n4("æ¼ñ£¿Üß½£¬ ");
- n4key('S', 0, 0);
- n4action( employee );
- n4("Å£óß½£¬... ");
- n4key('P', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&client_mref);
- n4("Çñ½σ¢áíªá... ");
- n4key('A', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&opponent_mref);
- n4("âáíÿ⌐½Γ¬ ");
- n4key('K', 0, 2);
- n4action( judge );
- n4("âáí₧ܵ¿ªá Çñ½á¢σíαñ ");
- n4key('G', 0, 4);
- n4action( o_lawyer );
- n4skip_over( n4("────────────────────"), 1);
- n4("Å¿ª⌐α¿áñπ äѪ¢ª¬ ");
- n4key('R', 0, 1);
- n4action( go_system );
- n4("ÆΓóª¬ Å¿ªÜ¿ßúúÿ½ª¬ ");
- n4key('T', 0, 0);
- n4action( quit );
-
-
-
- utilities_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("Çñÿ¢áª¿Üßñα⌐₧ Ç¿«£σαñ ");
- n4key('A', 0, 0);
- n4action( pack );
- n4skip_over( n4("───────────────────────────"), 1);
- n4("äá⌐ÿÜαÜπ ⌐½ªá«£σαñ «¿π⌐½₧ ");
- n4key('X', 0, 19);
- n4action( add_user );
- n4skip_over( n4("───────────────────────────"), 1);
- n4("Çñ½σÜ¿ÿ¡ÿ Ç⌐¡ÿó£σÿ¬... ");
- n4key('S', 0, 11);
- n4action(n4sub_menu);
- n4ptr_save(&backup_mref);
-
- backup_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("Çñ½áÜ¿ÿ¡π ÿ¿«£σαñ (Backup) ");
- n4key('A', 0, 0);
- n4action( backup );
- n4("äºÿñÿ¡ª¿ß ÿ¿«£σαñ (Restore) ");
- n4key('E', 0, 0);
- n4action( restore );
- /*
- multiuser_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("äá⌐ÿÜαÜπ æ½ªá«£σαñ ò¿π⌐½₧ ");
- n4key('X', 0, 14);
- n4action( add_user );
- n4("ÇóóÿÜπ æ¼ñƒ₧úÿ½áíΘñ ");
- n4key('S', 0, 7);
- n4action( (ACTION *) 0);
- n4("ëÿƒª¿á⌐úµ¬ âáíÿáαúß½αñ ");
- n4key('D', 0, 11);
- n4action( (ACTION *) 0);
- */
-
-
- client_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("ö¼⌐áíß Å¿µ⌐αºÿ ");
- n4key('F', 0, 0);
- n4action( pclient );
- n4("îªúáíß Å¿µ⌐αºÿ ");
- n4key('N', 0, 0);
- n4action( cclient );
-
- case_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("潪᫣σÿ ôºµƒ£⌐₧¬ ");
- n4key('S', 0, 0);
- n4action( thecase );
- n4("Çñÿ¥π½₧⌐₧ ôºªƒΓ⌐£αñ... ");
- n4key('A', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&filtcase_mref);
-
- filtcase_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("ï£ ¢áß¡ª¿ÿ í¿á½π¿áÿ ");
- n4key('K', 0, 11);
- n4action( &filtcase );
- n4("ï£ óΓѣᬠíó£á¢áß ");
- n4key('L', 0, 3);
- n4action( filt_kw_case );
-
- opponent_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("ö¼⌐áíß Å¿µ⌐αºÿ ");
- n4key('F', 0, 0);
- n4action( popponent );
- n4("îªúáíß Å¿µ⌐αºÿ ");
- n4key('N', 0, 0);
- n4action( copponent );
-
- office_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("äÜÜ¿ÿ¡ÿ... ");
- n4key('E', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&documents_mref);
- n4("äºáíªáñαñσÿ ú£ üß⌐£á¬ ⣢ªúΓñαñ ");
- n4key('P', 0, 1);
- n4action( commun );
-
- documents_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("潪᫣σÿ äÜܿߡª¼ ");
- n4key('S', 0, 0);
- n4action( document );
- n4("Çñÿ¥π½₧⌐₧ äÜܿߡαñ... ");
- n4key('A', 0, 0);
- n4action(n4sub_menu);
- n4ptr_save(&filtdoc_mref);
-
- filtdoc_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("ï£ ¢áß¡ª¿ÿ í¿á½π¿áÿ ");
- n4key('K', 0, 11);
- n4action( filtdoc );
- n4("ï£ óΓѣᬠíó£á¢áß ");
- n4key('L', 0, 3);
- n4action( filt_kw_doc );
-
- pr_basic_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- w4border(SINGLE, custom[PULL_B]);
- n4("äí½τºα⌐₧ ôºªƒΓ⌐£αñ ");
- n4key('Y', 0, 9);
- n4action( pfiltcas );
- n4skip_over( n4("─────────────────────────────────"), 1);
- n4("äí½τºα⌐₧ Å£óÿ½Θñ ");
- n4key('P', 0, 9);
- n4action( filtclient );
- n4("äí½τºα⌐₧ Çñ½á¢σíαñ ");
- n4key('A', 0, 9);
- n4action( filtopponent );
- n4("äí½τºα⌐₧ âáíÿ⌐½Θñ ");
- n4key('K', 0, 11);
- n4action( filtjudge );
- n4("äí½τºα⌐₧ âáí₧ܵ¿αñ Çñ½á¢σíª¼ ");
- n4key('G', 0, 13);
- n4action( filto_lawyer );
-
- w4cursor(-1,-1);
- n4pulldown( main_mref );
- n4char_routine( menu_char_entry );
- while(TRUE) {
- ret_val = n4activate( main_mref );
-
- if( ret_val == ESC ) {
- if(warning(mes[MH+15]))
- quit();
- }
- }
- }
-
- int quit()
- {
- h4close(&net);
- w4clear(-1);
- w4exit(0);
- }
-
- int go_system()
- {
- int system_wref;
- system_wref = w4define(0, 0, 24, 79);
- w4attribute(custom[MAIN_N]);
- w4popup();
- w4memory();
- w4activate(system_wref);
-
- w4select(0);
- w4attribute(custom[MAIN_N]);
- w4cursor(24, 1);
- system( "command.com" );
- w4select(system_wref);
- w4cursor(-1, -1);
- w4select(system_wref);
- w4deactivate(system_wref);
- w4close(system_wref);
- return(1);
- }
-
-
- load_logo_screen()
- {
- int sol_wref;
-
- /* Logo Window definition */
- sol_wref = w4define(7, 9, 15, 70);
- w4attribute(112);
- w4border(DOUBLE, 112);
- w4popup();
- w4memory();
- w4activate(sol_wref);
- w4cursor(-1, -1);
- #ifdef SOL_DEMO
- w4(1, 2, "S o l i c i t o r Demo Version");
- #else
- w4(1, 2, "S o l i c i t o r ver. 1.0");
-
- /* Display Serial Number. */
- w4(5, 2, "Serial Number:");
- w4num(5, 2+15, chksn, 14);
- #endif
- w4(2, 2, "Copyright 1992 by Microland Ltd.");
- w4(3, 2, "Created by Emmanuel J. Tzevelekakis");
-
- g4char();
-
- w4deactivate(sol_wref);
- w4close(sol_wref);
- }
-
- int menu_char_entry()
- {
- int rc;
-
- if(wordproccounter <= 4 && search_code[0] == 'Z') {
- wordproccounter ++;
- if(wordproccounter == 1) return(RIGHT);
- if(wordproccounter == 2) return(RIGHT);
- if(wordproccounter == 3) return(RETURN);
- if(wordproccounter == 4) return(RETURN);
- }
-
- rc = g4char();
-
- if(rc == F1) {
- help("MAIN_MENU");
- return(0);
- }
-
- if(rc == ALT_F10) {
- load_logo_screen();
- return(0);
- }
-
- return(grtolat(rc));
- }
-
-