home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-12-20 | 41.2 KB | 1,276 lines |
-
-
-
- =================================================================
- QXREF: The Telemacus Cross Reference Utility for Turbo C
- QXREF: Line numbers are enclosed in brackets, [ ]
- QXREF: Logic levels are enclosed in arrows, < >
- QXREF: Hold the <ALT> key down to freeze the screen.
- QXREF: Use redirection in the command tail for file capture.
- QXREF: Processing pickfile.c
-
-
-
-
- [ 1] < 0> /*
- [ 2] < 0> DEVELOPING A FILE SELECTION WINDOW IN TURBO C
- [ 3] < 0> ----------------------------------------------
- [ 4] < 0> Garry J. Vass [72307,3311]
- [ 5] < 0> Copyright (c), 1987, Telemacus Software Associates
- [ 6] < 0> This file contains the nucleus routines for developing
- [ 7] < 0> a file selection window using Turbo C and QLIB (release
- [ 8] < 0> 4 or above). File selection windows have the following
- [ 9] < 0> advantages:
- [ 10] < 0> - As can be seen here, they are VERY easy to develop.
- [ 11] < 0> - The user is not burdened with having to remember
- [ 12] < 0> file names;
- [ 13] < 0> - The programmer has more control over the selection
- [ 14] < 0> and processing of files; and
- [ 15] < 0> - The overall presentation of the program is improved.
- [ 16] < 0> GENERAL NOTES, CAVEATS, AND DRUNKEN RAMBLINGS
- [ 17] < 0> ---------------------------------------------
- [ 18] < 0> Use the LARGE memory model for compiling this program.
- [ 19] < 0> Where possible, I tried to use the keyboard conventions (arrows,
- [ 20] < 0> home, end, etc) in the file selection routines found in NU.EXE
- [ 21] < 0> (viz., Norton Utility). The program does not have the feature
- [ 22] < 0> of scrolling the entire screen display to accomodate an additional
- [ 23] < 0> column.
- [ 24] < 0> This prototype stubs in the error processing if the maximum
- [ 25] < 0> number of files has been exceeded. These must be added
- [ 26] < 0> according to the application.
- [ 27] < 0> An array structure is used to store and present the file names.
- [ 28] < 0> Arrays are handy because the members can be easily accessed. They
- [ 29] < 0> are troublesome because they must be specified to an explicit size
- [ 30] < 0> and must be contained within the data segment. Production quality
- [ 31] < 0> and/or heavy duty directory processing routines should use
- [ 32] < 0> linked lists, or related dynamic structures, for storing file names.
- [ 33] < 0> This program was developed on an IBM AT with EGA under DOS 3.2 using
- [ 34] < 0> Turbo C 1.0 and QLIB-4. The functions (modified for linked list
- [ 35] < 0> structures and extended error processing logic) were incorporated
- [ 36] < 0> into a production-level expert system - with hooks into Turbo Prolog.
- [ 37] < 0> The application itself deals with the optimal allocation/assignment
- [ 38] < 0> and PSA good delivery rules of wirable MBS pools (a Wall Street
- [ 39] < 0> investment banking application). Thanks, Borland!!
- [ 40] < 0> As might be expected, OS/2 users must use the dos box for this
- [ 41] < 0> program. QLIB for OS/2 is currently in the works...
- [ 42] < 0> */
- [ 43] < 0> /*********************** BEGIN SOURCE FOR PICKFILE ********************/
- [ 44] < 0> /*********************** INCLUDES FOR PICKFILE ************************/
- [ 45] < 0> /* dir.h contains the directory get and file name parse functions */
- [ 46] < 0> #include <dir.h>
- [ 47] < 0> /* qtypes.c contains the requisite type declarations for this program */
- [ 48] < 0> #include <qtypes.c>
- [ 49] < 0> /* qkeys.c contains the qreadkbd translation tokens (optional) */
- [ 50] < 0> #include <qkeys.c> /* can be found in go bor */
- [ 51] < 0> /* qcolors.c contains the english tokens for screen attributes (optional)*/
- [ 52] < 0> #include <qcolors.c> /* can be found in go bor */
- [ 53] < 0> /*********************** END OF INCLUDES FOR PICKDIR *******************/
- [ 54] < 0> /*********************** DEFINES FOR PICKFILE **************************/
- [ 55] < 0> #define filename filefb.ff_name /* abbreviation */
- [ 56] < 0> #define file_att filefb.ff_attrib /* abbreviation */
- [ 57] < 0> #define filesize filefb.ff_fsize /* abbreviation */
- [ 58] < 0> #define filedate filefb.ff_fdate /* abbreviation */
- [ 59] < 0> #define filetime filefb.ff_ftime /* abbreviation */
- [ 60] < 0> #define MAX_FILES 100 /* Max files before error logic */
- [ 61] < 0> #define WINDOW_UL_X 0 /* Box coordinates for PICKFILE */
- [ 62] < 0> #define WINDOW_UL_Y 0 /* window */
- [ 63] < 0> #define WINDOW_LR_X 79 /* */
- [ 64] < 0> #define WINDOW_LR_Y 22 /* */
- [ 65] < 0> #define XINCREMENT 15 /* Horizontal increment */
- [ 66] < 0> #define FILE_BACK black /* File name display background */
- [ 67] < 0> #define FILE_FORE white /* File name display foreground */
- [ 68] < 0> #define WINDOW_DEPTH WINDOW_LR_Y - WINDOW_UL_Y
- [ 69] < 0> /************************ END OF DEFINES FOR PICKFILE ******************/
- [ 70] < 0> /************************ STRUCTS AND TYPEDEFS FOR PICKFILE ************/
- [ 71] < 0> struct ffblk filefb;
- [ 72] < 0> /* see dir.h */
- [ 73] < 0> typedef struct
- [ 74] < 1> {
- [ 75] < 1> qint sx;
- [ 76] < 1> /* screen column for this file */
- [ 77] < 1> qint sy;
- [ 78] < 1> /* screen row for this file */
- [ 79] < 1> struct ffblk file_info;
- [ 80] < 1> /* nested structure */
- [ 81] < 1> }
- [ 82] < 0> full_file_record;
- [ 83] < 0> /******************** END OF STRUCTS AND TYPES FOR PICKFILE ***************/
- [ 84] < 0> /******************* GLOBAL VARIABLES FOR PICKFILE ***********************/
- [ 85] < 0> full_file_record
- [ 86] < 0> ffr[MAX_FILES];
- [ 87] < 0> /* Array for found files */
- [ 88] < 0> int filesfound = 0;
- [ 89] < 0> /* Count for found files */
- [ 90] < 0> qint currentsx = 0;
- [ 91] < 0> /* For screen save/restore */
- [ 92] < 0> qint currentsy = 0;
- [ 93] < 0> /* For screen save/restore */
- [ 94] < 0> qint maincounter = 0;
- [ 95] < 0> /* General index */
- [ 96] < 0> qint originalx = 0;
- [ 97] < 0> /* For screen save/restore */
- [ 98] < 0> qint originaly = 0;
- [ 99] < 0> /* For screen save/restore */
- [ 100] < 0> qstring mainstring = "";
- [ 101] < 0> /* For return value */
- [ 102] < 0> prompt_record filespecification =
- [ 103] < 1> {
- [ 104] < 1> "PLEASE ENTER A DIRECTORY SEARCH SPECIFICATION: ",/* tag qstring */
- [ 105] < 1> "*.exe", /* tag value */
- [ 106] < 1> 0, /* tag x*/
- [ 107] < 1> 12, /* tag y*/
- [ 108] < 1> 50, /* val x */
- [ 109] < 1> 12, /* val y */
- [ 110] < 1> 13, /* max chars */
- [ 111] < 1> bright_white, /* tag fore */
- [ 112] < 1> black, /* tag back */
- [ 113] < 1> white, /* val fore */
- [ 114] < 1> dark_blue, /* val back */
- [ 115] < 1> 0, /* case conversion */
- [ 116] < 1> " ", /* edit mask */
- [ 117] < 1> " ", 0, " ", " ", " ", 0
- [ 118] < 1> }
- [ 119] < 0> ;
- [ 120] < 0> /************************* END OF GLOBAL VARIABLES FOR PICKFILE ***********/
- [ 121] < 0> /**************************************************************************/
- [ 122] < 0> /************************* PICKFILE SUPPORT FUNCTIONS ********************/
- [ 123] < 0> void initialize_coordinates()
- [ 124] < 1> {
- [ 125] < 1> /*
- [ 126] < 1> This function simply initializes the screen coordinates to where
- [ 127] < 1> the display of file names should begin.
- [ 128] < 1> */
- [ 129] < 1> currentsx = WINDOW_UL_X + 2;
- [ 130] < 1> currentsy = WINDOW_UL_Y + 1;
- [ 131] < 1> }
- [ 132] < 0> /*************************************************************************/
- [ 133] < 0> void update_current_coordinates()
- [ 134] < 1> {
- [ 135] < 1> /*
- [ 136] < 1> This service function increments the screen coordinates
- [ 137] < 1> in a verticle manner. As each column is filled, the next
- [ 138] < 1> column is calculated using the XINCREMENT variable.
- [ 139] < 1> */
- [ 140] < 1> ++currentsy;
- [ 141] < 1> if (currentsy >= WINDOW_LR_Y)
- [ 142] < 2> {
- [ 143] < 2> currentsy = WINDOW_UL_Y + 1;
- [ 144] < 2> currentsx = currentsx + XINCREMENT;
- [ 145] < 2> if (currentsx + XINCREMENT > WINDOW_LR_X)
- [ 146] < 3> {
- [ 147] < 3> printf("program limits exceeded\n");
- [ 148] < 3> /* calls to error logic go here */
- [ 149] < 3> abort();
- [ 150] < 3> }
- [ 151] < 2> }
- [ 152] < 1> }
- [ 153] < 0> /*************************************************************************/
- [ 154] < 0> qint get_files
- [ 155] < 0> (
- [ 156] < 0> qstring search_specification
- [ 157] < 0> )
- [ 158] < 1> {
- [ 159] < 1> /*
- [ 160] < 1> This function accepts a search specification (such as *.*) and loops
- [ 161] < 1> through the current directory, storing each match into an array.
- [ 162] < 1> */
- [ 163] < 1> int filerc = 0;
- [ 164] < 1> filesfound = 0;
- [ 165] < 1> filerc = findfirst(search_specification, &filefb, 0xff);
- [ 166] < 1> while (!filerc)
- [ 167] < 2> {
- [ 168] < 2> if ((filename[0] != 46) && /* exclude those pesky periods... */
- [ 169] < 2> (file_att != 0x10)) /* and subdirectories */
- [ 170] < 3> {
- [ 171] < 3> ffr[filesfound].sx = currentsx;
- [ 172] < 3> ffr[filesfound].sy = currentsy;
- [ 173] < 3> ffr[filesfound].file_info = filefb;
- [ 174] < 3> update_current_coordinates();
- [ 175] < 3> ++filesfound;
- [ 176] < 3> }
- [ 177] < 2> if (filesfound >= MAX_FILES)
- [ 178] < 3> {
- [ 179] < 3> printf("program limits exceeded\n");
- [ 180] < 3> /* calls to error logic go here */
- [ 181] < 3> abort();
- [ 182] < 3> }
- [ 183] < 2> filerc = findnext(&filefb);
- [ 184] < 2> }
- [ 185] < 1> return(filesfound - 1);
- [ 186] < 1> }
- [ 187] < 0> /*************************************************************************/
- [ 188] < 0> void display_file_box()
- [ 189] < 1> {
- [ 190] < 1> /*
- [ 191] < 1> This is the engine presentation routine. It draws a box then
- [ 192] < 1> displays all the matched file names at the screen coordinates.
- [ 193] < 1> */
- [ 194] < 1> qint displaycounter;
- [ 195] < 1> qdrawbox
- [ 196] < 1> (WINDOW_UL_X,
- [ 197] < 1> WINDOW_UL_Y,
- [ 198] < 1> WINDOW_LR_X,
- [ 199] < 1> WINDOW_LR_Y,
- [ 200] < 1> "",
- [ 201] < 1> "[ PRESS F1 FOR HELP ]",
- [ 202] < 1> (dark_blue<<4) | white,
- [ 203] < 1> bright_white,
- [ 204] < 1> bright_white);
- [ 205] < 1> for (displaycounter=0;displaycounter<=filesfound;++displaycounter)
- [ 206] < 2> {
- [ 207] < 2> qsnap
- [ 208] < 2> (ffr[displaycounter].file_info.ff_name,
- [ 209] < 2> ffr[displaycounter].sx,
- [ 210] < 2> ffr[displaycounter].sy,
- [ 211] < 2> bright_white);
- [ 212] < 2> }
- [ 213] < 1> }
- [ 214] < 0> /*************************************************************************/
- [ 215] < 0> void unhighlight_area
- [ 216] < 0> (
- [ 217] < 0> qint startx,
- [ 218] < 0> qint starty,
- [ 219] < 0> qint length
- [ 220] < 0> )
- [ 221] < 1> {
- [ 222] < 1> qreset_box_attribute
- [ 223] < 1> (startx,
- [ 224] < 1> starty,
- [ 225] < 1> startx + length,
- [ 226] < 1> starty,
- [ 227] < 1> (FILE_BACK<<4) | FILE_FORE);
- [ 228] < 1> }
- [ 229] < 0> /*************************************************************************/
- [ 230] < 0> void highlight_area
- [ 231] < 0> (
- [ 232] < 0> qint startx,
- [ 233] < 0> qint starty,
- [ 234] < 0> qint length
- [ 235] < 0> )
- [ 236] < 1> {
- [ 237] < 1> qreset_box_attribute
- [ 238] < 1> (startx,
- [ 239] < 1> starty,
- [ 240] < 1> startx + length,
- [ 241] < 1> starty,
- [ 242] < 1> (FILE_FORE<<4) | FILE_BACK);
- [ 243] < 1> }
- [ 244] < 0> /*************************************************************************/
- [ 245] < 0> void give_file_help()
- [ 246] < 1> {
- [ 247] < 1> /*
- [ 248] < 1> This function displays the help window when the F1 key is hit.
- [ 249] < 1> */
- [ 250] < 1> qscreen file_help_screen;
- [ 251] < 1> qint file_help_ul_x = 20;
- [ 252] < 1> qint file_help_ul_y = 5;
- [ 253] < 1> qint file_help_lr_x = 60;
- [ 254] < 1> qint file_help_lr_y = 15;
- [ 255] < 1> qint file_help_index;
- [ 256] < 1> qstring file_help_text[9] =
- [ 257] < 2> {
- [ 258] < 2> "Use the arrow keys (Up, Down, Home, ",
- [ 259] < 2> "and End, to orient the highlighted ",
- [ 260] < 2> "area on the file you wish to select. ",
- [ 261] < 2> "Press the Enter (Return, Advance, ",
- [ 262] < 2> "etc) key to exit with your selection.",
- [ 263] < 2> " ",
- [ 264] < 2> "To exit without making a selection, ",
- [ 265] < 2> "press the Escape key. ",
- [ 266] < 2> " "
- [ 267] < 2> }
- [ 268] < 1> ;
- [ 269] < 1> qwindow_save /* save the screen area */
- [ 270] < 1> (file_help_ul_x,
- [ 271] < 1> file_help_ul_y,
- [ 272] < 1> file_help_lr_x,
- [ 273] < 1> file_help_lr_y,
- [ 274] < 1> file_help_screen);
- [ 275] < 1> qdrawbox /* draw a box for the help window */
- [ 276] < 1> (file_help_ul_x,
- [ 277] < 1> file_help_ul_y,
- [ 278] < 1> file_help_lr_x,
- [ 279] < 1> file_help_lr_y,
- [ 280] < 1> "",
- [ 281] < 1> "[ hit any key to continue ]",
- [ 282] < 1> bright_white,
- [ 283] < 1> bright_white,
- [ 284] < 1> bright_white | blink);
- [ 285] < 1> for (file_help_index=0;file_help_index<9;++file_help_index)
- [ 286] < 2> {
- [ 287] < 2> qsnap /* display the help text */
- [ 288] < 2> (file_help_text[file_help_index],
- [ 289] < 2> file_help_ul_x + 2,
- [ 290] < 2> file_help_ul_y + file_help_index + 1,
- [ 291] < 2> bright_white);
- [ 292] < 2> }
- [ 293] < 1> file_help_index = qreadkbd();
- [ 294] < 1> /* wait for a key */
- [ 295] < 1> qwindow_restore /* restore the screen area */
- [ 296] < 1> (file_help_ul_x,
- [ 297] < 1> file_help_ul_y,
- [ 298] < 1> file_help_lr_x,
- [ 299] < 1> file_help_lr_y,
- [ 300] < 1> file_help_screen);
- [ 301] < 1> }
- [ 302] < 0> /*************************************************************************/
- [ 303] < 0> qint pick_file_menu()
- [ 304] < 1> {
- [ 305] < 1> /*
- [ 306] < 1> This is the driver function for the PICKFILE presentation. It is
- [ 307] < 1> similar in form and structure to the qbounce(~~~) function (available
- [ 308] < 1> at go bor).
- [ 309] < 1> */
- [ 310] < 1> qint menucounter;
- [ 311] < 1> qint keypressed;
- [ 312] < 1> keypressed = 0;
- [ 313] < 1> menucounter = 0;
- [ 314] < 1> qgotoxy(0, 25);
- [ 315] < 1> highlight_area /* highlight the first file */
- [ 316] < 1> (ffr[menucounter].sx,
- [ 317] < 1> ffr[menucounter].sy,
- [ 318] < 1> XINCREMENT - 1);
- [ 319] < 1> while (keypressed != return_pressed)
- [ 320] < 2> {
- [ 321] < 2> keypressed = qreadkbd();
- [ 322] < 2> /* get a keystroke */
- [ 323] < 2> if (keypressed != return_pressed)
- [ 324] < 3> {
- [ 325] < 3> unhighlight_area
- [ 326] < 3> (ffr[menucounter].sx,
- [ 327] < 3> ffr[menucounter].sy,
- [ 328] < 3> XINCREMENT - 1);
- [ 329] < 3> switch (keypressed)
- [ 330] < 4> {
- [ 331] < 4> case escape_pressed:
- [ 332] < 5> {
- [ 333] < 5> /* escape means exit with no file selection */
- [ 334] < 5> return (filesfound + 1);
- [ 335] < 5> }
- [ 336] < 4> case f01pressed:
- [ 337] < 5> {
- [ 338] < 5> /* F1 means give help */
- [ 339] < 5> give_file_help();
- [ 340] < 5> break;
- [ 341] < 5> }
- [ 342] < 4> case home_pressed:
- [ 343] < 5> {
- [ 344] < 5> /* HOME means reset the pointer */
- [ 345] < 5> menucounter = 0;
- [ 346] < 5> }
- [ 347] < 4> case up_arrow_pressed:
- [ 348] < 5> {
- [ 349] < 5> /* UP ARROW means go to previous file */
- [ 350] < 5> menucounter = qmax(menucounter - 1, 0);
- [ 351] < 5> break;
- [ 352] < 5> }
- [ 353] < 4> case end_pressed:
- [ 354] < 5> {
- [ 355] < 5> /* END means go to last file */
- [ 356] < 5> menucounter = filesfound;
- [ 357] < 5> break;
- [ 358] < 5> }
- [ 359] < 4> case down_arrow_pressed:
- [ 360] < 5> {
- [ 361] < 5> /* DOWN ARROW means go to next file */
- [ 362] < 5> ++menucounter;
- [ 363] < 5> if (menucounter > filesfound)
- [ 364] < 6> {
- [ 365] < 6> menucounter = 0;
- [ 366] < 6> }
- [ 367] < 5> break;
- [ 368] < 5> }
- [ 369] < 4> case right_arrow_pressed:
- [ 370] < 5> {
- [ 371] < 5> /* RIGHT ARROW means "move over one column" */
- [ 372] < 5> menucounter = menucounter + WINDOW_DEPTH - 1;
- [ 373] < 5> if (menucounter > filesfound)
- [ 374] < 6> {
- [ 375] < 6> menucounter = filesfound;
- [ 376] < 6> }
- [ 377] < 5> break;
- [ 378] < 5> }
- [ 379] < 4> case left_arrow_pressed:
- [ 380] < 5> {
- [ 381] < 5> /* LEFT ARROW means "move back one column" */
- [ 382] < 5> menucounter = qmax(menucounter - WINDOW_DEPTH + 1, 0);
- [ 383] < 5> break;
- [ 384] < 5> }
- [ 385] < 4> }
- [ 386] < 3> highlight_area
- [ 387] < 3> (ffr[menucounter].sx,
- [ 388] < 3> ffr[menucounter].sy,
- [ 389] < 3> XINCREMENT - 1);
- [ 390] < 3> }
- [ 391] < 2> }
- [ 392] < 1> return(menucounter);
- [ 393] < 1> }
- [ 394] < 0> /*************************************************************************/
- [ 395] < 0> void select_a_file
- [ 396] < 0> (
- [ 397] < 0> qstring search_specification,
- [ 398] < 0> qstring file_that_was_selected
- [ 399] < 0> )
- [ 400] < 1> {
- [ 401] < 1> /*
- [ 402] < 1> This is the driver function for PICKFILE engine and presentation.
- [ 403] < 1> */
- [ 404] < 1> /*
- [ 405] < 1> Set the screen coordinates to the upper left corner of the
- [ 406] < 1> presentation box.*/
- [ 407] < 1> initialize_coordinates();
- [ 408] < 1> /* Initialize the parameter to be returned. */
- [ 409] < 1> strcpy(file_that_was_selected, "");
- [ 410] < 1> /* Load the file array with those that matched the specification */
- [ 411] < 1> filesfound = get_files(search_specification);
- [ 412] < 1> /* If anything was found, present the file selection window */
- [ 413] < 1> if (filesfound >= 0)
- [ 414] < 2> {
- [ 415] < 2> /* file sort function goes here */
- [ 416] < 2> display_file_box();
- [ 417] < 2> initialize_coordinates();
- [ 418] < 2> maincounter = 0;
- [ 419] < 2> maincounter = pick_file_menu();
- [ 420] < 2> if (maincounter <= filesfound)
- [ 421] < 3> {
- [ 422] < 3> strcpy(file_that_was_selected, ffr[maincounter].file_info.ff_name);
- [ 423] < 3> }
- [ 424] < 2> }
- [ 425] < 1> qclrscr(bright_white);
- [ 426] < 1> }
- [ 427] < 0> /************************* BECIN MAINLINE *****************************/
- [ 428] < 0> main()
- [ 429] < 1> {
- [ 430] < 1> qint anyint;
- [ 431] < 1> qscreen mainscreen;
- [ 432] < 1> qint mainx;
- [ 433] < 1> qint mainy;
- [ 434] < 1> /*
- [ 435] < 1> Start off by saving the screen at invocation time
- [ 436] < 1> */
- [ 437] < 1> mainx = qwherex();
- [ 438] < 1> mainy = qwherey();
- [ 439] < 1> qwindow_save(0, 0, 79, 24, mainscreen);
- [ 440] < 1> /*
- [ 441] < 1> Clear the screen
- [ 442] < 1> */
- [ 443] < 1> qclrscr(bright_white);
- [ 444] < 1> /*
- [ 445] < 1> Get a file search specification from
- [ 446] < 1> the user.
- [ 447] < 1> */
- [ 448] < 1> qprompt(&filespecification);
- [ 449] < 1> /*
- [ 450] < 1> If the user simply hit carraige return,
- [ 451] < 1> then exit, otherwise process the specification.
- [ 452] < 1> */
- [ 453] < 1> while (filespecification.value[0] > 0)
- [ 454] < 2> {
- [ 455] < 2> qclrscr(bright_white);
- [ 456] < 2> select_a_file(filespecification.value, mainstring);
- [ 457] < 2> qgotoxy(0,25);
- [ 458] < 2> /* hide the cursor */
- [ 459] < 2> if (mainstring[0] > 0)
- [ 460] < 3> {
- [ 461] < 3> /*
- [ 462] < 3> If the variable "mainstring" contains something,
- [ 463] < 3> then a file was selected. Here it is simply
- [ 464] < 3> printed out.
- [ 465] < 3> */
- [ 466] < 3> qsnap("You selected ", 29, 23, bright_white);
- [ 467] < 3> qsnap(mainstring, 44, 23, bright_white);
- [ 468] < 3> }
- [ 469] < 2> else
- [ 470] < 3> {
- [ 471] < 3> /*
- [ 472] < 3> if the variable "mainstring" contains nothing,
- [ 473] < 3> one of two conditions occured:
- [ 474] < 3> 1. Nothing matched the file specification; or
- [ 475] < 3> 2. The user hit <Escape> in the selection process.
- [ 476] < 3> */
- [ 477] < 3> qcenter_line("Nothing found or selected", 23, bright_white);
- [ 478] < 3> }
- [ 479] < 2> /*
- [ 480] < 2> Pause here to demonstrate result.
- [ 481] < 2> */
- [ 482] < 2> qcenter_line("Hit a key to continue", 24, bright_white);
- [ 483] < 2> anyint = qreadkbd();
- [ 484] < 2> /*
- [ 485] < 2> Clear the screen, initialize the prompt, and start over.
- [ 486] < 2> */
- [ 487] < 2> qclrscr(bright_white);
- [ 488] < 2> filespecification.value[0] = 0;
- [ 489] < 2> qprompt(&filespecification);
- [ 490] < 2> }
- [ 491] < 1> /*
- [ 492] < 1> Upon exiting, restore the invocation screen and
- [ 493] < 1> cursor position.
- [ 494] < 1> */
- [ 495] < 1> qwindow_restore(0, 0, 79, 24, mainscreen);
- [ 496] < 1> qgotoxy(mainx, mainy - 1);
- [ 497] < 1> }
- [ 498] < 0> /*********************** END OF PICKFILE ******************************/
- [ 499] < 0> /*
- [ 500] < 0> Misc files follow...
- [ 501] < 0> */
- [ 502] < 0> /***********************************************/
- [ 503] < 0> /* This is the PROJECT file for PICKFILE. */
- [ 504] < 0> /* Modify this in the IDE and use the */
- [ 505] < 0> /* CONTROL KW sequence to save. */
- [ 506] < 0> /*
- [ 507] < 0> /*
- [ 508] < 0> d:\qlib.lib
- [ 509] < 0> pickfile.c
- [ 510] < 0> */
- [ 511] < 0> /* End of the PROJECT file for PICKFILE. */
- [ 512] < 0> /***********************************************/
- [ 513] < 0> /**********************************************************************/
- [ 514] < 0> /* This is the QTYPES.C file for PICKFILE.C. Use this CONTROL KW */
- [ 515] < 0> /* sequence to save this file into your include subdirectory. */
- [ 516] < 0> /* The structures are documented elsewhere, and, in fact, this file */
- [ 517] < 0> /* is optional if the typedefs are included in the 'main' program */
- [ 518] < 0> /********************* begin type declarations ************************/
- [ 519] < 0> /*
- [ 520] < 0> typedef unsigned char qstring[79];
- [ 521] < 0> typedef unsigned char qstring05[5];
- [ 522] < 0> typedef unsigned char qstring20[20];
- [ 523] < 0> typedef unsigned char qstring40[40];
- [ 524] < 0> typedef unsigned char qstring60[60];
- [ 525] < 0> typedef unsigned int qint;
- [ 526] < 0> typedef unsigned long qlong;
- [ 527] < 0> typedef unsigned char qbyte;
- [ 528] < 0> typedef unsigned char qscreen[4096];
- [ 529] < 0> typedef struct
- [ 530] < 0> {
- [ 531] < 0> qstring tag;
- [ 532] < 0> qstring value;
- [ 533] < 0> qint tagx;
- [ 534] < 0> qint tagy;
- [ 535] < 0> qint valx;
- [ 536] < 0> qint valy;
- [ 537] < 0> qint vall;
- [ 538] < 0> qbyte tagf;
- [ 539] < 0> qbyte tagb;
- [ 540] < 0> qbyte valf;
- [ 541] < 0> qbyte valb;
- [ 542] < 0> qint valr;
- [ 543] < 0> qstring valt;
- [ 544] < 0> qstring vale;
- [ 545] < 0> qbyte prmx;
- [ 546] < 0> qstring mhea;
- [ 547] < 0> qstring mtra;
- [ 548] < 0> qstring stid;
- [ 549] < 0> qint poid;
- [ 550] < 0> }
- [ 551] < 0> prompt_record;
- [ 552] < 0> typedef struct qmenustructure
- [ 553] < 0> {
- [ 554] < 0> qint screen_x;
- [ 555] < 0> qint screen_y;
- [ 556] < 0> qint menu_width;
- [ 557] < 0> qint foreground;
- [ 558] < 0> qint background;
- [ 559] < 0> int option_count;
- [ 560] < 0> qint prior_choice;
- [ 561] < 0> qstring title;
- [ 562] < 0> qstring option_text[10];
- [ 563] < 0> }
- [ 564] < 0> qmenurecord;
- [ 565] < 0> */
- [ 566] < 0> /********************* end of type declarations ***********************/
- [ 567] < 0> /* */
- [ 568] < 0> /* End of the QTYPES.C file for PICKFILE */
- [ 569] < 0> /**********************************************************************/
- ===================================================================
-
- QXREF: End of program listing
-
- QXREF: Cross references follow...
-
-
-
- ========== QLIB FAMILY MEMBERS ==========
-
- -----> qcenter_line
- 477
- 482
- -----> qclrscr
- 425
- 443
- 455
- 487
- -----> qdrawbox
- 195
- 275
- -----> qgotoxy
- 314
- 458
- 496
- -----> qint
- 76
- 78
- 91
- 93
- 95
- 97
- 99
- 154
- 194
- 217
- 218
- 219
- 232
- 233
- 234
- 251
- 252
- 253
- 254
- 255
- 303
- 310
- 311
- 430
- 432
- 433
- -----> qmax
- 350
- 382
- -----> qprompt
- 448
- 489
- -----> qreadkbd
- 294
- 322
- 483
- -----> qreset_box_attribute
- 222
- 237
- -----> qscreen
- 250
- 431
- -----> qsnap
- 207
- 287
- 466
- 467
- -----> qstring
- 101
- 156
- 256
- 397
- 398
- -----> qwherex
- 437
- -----> qwherey
- 438
- -----> qwindow_restore
- 295
- 495
- -----> qwindow_save
- 269
- 439
-
-
- ========== TURBO C COMPILER DIRECTIVES ==========
-
- -----> #define
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- -----> #include
- 46
- 48
- 50
- 52
-
-
- ========== TURBO C KEY WORDS ==========
-
- -----> break
- 340
- 351
- 357
- 367
- 377
- 383
- -----> case
- 331
- 336
- 342
- 347
- 353
- 359
- 369
- 379
- -----> else
- 469
- -----> for
- 205
- 285
- -----> if
- 141
- 145
- 168
- 177
- 323
- 363
- 373
- 413
- 420
- 459
- -----> int
- 89
- 163
- -----> return
- 185
- 334
- 392
- -----> struct
- 72
- 73
- 80
- -----> switch
- 329
- -----> typedef
- 73
- -----> void
- 123
- 133
- 188
- 215
- 230
- 245
- 395
- -----> while
- 166
- 319
- 453
-
-
- ========== TURBO C DIR FAMILY ==========
-
- -----> ffblk
- 72
- 80
- -----> findfirst
- 165
- -----> findnext
- 183
-
-
- ========== TURBO C STDIO FAMILY ==========
-
- -----> printf
- 147
- 179
-
-
- ========== TURBO C STANDARD LIBRARY ==========
-
- -----> abort
- 149
- 181
-
-
- ========== TURBO C STRING FAMILY ==========
-
- -----> strcpy
- 409
- 422
-
-
- ========== TURBO C MISC ==========
-
- -----> main
- 428
-
-
- ========== ALL OTHER CROSS REFERENCE ==========
-
- -----> .file_info
- 173
- -----> .file_info.ff_name
- 208
- 422
- -----> .sx
- 171
- 209
- 316
- 326
- 387
- -----> .sy
- 172
- 210
- 317
- 327
- 388
- -----> anyint
- 430
- 483
- -----> black
- 66
- 112
- -----> blink
- 284
- -----> bright_white
- 111
- 203
- 204
- 211
- 282
- 283
- 284
- 291
- 425
- 443
- 455
- 466
- 467
- 477
- 482
- 487
- -----> currentsx
- 91
- 129
- 144
- 145
- 171
- -----> currentsy
- 93
- 130
- 140
- 141
- 143
- 172
- -----> dark_blue
- 114
- 202
- -----> dir.h
- 46
- -----> display_file_box
- 188
- 416
- -----> displaycounter
- 194
- 205
- 208
- 209
- 210
- -----> down_arrow_pressed
- 359
- -----> end_pressed
- 353
- -----> escape_pressed
- 331
- -----> f01pressed
- 336
- -----> ffr
- 87
- 171
- 172
- 173
- 208
- 209
- 210
- 316
- 317
- 326
- 327
- 387
- 388
- 422
- -----> file_att
- 56
- 169
- -----> file_back
- 66
- 227
- 242
- -----> file_fore
- 67
- 227
- 242
- -----> file_help_index
- 255
- 285
- 288
- 290
- 294
- -----> file_help_lr_x
- 253
- 272
- 278
- 298
- -----> file_help_lr_y
- 254
- 273
- 279
- 299
- -----> file_help_screen
- 250
- 274
- 300
- -----> file_help_text
- 256
- 288
- -----> file_help_ul_x
- 251
- 270
- 276
- 289
- 296
- -----> file_help_ul_y
- 252
- 271
- 277
- 290
- 297
- -----> file_info
- 80
- -----> file_that_was_selected
- 398
- 409
- 422
- -----> filedate
- 58
- -----> filefb
- 72
- 165
- 173
- 183
- -----> filefb.ff_attrib
- 56
- -----> filefb.ff_fdate
- 58
- -----> filefb.ff_fsize
- 57
- -----> filefb.ff_ftime
- 59
- -----> filefb.ff_name
- 55
- -----> filename
- 55
- 168
- -----> filerc
- 163
- 165
- 166
- 183
- -----> filesfound
- 89
- 164
- 171
- 172
- 173
- 175
- 177
- 185
- 205
- 334
- 356
- 363
- 373
- 375
- 411
- 413
- 420
- -----> filesize
- 57
- -----> filespecification
- 102
- 448
- 489
- -----> filespecification.value
- 453
- 456
- 488
- -----> filetime
- 59
- -----> full_file_record
- 82
- 85
- -----> get_files
- 154
- 411
- -----> give_file_help
- 245
- 339
- -----> highlight_area
- 230
- 315
- 386
- -----> home_pressed
- 342
- -----> initialize_coordinates
- 123
- 407
- 417
- -----> keypressed
- 311
- 312
- 319
- 322
- 323
- 329
- -----> left_arrow_pressed
- 379
- -----> length
- 219
- 225
- 234
- 240
- -----> maincounter
- 95
- 418
- 419
- 420
- 422
- -----> mainscreen
- 431
- 439
- 495
- -----> mainstring
- 101
- 456
- 459
- 467
- -----> mainx
- 432
- 437
- 496
- -----> mainy
- 433
- 438
- 496
- -----> max_files
- 60
- 87
- 177
- -----> menucounter
- 310
- 313
- 316
- 317
- 326
- 327
- 345
- 350
- 356
- 362
- 363
- 365
- 372
- 373
- 375
- 382
- 387
- 388
- 392
- -----> originalx
- 97
- -----> originaly
- 99
- -----> pick_file_menu
- 303
- 419
- -----> prompt_record
- 102
- -----> qcolors.c
- 52
- -----> qkeys.c
- 50
- -----> qtypes.c
- 48
- -----> return_pressed
- 319
- 323
- -----> right_arrow_pressed
- 369
- -----> search_specification
- 156
- 165
- 397
- 411
- -----> select_a_file
- 395
- 456
- -----> startx
- 217
- 223
- 225
- 232
- 238
- 240
- -----> starty
- 218
- 224
- 226
- 233
- 239
- 241
- -----> sx
- 76
- -----> sy
- 78
- -----> unhighlight_area
- 215
- 325
- -----> up_arrow_pressed
- 347
- -----> update_current_coordinates
- 133
- 174
- -----> white
- 67
- 113
- 202
- -----> window_depth
- 68
- 372
- 382
- -----> window_lr_x
- 63
- 145
- 198
- -----> window_lr_y
- 64
- 68
- 141
- 199
- -----> window_ul_x
- 61
- 129
- 196
- -----> window_ul_y
- 62
- 68
- 130
- 143
- 197
- -----> xincrement
- 65
- 144
- 145
- 318
- 328
- 389
-
-
- ========== PROGRAM CONSTANTS ==========
-
- -----> 0
- 61
- 62
- 89
- 91
- 93
- 95
- 97
- 99
- 106
- 115
- 119
- 163
- 164
- 168
- 205
- 285
- 312
- 313
- 314
- 345
- 350
- 365
- 382
- 413
- 418
- 439
- 453
- 458
- 459
- 488
- 495
- -----> 1
- 130
- 143
- 185
- 290
- 318
- 328
- 334
- 350
- 372
- 382
- 389
- 496
- -----> 2
- 129
- 289
- -----> 4
- 202
- 227
- 242
- -----> 5
- 252
- -----> 9
- 256
- 285
- -----> 12
- 107
- 109
- -----> 13
- 110
- -----> 15
- 65
- 254
- -----> 20
- 251
- -----> 22
- 64
- -----> 23
- 466
- 467
- 477
- -----> 24
- 439
- 482
- 495
- -----> 25
- 314
- 458
- -----> 29
- 466
- -----> 44
- 467
- -----> 46
- 168
- -----> 50
- 108
- -----> 60
- 253
- -----> 79
- 63
- 439
- 495
- -----> 100
- 60
- -----> 0x10
- 169
- -----> 0xff
- 165
-
-
- QXREF: Processing complete for pickfile.c
-