home *** CD-ROM | disk | FTP | other *** search
- #include "microlib.h"
- #include "ibmpc.h"
-
- #ifdef __TURBOC__
- extern unsigned _stklen = 10000; /* Provide enough stack. */
- #endif
-
- #include "messages.c"
- #include "files.c"
-
- #define NORMAL_MODE 2
-
- /* 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 iepdrive[3];
- char ieppath[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();
-
- VIDEOSTATUS vs;
-
- main(argc, argv)
- int argc;
- char *argv[];
- {
- int quit();
- int go_system();
- int persons();
- int institut();
- int topics();
- int professions();
- int newform();
- int iep_wref;
- int main_mref, basicfiles_mref, utilities_mref;
- int search_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, " ");
-
- vioInit();
-
- 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]);
- }
- }
- else {
- wordproccounter = 100;
- }
-
- /* Main Window definition */
- main_wref = w4define(0, 0, 24, 79);
- w4attribute(custom[MAIN_N]);
- w4activate(main_wref);
- w4clear(0);
-
- w4num_att(0, 0, " ¡º╟╤╖ñ ¿╢╢¬╕¡╡╛╤ ╞╛╢¡¡╨¡╧╖╛╤ (c) 1993 MicroLand Ltd. ", 80, custom[STAT_N]);
- w4num_att(1, 0, " ", 80, custom[STAT_N]);
-
- for(count = 2; count <= 24; count ++)
- w4num_att(count, 0, "░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░", 80, custom[MAIN_N]);
-
- if(argc <= 1) {
- iep_wref = w4define(12, 1, 22, 78);
- w4border(SINGLE, custom[MAIN_N]);
- w4popup();
- w4memory();
- w4attribute(custom[MAIN_N]);
- w4activate(iep_wref);
- w4cursor(-1, -1);
- if (screen_file(screens(SCR_SOLICITOR), 8, 78)) /* Microland Logo */
- w4exit(1);
-
- //if(! login()) {
- // w4deactivate(iep_wref);
- // w4close(iep_wref);
- // w4deactivate(main_wref);
- // w4close(main_wref);
- // w4clear(-1);
- // w4exit(0);
- // }
- w4deactivate(iep_wref);
- w4close(iep_wref);
- }
-
-
- statline(mes[MS+2]);
- helpline(mes[MH+3]);
- /*
- #ifndef IEP_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]);
- #ifdef __TURBOC__
- n4attribute(custom[MENU_N], custom[MENU_S], custom[MENU_F]);
- #else
- n4attribute(custom[MENU_N], custom[MENU_S]);
- #endif
- n4("ñδ⌠▐ƒ╓ ▐≤╓δµΘ╪₧φ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&basicfiles_mref);
- n4("╥óδµ▐φ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&search_mref);
- n4("¿δ╪╓∞ƒ▐φ ");
- n4reaction(n4sub_menu);
- n4ptr_save(&utilities_mref);
-
- basicfiles_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- #ifdef __TURBOC__
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- #else
- n4attribute(custom[PULL_N], custom[PULL_S]);
- #endif
- w4border(SINGLE, custom[PULL_B]);
- n4("╞δó∞·Ω╓ ");
- n4key('P', 0, 19);
- n4action( persons );
- n4("¡▌δúµ╓ε╓ - ╛δ╪╓τπ∞µΘƒ ");
- n4key('I', 0, 0);
- n4action( institut );
- n4skip_over( n4("──────────────────────"), 1);
- n4("¿Ω╓╪╪¥σµ╓ε╓ ");
- n4key('E', 0, 0);
- n4action( professions );
- n4("¿Σ▌ßσ²∞▐πφ ");
- n4key('k', 0, 0);
- //n4action( employee );
- n4("╧≥µµ▐εΘ⌠¥φ ");
- n4key('k', 0, 0);
- //n4action( employee );
- n4("¼¥µ╓ε╓ ");
- n4key('A', 0, 0);
- n4action( topics );
- n4skip_over( n4("──────────────────────"), 1);
- n4("╞δΘ∞·δπτ₧ ¥ΦΘ▌Θφ ");
- n4key('R', 0, 1);
- n4action( go_system );
- n4("╨¥σΘφ ΩδΘ╪δ¢µµ╓εΘφ ");
- n4key('T', 0, 0);
- n4action( quit );
-
- search_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- #ifdef __TURBOC__
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- #else
- n4attribute(custom[PULL_N], custom[PULL_S]);
- #endif
- w4border(SINGLE, custom[PULL_B]);
- n4("╧⌠▐▌ƒ╓∞ß... ");
- n4key('º', 0, 0);
- n4action( newform );
- n4("╖▐ε╓╫Θσ₧... ");
- n4key('╖', 0, 19);
- //n4action( add_user );
- n4("¿ΣεúΩ·∞ß... ");
- n4key('¿', 0, 19);
- //n4action( add_user );
-
-
- utilities_mref = w4define(-1, -1, -1, -1);
- w4attribute(custom[PULL_N]);
- #ifdef __TURBOC__
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- #else
- n4attribute(custom[PULL_N], custom[PULL_S]);
- #endif
- 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]);
- #ifdef __TURBOC__
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- #else
- n4attribute(custom[PULL_N], custom[PULL_S]);
- #endif
- 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]);
- #ifdef __TURBOC__
- n4attribute(custom[PULL_N], custom[PULL_S], custom[PULL_F]);
- #else
- n4attribute(custom[PULL_N], custom[PULL_S]);
- #endif
- 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);
-
-
-
- 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 iep_wref;
-
- /* Logo Window definition */
- iep_wref = w4define(7, 9, 15, 70);
- w4attribute(112);
- w4border(DOUBLE, 112);
- w4popup();
- w4memory();
- w4activate(iep_wref);
- w4cursor(-1, -1);
- #ifdef IEP_DEMO
- w4(1, 2, "I E P Demo Version");
- #else
- w4(1, 2, "I E P 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(iep_wref);
- w4close(iep_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));
- }
-
-