home *** CD-ROM | disk | FTP | other *** search
- #include "microlib.h"
-
- #define GETFROMBROWSE_KEY F3
-
- extern char iepdrive[3];
- extern char ieppath[50];
-
- /*****************************************************************************/
- /* Function: int gpassword(GET *get_ptr, char *data_buffer, int no_need) */
- /*****************************************************************************/
- int gpassword(get_ptr, data_buffer, no_need)
- GET *get_ptr;
- char *data_buffer;
- int no_need;
- {
- char *first_password;
- char second_password[7];
- int check_password_wref;
- int first_len;
- int key_val;
- int count;
-
- /* Disable Borland's C warning: "Parameter never used in function..." */
- if(no_need);
-
- key_val = g4char();
-
- /* If a key, which causes g4read to change field, is pressed. */
- /* ==IF EXIT KEY== */
- if(key_val == RETURN || key_val == TAB || key_val == DOWN || key_val == UP \
- || key_val == SHIFT_TAB) {
- first_password = data_buffer;
- first_len = get_ptr->width_data;
- /* Convert first password entered to uppercase. */
- for(count=0; count<=first_len -1; count ++)
- first_password[count] = gtoupper(first_password[count]);
- /* Open window and ask to retype the password. */
- check_password_wref = w4define(get_ptr->row, get_ptr->col, \
- get_ptr->row + 2, get_ptr->col +18);
- w4attribute(custom[MAIN_N]);
- w4title(0, 1, mes[MT+17], custom[MAIN_N]);
- w4border(SINGLE, custom[MAIN_N]);
- w4popup();
- w4memory();
- w4activate( check_password_wref );
-
- memcpy(second_password, space(first_len), first_len);
- g4attribute( 0 );
- g4delimiter("[]");
- g4(0, 3, second_password); g4width(7, 7);
- g4read();
-
- w4deactivate(check_password_wref);
- w4close(check_password_wref);
-
- /* Convert second password to uppercase before comparison. */
- for(count=0; count<=first_len -1; count ++)
- second_password[count] = gtoupper(second_password[count]);
-
- /* If passwords are equal. */
- if( !memcmp( first_password, second_password, first_len)) {
- return(TAB);
- }
- else {
- w4display("", mes[ME+15], mes[MH+16], (char *) 0);
- memcpy(first_password, space(first_len), first_len);
- return(HOME);
- }
- } /* ==IF EXIT KEY== */
- else
- return(key_val);
- }
-
- /*****************************************************************************/
- /* Function: int vnot_empty(GET *get_ptr) */
- /*****************************************************************************/
- int vnot_empty(get_ptr )
- GET *get_ptr;
- {
- char *entry_area;
-
- entry_area = (char *) get_ptr->data;
- /* If empty then NOT Valid. */
- if( !memcmp( entry_area, space(get_ptr->width_data), get_ptr->width_data)) {
- w4display("", mes[ME+14], mes[MH+16], (char *) 0);
- return(-1);
- }
- else
- return(0);
- }
- /*****************************************************************************/
- /* Function: int gfilename(GET *get_ptr, char *data_buffer, int no_need) */
- /*****************************************************************************/
- int gfilename(get_ptr, data_buffer, browser_flag)
- GET *get_ptr;
- char *data_buffer;
- int browser_flag;
- {
- int key_val;
-
- int src_count;
- int dest_count;
- int ext_count;
- int ext_flag;
- int error_flag;
-
- char filename[12];
-
- if(get_ptr);
-
- memset(filename, ' ', 12);
- ext_count = 0;
- ext_flag = FALSE;
- error_flag = FALSE;
-
- key_val = g4char();
- /* If a key, which causes g4read to change field, is pressed, if the value */
- /* entered is found in the data base print the description. Otherwise ring */
- /* the bell and stay to the field. */
- if(key_val == RETURN || key_val == TAB || key_val == DOWN || key_val == UP \
- || key_val == SHIFT_TAB || key_val == F10) {
- dest_count = 0;
- for(src_count = 0; src_count <= 11; src_count ++ ) { /* ==L1== */
- /* No '.' first letter */
- if(data_buffer[src_count] == '.' && src_count == 0) {
- error_flag = TRUE;
- break;
- }
- /* No '.' position > 8 (9th character) */
- if(data_buffer[src_count] == '.' && src_count > 8) {
- error_flag = TRUE;
- break;
- }
- if(data_buffer[src_count] == '.') {
- /* No two '.' allowed. */
- if(memchr(data_buffer, '.', src_count)) {
- error_flag = TRUE;
- break;
- }
- ext_flag = TRUE;
- }
- /* If end of file name. */
- if(data_buffer[src_count] == ' ') {
- /* If the last character was a '.' replace with ' ' */
- if(data_buffer[src_count - 1] == '.')
- filename[dest_count - 1] = ' ';
- break;
- }
- /* If main name has ended. */
- if(src_count > 7 && data_buffer[8] != '.') {
- /* If there is no '.' */
- if(! memchr(data_buffer, '.', src_count)) {
- error_flag = TRUE;
- break;
- }
- }
- /* If extention started. */
- if(ext_flag == TRUE) {
- ext_count ++;
- /* If extention has more than 3 characters + the '.' */
- if(ext_count > 4) {
- error_flag = TRUE;
- break;
- }
- }
- filename[dest_count] = data_buffer[src_count];
- dest_count ++;
- } /* ==L1== */
- if(error_flag) {
- w4display("", mes[ME+24], (char *) 0);
- return(-1);
- }
- for(dest_count = 0; dest_count <= 11; dest_count ++)
- filename[dest_count] = gtoupper(filename[dest_count]);
- memcpy(data_buffer, filename, 12);
- return(key_val);
- }
-
- else if(key_val == BACK_SPACE || key_val == INS || key_val == DEL ||\
- key_val == HOME || key_val == END || key_val == '.' || key_val == '_' ||\
- key_val == ESC || key_val == LEFT || key_val == RIGHT || key_val == F10 ||\
- key_val == F3 || key_val == F1 ||\
- (key_val >= 48 && key_val <= 57) || \
- (key_val >= 65 && key_val <= 90) || \
- (key_val >= 97 && key_val <= 122)) {
- if(key_val == F3 && browser_flag) {
- cd_doc();
- search_files( data_buffer );
- cd_iep();
- key_val = HOME;
- }
- return(key_val);
- }
- else {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- return(-1);
- }
- }
-
- /*****************************************************************************/
- /* Function: int gper_comp(GET *get_ptr, char *data_buffer, int no_need) */
- /*****************************************************************************/
- int gper_comp(get_ptr, data_buffer, no_need)
- GET *get_ptr;
- char *data_buffer;
- int no_need;
- {
- int ret_val;
-
- /* Disable compiler's warrning ("Parameter 'xxx' is never used ..."). */
- if(no_need);
- if(get_ptr);
-
- for(;;) { /* ==L1== */
- ret_val = g4char();
- switch(ret_val) {
- case 'ö':
- case '¡':
- case 'F':
- case 'f':
- memcpy(data_buffer, "ö", 1);
- return(TAB);
- case 'N':
- case 'n':
- case 'î':
- case 'ñ':
- memcpy(data_buffer, "î", 1);
- return(TAB);
- case ' ':
- memcpy(data_buffer, " ", 1);
- return(TAB);
- case F1:
- case F2:
- case F4:
- case F5:
- case F6:
- case F7:
- case F8:
- case F9:
- case F10:
- case UP:
- case DOWN:
- case PGUP:
- case PGDN:
- case TAB:
- case SHIFT_TAB:
- case RETURN:
- case ESC:
- case DEL:
- return(ret_val);
- }
- } /* ==L1== */
- }
-
- /*****************************************************************************/
- /* Function: int gcl_status(GET *get_ptr, char *data_buffer, int no_need) */
- /*****************************************************************************/
- int gcl_status(get_ptr, data_buffer, no_need)
- GET *get_ptr;
- char *data_buffer;
- int no_need;
- {
- int ret_val;
-
- /* Disable compiler's warrning ("Parameter 'xxx' is never used ..."). */
- if(no_need);
- if(get_ptr);
-
- for(;;) { /* ==L1== */
- ret_val = g4char();
- switch(ret_val) {
- case '+':
- memcpy(data_buffer, "+", 1);
- return(TAB);
- case '-':
- memcpy(data_buffer, "-", 1);
- return(TAB);
- case '*':
- memcpy(data_buffer, "*", 1);
- return(TAB);
- case ' ':
- memcpy(data_buffer, " ", 1);
- return(TAB);
- case F1:
- case F2:
- case F4:
- case F5:
- case F6:
- case F7:
- case F8:
- case F9:
- case F10:
- case UP:
- case DOWN:
- case PGUP:
- case PGDN:
- case TAB:
- case SHIFT_TAB:
- case RETURN:
- case ESC:
- case DEL:
- return(ret_val);
- }
- } /* ==L1== */
- }
-
-
- /*****************************************************************************/
- /* Function: int gsex(GET *get_ptr, char *data_buffer, int no_need) */
- /*****************************************************************************/
- int gsex(get_ptr, data_buffer, no_need)
- GET *get_ptr;
- char *data_buffer;
- int no_need;
- {
- int ret_val;
-
- /* Disable compiler's warrning ("Parameter 'xxx' is never used ..."). */
- if(no_need);
- if(get_ptr);
-
- for(;;) { /* ==L1== */
- ret_val = g4char();
- switch(ret_val) {
- case 'A':
- case 'a':
- case 'Ç':
- case 'ÿ':
- memcpy(data_buffer, "Ç", 1);
- return(TAB);
- case 'U':
- case 'u':
- case 'ç':
- case 'ƒ':
- memcpy(data_buffer, "ç", 1);
- return(TAB);
- case ' ':
- memcpy(data_buffer, " ", 1);
- return(TAB);
- case F1:
- case F2:
- case F3:
- case F4:
- case F5:
- case F6:
- case F7:
- case F8:
- case F9:
- case F10:
- case UP:
- case DOWN:
- case PGUP:
- case PGDN:
- case TAB:
- case SHIFT_TAB:
- case RETURN:
- case ESC:
- case DEL:
- return(ret_val);
- }
- } /* ==L1== */
- }
-
-
- /*****************************************************************************/
- /* Function: int gfb_help(GET *get_ptr, char *data_buffer, int file_ref) */
- /* Description: This function is not called directly. It is used as a */
- /* parameter to g4call(): g4call( gfb_menu, file_ref); */
- /* Actually gfb_help() calls gfb() if F3 is pressed. */
- /* Parameters: GET *get_ptr -> The get structure of the field. */
- /* char *data_buffer -> The currently entered information. */
- /* int file_ref -> The file reference number used for the */
- /* menu entries. */
- /* Returns: A value significant for g4call routine. */
- /* >0 input data(as if it was read from the keyboard). */
- /* =0 Read the next keyboard character as normal input data. */
- /* -1 Call this call routine again without getting any keyboard */
- /* data from the user. */
- /* Uses: gfb(). */
- /*****************************************************************************/
- gfb_help( get_ptr, data_buffer, file_ref )
- GET *get_ptr;
- char *data_buffer;
- int file_ref;
- {
- D4DATA *dbfile; /* Database file used for the menu. */
- int code_len; /* Length of frequently used fields. */
- int desc_len;
- int key_val ; /* Key Pressed. */
- int count; /* Counter. */
- int already_openf; /* Already open file flag. */
- char hs[150];
- char ss[150];
-
- static changed_flag = FALSE;
-
-
- key_val = g4char() ;
-
- /* If F3 is pressed call gfb(). If gfb() returns Esc call the routine again.*/
- if ( key_val == GETFROMBROWSE_KEY ) {
- /* Get file pointer and set some frequently used variables. */
- dbfile = d4data( &set, dbf[file_ref]);
- if( dbfile == 0 ) {
- dbfile = d4open( &set, files(file_ref));
- already_openf = FALSE; /* I shall close th file later. */
- }
- else
- already_openf = TRUE;
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
-
- strcpy(hs, helpline_save);
- strcpy(ss, statusline_save);
- helpline(mes[MH+67]);
- statline(mes[MS+33]);
- key_val = gfb( get_ptr, data_buffer, file_ref ) ;
- helpline(hs);
- statline(ss);
-
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
- if( already_openf == 0 ) {
- d4close(dbfile);
- }
- if ( key_val == ESC ) key_val = -1 ;
- return( key_val ) ;
- }
-
- /* If a key, which causes g4read to change field, is pressed, if the value */
- /* entered is found in the data base print the description. Otherwise ring */
- /* the bell and stay to the field. */
- else if(key_val == RETURN || key_val == TAB || key_val == DOWN || key_val == UP \
- || key_val == SHIFT_TAB) {
- /* If the data_buffer is blank... */
- code_len = get_ptr->width_data;
- if(!memcmp(data_buffer, space(code_len),code_len)) {
- if(! changed_flag)
- return(key_val);
- }
- changed_flag = FALSE;
- /* Get file pointer and set some frequently used variables. */
- dbfile = d4data( &set, dbf[file_ref]);
- if( dbfile == 0 ) {
- dbfile = d4open( &set, files(file_ref));
- already_openf = FALSE; /* I shall close th file later. */
- }
- else
- already_openf = TRUE;
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
-
- code_len = get_ptr->width_data;
- desc_len = f4len(d4field(dbfile, "DESC"));
-
- if(!memcmp(data_buffer, space(code_len),code_len)) {
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- space(desc_len), desc_len, custom[MAIN_I]);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(key_val);
- }
-
- for(count=0; count<= code_len -1; count ++)
- data_buffer[count] = gtoupper(data_buffer[count]);
-
- if( d4seek(dbfile, data_buffer) != 0 ) {
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- space(desc_len), desc_len, custom[MAIN_I]);
- w4display("",mes[ME+4],mes[MH+16], (char *) 0);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(HOME);
- }
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- f4str(d4field_j(dbfile, 2)), desc_len, custom[MAIN_I]);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(key_val);
- }
- else {
- changed_flag = TRUE;
- return(key_val);
- }
- }
-
- /*****************************************************************************/
- /* Function: int gfb(GET *get_ptr, char *data_buffer, int file_ref) */
- /* Description: This function is not called directly. It is used as a */
- /* parameter to g4call(): g4call( gfb, file_ref); */
- /* Parameters: GET *get_ptr -> The get structure of the field. */
- /* char *data_buffer -> The currently entered information. */
- /* int file_ref -> The file reference number used for the */
- /* menu entries. */
- /* Returns: A value significant for g4call routine. */
- /* >0 input data(as if it was read from the keyboard). */
- /* =0 Read the next keyboard character as normal input data. */
- /* -1 Call this call routine again without getting any keyboard */
- /* data from the user. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int gfb(get_ptr, data_buffer, file_ref)
- GET *get_ptr;
- char *data_buffer;
- int file_ref;
- {
- D4DATA *dbfile; /* Database file used for the menu. */
- int browse_wref; /* Windows References. */
- int append_wref;
- int edit_wref;
- int code_len; /* Length of frequently used fields. */
- int desc_len;
- int win_s, win_e; /* Browse y and y1 coordinates. */
- int maxrow; /* maxrow -1 = Maximum number of items in menu. */
- int cur_row;
- int key_val; /* Key pressed. */
- int count;
- int update_flag;
- int skp;
- int seek_val;
- int records_found;
- long cur_record;
- int skp_flag;
-
- /* Used in append and edit. */
- F4FIELD *f_code; /* Code and Description fields ... */
- F4FIELD *f_desc;
-
- char *code; /* Code and Description Entry areas. Memory */
- char *desc; /* is allocated before use. */
- char *sk; /* Temporary search key. */
-
- update_flag = FALSE;
- maxrow = 5;
- skp = 0;
- skp_flag = 0;
-
- /* Get file pointer and set some frequently used variables. */
- dbfile = d4data( &set, dbf[file_ref]);
-
- code_len = get_ptr->width_data;
- desc_len = f4len(d4field(dbfile, "DESC"));
- win_s = get_ptr->col + code_len +2;
- win_e = win_s + desc_len + code_len + 2;
-
- records_found = TRUE;
-
-
- /* Allocate space for CODE, DESC entry areas and TMP_KEY . */
- if( (code = calloc(code_len + 1, sizeof(char))) == NULL) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
- if( (desc = calloc(desc_len, sizeof(char))) == NULL) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
- if( (sk = calloc(desc_len + 1, sizeof(char))) == NULL) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
- memcpy(code, space(code_len), code_len);
- memcpy(desc, space(desc_len), desc_len);
- memcpy(sk, space(desc_len), desc_len);
-
- code[code_len] = '\0'; /* Null terminate for seek operations. */
-
- /* Select Code TAG (the previous tag of DESK_T) and try to find the */
- /* CODE in the field in order to set the database pointer correctly. */
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
- for(count=0; count<= code_len -1; count ++)
- data_buffer[count] = gtoupper(data_buffer[count]);
- if( d4seek(dbfile, data_buffer) != 0) {
- d4unlock_index(dbfile);
- /* If not in append mode ... */
- /*
- if( memcmp(data_buffer, space(code_len), code_len))
- w4display("",mes[ME+4],mes[MH+16], (char *) 0);
- */
- d4tag_select(dbfile , d4tag(dbfile,"DESC_T"));
- if( d4top(dbfile)) {
- records_found = FALSE;
- }
- else
- records_found = TRUE;
-
- d4unlock_index(dbfile);
- }
- d4unlock_index(dbfile);
-
- /* The records are ordered with Description TAG. */
- d4tag_select(dbfile , d4tag(dbfile,"DESC_T"));
-
- /* Open the browse window. */
- browse_wref = w4define(get_ptr->row + 1, win_s,\
- get_ptr->row + maxrow+3, win_e);
- w4attribute(custom[BROWSER_N]);
- w4border(SINGLE, custom[BROWSER_B]);
- w4title(0, 1, mes[MT+16], custom[BROWSER_B]);
- w4popup();
- w4memory();
- w4activate( browse_wref );
- w4cursor(-1, -1);
-
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
-
- for (;;) { /* ==L1== */
- key_val = g4char();
-
- if ( key_val == F1 ) {
- help("GET_FROM_BROWSE");
- continue ;
- }
- if ( key_val == F8 && records_found) {
- if(warning(mes[MH+56])) {
- w4select(browse_wref);
- d4delete(dbfile);
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- if (d4top(dbfile)) {
- records_found = FALSE;
- }
- else
- records_found = TRUE;
-
- d4unlock_index(dbfile);
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
- }
- w4select(browse_wref);
- }
- /* Edit Record to file. */
- if(key_val == F2 && records_found) {
- edit_wref = w4define(get_ptr->row +2, win_s +1,\
- get_ptr->row + 7, win_e +12);
- w4border(DOUBLE, custom[MAIN_N]);
- w4title(0, 1, mes[MT+15], custom[MAIN_N]);
- w4popup();
- w4memory();
- w4activate( edit_wref );
- w4attribute(custom[MAIN_N]);
- w4clear(0);
- w4(1, 1, "ëα¢áíµ¬ :");
- w4(2, 1, "Å£¿áÜ¿ÿ¡π:");
- g4delimiter("[]");
- g4attribute(custom[MAIN_I]);
- w4num_att(1, 12, f4str(d4field_j(dbfile,1)), code_len, custom[MAIN_I]);
- memcpy(desc,f4str(d4field_j(dbfile,2)), desc_len);
- g4(2, 12, desc); g4width(desc_len,desc_len);
- if(g4read() != ESC) {
- for(count=0; count<= desc_len -1; count ++)
- desc[count] = gtoupper(desc[count]);
- f_desc = d4field_j(dbfile, 2); /* Get field pointer. */
- f4assign_n(f_desc, desc, desc_len);
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- update_flag = TRUE;
- }
- w4deactivate(edit_wref);
- w4close(edit_wref);
- if(update_flag) {
- update_flag = FALSE;
- d4seek(dbfile, desc); /* Seek new description. */
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
- }
- }
-
- /* Append Record to file. */
- if(key_val == F5) {
- append_wref = w4define(get_ptr->row +2, win_s +1,\
- get_ptr->row + 7, win_e +12);
- w4border(DOUBLE, custom[MAIN_N]);
- w4title(0, 1, mes[MT+14], custom[MAIN_N]);
- w4popup();
- w4memory();
- w4activate( append_wref );
- w4attribute(custom[MAIN_N]);
- w4clear(0);
- w4(1, 1, "ëα¢áíµ¬ :");
- w4(2, 1, "Å£¿áÜ¿ÿ¡π:");
- g4delimiter("[]");
- g4attribute(custom[MAIN_I]);
- memcpy(code, space(code_len), code_len);
- memcpy(desc, space(desc_len), desc_len);
- for(;;) { /* ==L2== */
- g4(1, 12, code); g4width(code_len,code_len);
- g4(2, 12, desc); g4width(desc_len,desc_len);
- if(g4read() != ESC) {
- for(count=0; count<= desc_len -1; count ++)
- desc[count] = gtoupper(desc[count]);
- for(count=0; count<= code_len -1; count ++)
- code[count] = gtoupper(code[count]);
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
- if(! memcmp(code, space(code_len), code_len)) {
- w4display("",mes[ME+7],mes[MH+16], (char *) 0);
- continue;
- }
- if(d4seek(dbfile, code) == 0) { /* If code exists. */
- d4unlock_index(dbfile);
- w4display("",mes[ME+5],mes[MH+16], (char *) 0);
- continue;
- }
- d4unlock_index(dbfile);
- d4tag_select(dbfile , d4tag(dbfile,"DESC_T"));
- d4append_start(dbfile, 0);
- d4blank(dbfile);
- f_code = d4field_j(dbfile, 1);
- f_desc = d4field_j(dbfile, 2);
- f4assign_n(f_code, code, code_len);
- f4assign_n(f_desc, desc, desc_len);
- d4append(dbfile);
- d4flush_all(dbfile);
- d4unlock_all_data(dbfile);
- d4unlock_index(dbfile);
- update_flag = TRUE;
- }
- break;
- } /* ==L2== */
- w4deactivate(append_wref);
- w4close(append_wref);
- if(update_flag) {
- update_flag = FALSE;
- d4seek(dbfile, desc); /* Seek new description. */
- records_found = TRUE;
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
- }
- }
- /* ==If Alphanumeric== */
- if( ((key_val == BACK_SPACE) || \
- (key_val >= 32 && key_val <= 175) || \
- (key_val >= 224 && key_val <=233)) && records_found) {
-
- if(key_val == BACK_SPACE) {
- if(skp == 0) {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- skp_flag = 1;
- }
- else if(skp > 1) {
- skp --;
- skp --;
- }
- else if(skp == 1) {
- skp = 0;
- skp_flag = 1;
- d4top(dbfile);
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
- }
- }
- else if(skp == desc_len){
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- skp --;
- }
- else {
- sk[skp] = key_val;
- }
-
- if( !skp_flag) { /* ==If normal mode== */
- sk[skp + 1] = '\0';
- for(count=0 ; count <= skp; count ++)
- sk[count] = gtoupper(sk[count]);
- cur_record = d4recno(dbfile);
- seek_val = d4seek(dbfile, sk);
- d4unlock_index(dbfile);
-
- /* ==If found or just after it.==*/
- if(seek_val == r4after || seek_val == 0 || seek_val == r4eof) {
- /* If NOT really found... */
- if( memcmp(sk, f4str( d4field_j(dbfile, 2)), skp + 1)) {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- seek_val = d4go(dbfile, cur_record);
- if( seek_val != 0 ) { /* If the record no longer exists. */
- d4top(dbfile);
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, desc_len);
- cur_row = 0;
- } /* If the record no longer exists. */
- } /* If NOT really found. */
- else { /* If really found... */
- /* Fill the window with records. (normal attribute). */
- gfb_fillwindow(dbfile, desc_len, code_len, maxrow, skp + 1);
- cur_row = 0;
- skp ++;
- } /* If really found... */
- } /* ==If found or just after it.==*/
- } /* If normal mode */
- skp_flag = 0;
- } /* ==If Alphanumeric== */
-
-
- if(key_val == RETURN && records_found) {
- free(code);
- free(desc);
- free(sk);
- w4deactivate(browse_wref);
- w4close(browse_wref);
- /* Fill the buffer with the correct code and print the description */
- /* Next to the field. */
- d4tag_select(dbfile , d4tag_prev(dbfile, d4tag(dbfile,"DESC_T")));
- memcpy(data_buffer, f4str( d4field_j(dbfile, 1)), code_len);
- d4seek(dbfile, data_buffer);
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- f4str(d4field_j(dbfile, 2)), desc_len, custom[MAIN_I]);
- return(TAB);
- }
- if(key_val == ESC) {
- break;
- }
- if(key_val == DOWN && records_found) {
- skp = 0;
- /* Display with normal attribute the current row. */
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), desc_len, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_N]);
-
- if (d4skip(dbfile, 1) == r4eof) {
- d4bottom(dbfile);
- cur_row --;
- }
- d4unlock_index(dbfile);
- if (cur_row == maxrow) {
- cur_row --;
- w4scroll(1);
- }
- cur_row ++;
- /* Display the bar */
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), desc_len, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_S]);
- }
-
- else if (key_val == UP && records_found) {
- skp = 0;
- /* Display with normal attribute the current row. */
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), desc_len, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_N]);
-
- if (d4skip(dbfile, -1)) {
- d4top(dbfile);
- cur_row ++;
- }
- d4unlock_index(dbfile);
-
- if (cur_row == 0) {
- cur_row ++;
- w4scroll(-1);
- }
- cur_row --;
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), desc_len, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_S]);
- }
- } /* ==L1== */
-
- /* Close the window and send to g4read() the key to execute. */
- free(code);
- free(desc);
- free(sk);
- w4deactivate(browse_wref);
- w4close(browse_wref);
- return(HOME);
- }
-
- /*******************************************************************/
- static gfb_fillwindow(dbfile, desc_len, code_len, maxrow, to_skp)
- D4DATA *dbfile;
- int desc_len, code_len, to_skp;
- int maxrow;
- {
- int count;
- int cur_row;
-
- w4clear(0);
- for(cur_row = 0; cur_row <= maxrow ; cur_row ++) {
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), desc_len, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_N]);
- if( d4skip(dbfile, 1))
- break;
- d4unlock_index(dbfile);
- }
- d4unlock_index(dbfile);
- d4unlock_all_data(dbfile);
- if(cur_row > maxrow)
- cur_row = maxrow;
- /* Skip to the first record found. */
- for(count = 0 ; count <= cur_row; count ++) {
- d4skip(dbfile, -1);
- d4unlock_index(dbfile);
- }
- cur_row = 0;
- /* Display the bar */
- w4num_att(cur_row, 0, f4str( d4field_j(dbfile, 2)), to_skp, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, desc_len +1, f4str( d4field_j(dbfile ,1)), code_len, custom[BROWSER_S]);
- }
-
- /*****************************************************************************/
- /* Function: int gfmaster_help(GET *get_ptr, char *data_buffer, int file_ref) */
- /* Description: This function is not called directly. It is used as a */
- /* parameter to g4call(): g4call( gfb_menu, file_ref); */
- /* Actually gfb_help() calls gfb() if F3 is pressed. */
- /* Parameters: GET *get_ptr -> The get structure of the field. */
- /* char *data_buffer -> The currently entered information. */
- /* int file_ref -> The file reference number used for the */
- /* menu entries. */
- /* Returns: A value significant for g4call routine. */
- /* >0 input data(as if it was read from the keyboard). */
- /* =0 Read the next keyboard character as normal input data. */
- /* -1 Call this call routine again without getting any keyboard */
- /* data from the user. */
- /* Uses: gfb(). */
- /*****************************************************************************/
- gfmaster_help( get_ptr, data_buffer, file_ref )
- GET *get_ptr;
- char *data_buffer;
- int file_ref;
- {
- D4DATA *dbfile; /* Database file used for the menu. */
- int code_len; /* Length of frequently used fields. */
- int surn_len;
- int key_val ; /* Key Pressed. */
- int count; /* Counter. */
- int already_openf; /* Already open file flag. */
- char hs[150];
- char ss[150];
-
- static changed_flag = FALSE;
-
- code_len = get_ptr->width_data;
-
- key_val = g4char() ;
-
- /* If F3 is pressed call gfb(). If gfb() returns Esc call the routine again.*/
- if ( key_val == GETFROMBROWSE_KEY ) {
- dbfile = d4data( &set, dbf[file_ref]);
- if( dbfile == 0 ) {
- dbfile = d4open( &set, files(file_ref));
- already_openf = FALSE; /* I shall close the file later. */
- }
- else
- already_openf = TRUE;
- d4tag_select(dbfile , d4tag(dbfile,"CODE_T"));
-
- strcpy(hs, helpline_save);
- strcpy(ss, statusline_save);
- helpline(mes[MH+67]);
- statline(mes[MS+34]);
- key_val = gfmaster( get_ptr, data_buffer, file_ref ) ;
- helpline(hs);
- statline(ss);
- d4tag_select(dbfile , d4tag(dbfile,"CODE_T"));
- if( already_openf == FALSE ) {
- d4close(dbfile);
- }
- if ( key_val == ESC ) key_val = -1 ;
- return( key_val ) ;
- }
-
- /* If a key, which causes g4read to change field, is pressed, if the value */
- /* entered is found in the data base print the description. Otherwise ring */
- /* the bell and stay to the field. */
- else if(key_val == RETURN || key_val == TAB || key_val == DOWN || key_val == UP \
- || key_val == SHIFT_TAB) {
- if(!memcmp(data_buffer, space(code_len),code_len)) {
- if(! changed_flag)
- return(key_val);
- }
-
- changed_flag = FALSE;
- dbfile = d4data( &set, dbf[file_ref]);
- if( dbfile == 0 ) {
- dbfile = d4open( &set, files(file_ref));
- already_openf = FALSE; /* I shall close the file later. */
- }
- else
- already_openf = TRUE;
-
- d4tag_select(dbfile , d4tag(dbfile,"CODE_T"));
-
- surn_len = f4len(d4field(dbfile, "SURNAME"));
-
- /* If the data_buffer is blank... */
- if(!memcmp(data_buffer, space(code_len),code_len)) {
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- space(surn_len), surn_len, custom[MAIN_I]);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(key_val);
- }
-
- /* Convert to uppercase. */
- for(count=0; count<= code_len -1; count ++)
- data_buffer[count] = gtoupper(data_buffer[count]);
-
- /* If a code was entered. */
- zerofill(data_buffer+1, code_len-1);
- switch(data_buffer[0]) {
- case 'ü':
- data_buffer[0] = 'B';
- break;
- case 'ä':
- data_buffer[0] = 'E';
- break;
- case 'I':
- data_buffer[0] = 'I';
- break;
- case 'ì':
- data_buffer[0] = 'J';
- break;
- case 'ë':
- data_buffer[0] = 'K';
- break;
- case 'Ä':
- data_buffer[0] = 'O';
- break;
- case 'Æ':
- data_buffer[0] = 'T';
- break;
- case 'à':
- data_buffer[0] = 'Z';
- break;
- }
- w4num_att(get_ptr->row, get_ptr->col, data_buffer,\
- code_len, custom[MAIN_I]);
-
- /* Get file pointer and set some frequently used variables. */
-
- /* If the code was not found. */
- if( d4seek(dbfile, data_buffer) != 0 ) {
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- space(surn_len), surn_len, custom[MAIN_I]);
- w4display("",mes[ME+4],mes[MH+16], (char *) 0);
- memcpy(data_buffer, space(code_len),code_len);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(HOME);
- }
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- f4str(d4field(dbfile, "SURNAME")), surn_len, custom[MAIN_I]);
- if(already_openf == FALSE)
- d4close(dbfile);
- return(key_val);
- }
- else {
- changed_flag = TRUE;
- return(key_val);
- }
- }
-
- /*****************************************************************************/
- /* Function: int gfmaster(GET *get_ptr, char *data_buffer, int file_ref) */
- /* Description: This function is not called directly. It is used as a */
- /* parameter to g4call(): g4call( gfb, file_ref); */
- /* Parameters: GET *get_ptr -> The get structure of the field. */
- /* char *data_buffer -> The currently entered information. */
- /* int file_ref -> The file reference number used for the */
- /* menu entries. */
- /* Returns: A value significant for g4call routine. */
- /* >0 input data(as if it was read from the keyboard). */
- /* =0 Read the next keyboard character as normal input data. */
- /* -1 Call this call routine again without getting any keyboard */
- /* data from the user. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int gfmaster(get_ptr, data_buffer, file_ref)
- GET *get_ptr;
- char *data_buffer;
- int file_ref;
- {
- D4DATA *dbfile; /* Database file used for the menu. */
- int browse_wref; /* Windows References. */
- int previous_wref;
- int code_len; /* Length of frequently used fields. */
- int surn_len;
- int surnk_len;
- int win_s, win_e; /* Browse y and y1 coordinates. */
- int maxrow; /* maxrow -1 = Maximum number of items in menu. */
- int cur_row;
- int key_val; /* Key pressed. */
- int count;
- int records_found;
-
- int skp;
- int seek_val;
- long cur_record;
- int skp_flag;
- char *sk;
-
- maxrow = 5;
- skp = 0;
- skp_flag = 0;
-
-
- /* Set the file pointer and set some frequently used variables. */
- dbfile = d4data( &set, dbf[file_ref]);
-
- records_found = TRUE;
- code_len = get_ptr->width_data;
- surn_len = f4len(d4field(dbfile, "SURNAME"));
- surnk_len = f4len(d4field(dbfile, "SURNAMEKEY"));
-
- win_s = 78 - (code_len + surn_len + 2);
- win_e = 78;
-
- if((sk = calloc(surnk_len + 1, sizeof(char))) == NULL) {
- w4display(mes[MT], mes[ME+1], (char *) 0);
- w4exit(1);
- }
-
- memcpy(sk, space(surnk_len), surnk_len);
-
- /* Select Code TAG and try to find the CODE in the entry */
- /* field in order to set the database pointer correctly. */
- d4tag_select(dbfile , d4tag(dbfile,"CODE_T"));
- /* Convert to uppercase. */
- for(count=0; count<= code_len -1; count ++)
- data_buffer[count] = gtoupper(data_buffer[count]);
- /* If the code was not found. */
- if( d4seek(dbfile, data_buffer) != 0) {
- d4unlock_index(dbfile);
- d4tag_select(dbfile , d4tag(dbfile,"SURNAMEKEY_T"));
- if(d4top(dbfile)) {
- records_found = FALSE;
- }
- else
- records_found = TRUE;
- d4unlock_index(dbfile);
- }
- d4unlock_index(dbfile);
-
- /* The records are ordered with SURNAMEKEY_T TAG. */
- d4tag_select(dbfile , d4tag(dbfile,"SURNAMEKEY_T"));
-
- previous_wref = w4select(-1);
- /* Open the browse window. */
- browse_wref = w4define(get_ptr->row + 1, win_s,\
- get_ptr->row + maxrow+3, win_e);
- w4attribute(custom[BROWSER_N]);
- w4border(SINGLE, custom[BROWSER_B]);
- w4title(0, 1, mes[MT+16], custom[BROWSER_B]);
- w4popup();
- w4memory();
- w4activate( browse_wref );
- w4cursor(-1, -1);
-
- gfmaster_fillwindow(dbfile, surn_len, code_len, maxrow, surn_len);
- cur_row = 0;
-
- for (;;) { /* ==L1== */
- key_val = g4char();
-
- if ( key_val == F1 ) {
- help("GET_FROM_MASTER");
- continue ;
- }
- /* ==If Alphanumeric== */
- if( ((key_val == BACK_SPACE) || \
- (key_val >= 32 && key_val <= 175) || \
- (key_val >= 224 && key_val <=233)) && records_found) {
-
- if(key_val == BACK_SPACE) {
- if(skp == 0) {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- skp_flag = 1;
- }
- else if(skp > 1) {
- skp --;
- skp --;
- }
- else if(skp == 1) {
- skp = 0;
- skp_flag = 1;
- d4top(dbfile);
- gfmaster_fillwindow(dbfile, surn_len, code_len, maxrow, surn_len);
- cur_row = 0;
- }
- }
- else if(skp == surnk_len){
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- skp --;
- }
- else {
- sk[skp] = key_val;
- }
-
- if( !skp_flag) { /* ==If normal mode== */
- sk[skp + 1] = '\0';
- for(count=0 ; count <= skp; count ++)
- sk[count] = gtoupper(sk[count]);
- cur_record = d4recno(dbfile);
- seek_val = d4seek(dbfile, sk);
- d4unlock_index(dbfile);
-
- /* ==If found or just after it.==*/
- if(seek_val == r4after || seek_val == 0 || seek_val == r4eof) {
- /* If NOT really found... */
- if( memcmp(sk, f4str( d4field(dbfile, "SURNAMEKEY")), skp + 1)) {
- g4bell_set(1);
- g4bell();
- g4bell_set(0);
- seek_val = d4go(dbfile, cur_record);
- if( seek_val != 0 ) { /* If the record no longer exists. */
- d4top(dbfile);
- gfmaster_fillwindow(dbfile, surn_len, code_len, maxrow, surn_len);
- cur_row = 0;
- } /* If the record no longer exists. */
- } /* If NOT really found. */
- else { /* If really found... */
- /* Fill the window with records. (normal attribute). */
- gfmaster_fillwindow(dbfile, surn_len, code_len, maxrow, skp + 1);
- cur_row = 0;
- skp ++;
- } /* If really found... */
- } /* ==If found or just after it.==*/
- } /* If normal mode */
- skp_flag = 0;
- } /* ==If Alphanumeric== */
-
- if(key_val == RETURN && records_found) {
- free(sk);
- w4deactivate(browse_wref);
- w4close(browse_wref);
- /* Fill the buffer with the correct code and print the surname */
- /* Next to the field. */
- w4select(previous_wref);
- d4tag_select(dbfile , d4tag(dbfile,"CODE_T"));
- memcpy(data_buffer, f4str( d4field_j(dbfile, 1)), code_len);
- d4seek(dbfile, data_buffer);
- d4unlock_index(dbfile);
- w4num_att(get_ptr->row, get_ptr->col + code_len + 2, \
- f4str(d4field(dbfile,"SURNAME")), surn_len, custom[MAIN_I]);
- return(TAB);
- }
- if(key_val == ESC) {
- break;
- }
- if(key_val == DOWN && records_found) {
- skp = 0;
- /* Display with normal attribute the current row. */
- w4num_att(cur_row, 0, f4str( d4field(dbfile,"SURNAME")), surn_len, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile ,"CODE")), code_len, custom[BROWSER_N]);
-
- if (d4skip(dbfile, 1) == r4eof) {
- d4bottom(dbfile);
- cur_row --;
- }
- d4unlock_index(dbfile);
- if (cur_row == maxrow) {
- cur_row --;
- w4scroll(1);
- }
- cur_row ++;
- /* Display the bar */
- w4num_att(cur_row, 0, f4str( d4field(dbfile, "SURNAME")), surn_len, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile ,"CODE")), code_len, custom[BROWSER_S]);
- }
-
- else if (key_val == UP && records_found) {
- skp = 0;
- /* Display with normal attribute the current row. */
- w4num_att(cur_row, 0, f4str( d4field(dbfile, "SURNAME")), surn_len, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile ,"CODE")), code_len, custom[BROWSER_N]);
-
- if (d4skip(dbfile, -1)) {
- d4top(dbfile);
- cur_row ++;
- }
- d4unlock_index(dbfile);
-
- if (cur_row == 0) {
- cur_row ++;
- w4scroll(-1);
- }
- cur_row --;
- w4num_att(cur_row, 0, f4str( d4field(dbfile, "SURNAME")), surn_len, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile ,"CODE")), code_len, custom[BROWSER_S]);
- }
- } /* ==L1== */
-
- /* Close the window and send to g4read() the key to execute. */
- free(sk);
- w4deactivate(browse_wref);
- w4close(browse_wref);
- w4select(previous_wref);
- return(HOME);
- }
-
- static gfmaster_fillwindow(dbfile, surn_len, code_len, maxrow, to_skp)
- D4DATA *dbfile;
- int surn_len;
- int code_len;
- int maxrow;
- int to_skp;
- {
- int cur_row;
- int count;
-
- /* Fill the window with records. (normal attribute). */
- w4clear(0);
- for(cur_row = 0; cur_row <= maxrow ; cur_row ++) {
- w4num_att(cur_row, 0, f4str( d4field(dbfile, "SURNAME")), surn_len, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_N]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile ,"CODE")), code_len, custom[BROWSER_N]);
- if( d4skip(dbfile, 1))
- break;
- d4unlock_index(dbfile);
- }
- d4unlock_index(dbfile);
- d4unlock_all_data(dbfile);
-
- if(cur_row > maxrow)
- cur_row = maxrow;
- /* Skip to the first record found. */
- for(count = 0 ; count <= cur_row; count ++) {
- d4skip(dbfile, -1);
- d4unlock_index(dbfile);
- }
- cur_row = 0;
-
- /* Display the bar */
- w4num_att(cur_row, 0, f4str( d4field(dbfile, "SURNAME")), to_skp, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len, "│", 1, custom[BROWSER_S]);
- w4num_att(cur_row, surn_len +1, f4str( d4field(dbfile , "CODE")), code_len, custom[BROWSER_S]);
- }
-
-
- /*****************************************************************************/
- /* Function: int gtoupper(char ch) */
- /* Description: Converts a greek or latin character to upper case */
- /* Parameters: char ch -> The character to be converted. */
- /* Returns: The converted character as integer. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int gtoupper(ch)
- int ch;
- {
- char strlow[61]; /* Mattrix of lower case chars (always the same). */
- char strcap[61]; /* Mattrix of upper case chars (depends on definitions). */
- int offset; /* Offset of character in the mattrixes. */
-
- if((ch >= 152 && ch <= 175) || (ch >= 224 && ch <= 233) || (ch >= 97 && ch <= 122)) {
- strcpy(strlow, "abcdefghijklmnopqrstuvwxyzÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐½¼¡«»α¬ßΓπσΣτΦµΘ");
- #ifdef CSET437
- strcpy(strcap, "ABCDEFGHIJKLMNOPQRSTUVWXYZÇüéâäàåçêëèïîìÄÅÉæÆôöòûùæÇäåêêôôÄù");
- #endif
- offset = strchr(strlow, ch) - strlow;
- return(strcap[offset]);
- }
- else
- return(ch);
- }
-
-
- /*****************************************************************************/
- /* Function: int grtolat(char ch) */
- /* Description: Converts a greek character to latin. */
- /* Parameters: char ch -> The character to be converted. */
- /* Returns: The converted character as integer. */
- /* Uses: Nothing. */
- /*****************************************************************************/
- int grtolat(int ch)
- {
- char strgr[59]; /* Mattrix of greek characters. */
- char strlat[59]; /* Mattrix of latin characters. */
- int offset; /* Offset of character in the mattrixes. */
-
- if( (ch >= 152 && ch <= 175) ||
- (ch >= 224 && ch <= 233) ||
- (ch >= 128 && ch <= 151) ) {
-
- strcpy(strgr, "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐½¼¡«»α¬ßΓπστµΘΣΦ");
- strcpy(strlat, "ABGDEZHUIKLMNJOPRSTYFXCVabgdezhuiklmnjoprstyfxcvsaehiyoviy");
- offset = strchr(strgr, ch) - strgr;
- return(strlat[offset]);
- }
- else
- return(ch);
- }
-
- cd_iep()
- {
- #ifndef IEP_UNIX
- if(memcmp(iepdrive, space(3), 3)) {
- _chdrive(iepdrive[0] - 64);
- }
- #endif
- ieppath[strlen(ieppath) -1] = '\0';
- chdir(ieppath);
- ieppath[strlen(ieppath)] = '\\';
- }
-
-
- cd_doc()
- {
- #ifndef IEP_UNIX
- if(memcmp(docdrive, space(3), 3)) {
- _chdrive(docdrive[0] - 64);
- }
- #endif
- docpath[strlen(docpath) -1] = '\0';
- chdir(docpath);
- docpath[strlen(docpath)] = '\\';
- }
-