Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199611.adf » Features » WIMPC/!RAPS/c/!RunImage
WIMPC/!RAPS/c/!RunImage
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » Recent acquisitions » Acorn ADFS disks » adfs_AcornUser_199611.adf » Features |
Filename: | WIMPC/!RAPS/c/!RunImage |
Read OK: | ✔ |
File size: | 2999 bytes |
Load address: | 0000 |
Exec address: | 0000 |
File contents
/* RAPS - a parachute jump database program * To demonstrate the Acorn User Wimp C library * by Steve Mumford for Acorn User, November 1996 */ /* #includes */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "AULib.h" /* #defines */ #define POLL_MASK 1 #define MAX_WINDOWS 3 #define MAX_MENUS 1 #define MAX_JUMPS 15 #define VERSION_NUMBER 310 /* Risc OS version no. * 100 */ /* These #defines relate to the icon numbers in the template file */ #define CURRENT_RECORD_ICON 2 #define LAST_RECORD_ICON 4 #define PREV_RECORD_ICON 5 #define NEXT_RECORD_ICON 6 #define DATE_ICON 7 #define AIRCRAFT_ICON 9 #define DROPZONE_ICON 11 #define ALTITUDE_ICON 13 #define DELAY_ICON 15 #define AIRWORK_ICON 17 #define REMARKS1_ICON 19 #define REMARKS2_ICON 21 #define UPDATE_ICON 22 #define SAVE_ICON 0 /* These next #defines set up the menu selection choices */ /* iconbar menu */ #define INFO_OPTION 0 #define SAVE_OPTION 1 #define QUIT_OPTION 2 typedef struct jump_data { int jump_no; char date[11]; char aircraft[31]; char dropzone[51]; int altitude; int delay; char airwork[13]; char remarks1[51]; char remarks2[61]; struct jump_data *prev_record; struct jump_data *next_record; } jump_data; /* Global variables */ int QUIT_FLAG = 0; int CURRENT_MENU = 0; int CURRENT_RECORD_NUMBER = 1; int LAST_RECORD_NUMBER = 1; jump_data *CURRENT_RECORD_POINTER = NULL; window_data win_data[MAX_WINDOWS]; menu_data men_data[MAX_MENUS]; jump_data *jmp_data_root; char appname[] = "RAPS Jump Logger"; char sprname[] = "!raps"; long int msglist[] = {0}; /* Function prototyping */ int main(void); void openwindow(unsigned char[]); void closewindow(unsigned char[]); void loadtemplates(void); void mouse_click(unsigned char[]); void wimp_msg(int, unsigned char[]); void open_main_window(void); void prev_record(void); void next_record(void); void update_window_info(void); void menu_selection(unsigned char[]); void setup_database(void); void update_record(void); void add_record(void); /* Main program */ int main() { int task_handle, icon_handle; unsigned char poll_block[256]; int poll_result; int i = 0; setup_database(); task_handle = au_initialise(VERSION_NUMBER, appname, msglist); icon_handle = au_create_iconbar_icon(IBAR_PRIOR_APP, IBAR_ONRIGHT, ICON_ISSPRITE | ICON_HCENTRE | ICON_VCENTRE | ICON_CLICKNOTIFIESONCE, sprname); loadtemplates(); /*au_openwin_from_templatedata(&win_data[0], -1); */ while (QUIT_FLAG == 0) { /* do some polling */ poll_result = au_wimp_poll(POLL_MASK, poll_block); switch (poll_result) { case 2 : openwindow(poll_block); break; case 3 : closewindow(poll_block); break; case 6 : mouse_click(poll_block); break; case 9 : menu_selection(poll_block); break; case 17 : case 18 : case 19 : wimp_msg(poll_result, poll_block); break; } } au_closedown(task_handle); for(i = 0; i < MAX_WINDOWS; i++) { free(win_data[i].win_name); free(win_data[i].buffer); free(win_data[i].workspace); } /* #Remember to free menu space! (recursion?) */ } void mouse_click(unsigned char poll_block[]) { /* The dragging code also goes in here... */ int clk; long int icon_num; /* Determine which button was pressed */ clk = (int) au_bytetoword(poll_block, 8); if((au_bytetoword(poll_block, 12) == -2) && (clk == 4)) { open_main_window(); } if((au_bytetoword(poll_block, 12) == -2) && (clk == 2)) { /* Time to produce a menu */ au_buildmenu("RAPS", &men_data[0]); au_addtomenu("Info", 0, win_data[1].win_handle, 0, &men_data[0]); au_addtomenu("Save", 0, win_data[2].win_handle, 0, &men_data[0]); au_addtomenu("Quit", MENU_LASTITEM, -1, 0, &men_data[0]); au_createmenu(&men_data[0]); CURRENT_MENU = 1; /* keep track of the last menu we opened */ au_openmenu(&men_data[0], (int) au_bytetoword(poll_block, 0) - 64, (44*2)+96); return; } /* Check to see if it was in the main window */ if((au_bytetoword(poll_block, 12) == win_data[0].win_handle) && (clk == 4)) { icon_num = au_bytetoword(poll_block, 16); switch (icon_num) { case PREV_RECORD_ICON : prev_record(); break; case NEXT_RECORD_ICON : next_record(); break; case UPDATE_ICON : update_record(); break; } } /* Check to see whether we need to start a drag operation - drags are passed as * the mouse button number multiplied by 16 */ if((au_bytetoword(poll_block, 12) == win_data[2].win_handle) && (clk == 4*16)) { /* Start the drag operation */ icon_num = au_bytetoword(poll_block, 16); /* Are we over the actual file icon in the save window? */ if(icon_num == SAVE_ICON) { au_dragbox(au_bytetoword(poll_block, 12), icon_num); } } return; } void menu_selection(unsigned char poll_block[]) { long int first_hit; /* Which menu was hit? */ if (CURRENT_MENU == 1) { /* The icon bar menu got it - decipher first menu subselection */ first_hit = au_bytetoword(poll_block, 0); if (first_hit == QUIT_OPTION) { QUIT_FLAG = 1; } } return; } void prev_record(void) { if (CURRENT_RECORD_POINTER->prev_record != NULL) { /* Save window information? */ CURRENT_RECORD_POINTER = CURRENT_RECORD_POINTER->prev_record; CURRENT_RECORD_NUMBER = CURRENT_RECORD_POINTER->jump_no; /* would update window info here */ update_window_info(); } } void next_record(void) { if (CURRENT_RECORD_POINTER->next_record != NULL) { CURRENT_RECORD_POINTER = CURRENT_RECORD_POINTER->next_record; CURRENT_RECORD_NUMBER = CURRENT_RECORD_POINTER->jump_no; /* would update window info here */ update_window_info(); } } void update_record(void) { /* We need a temporary string buffer */ char temp_buf[255]; /* Save window information */ au_icon_get_text(CURRENT_RECORD_POINTER->date, win_data[0].win_handle, DATE_ICON); au_icon_get_text(CURRENT_RECORD_POINTER->aircraft, win_data[0].win_handle, AIRCRAFT_ICON); au_icon_get_text(CURRENT_RECORD_POINTER->dropzone, win_data[0].win_handle, DROPZONE_ICON); au_icon_get_text(CURRENT_RECORD_POINTER->airwork, win_data[0].win_handle, AIRWORK_ICON); au_icon_get_text(CURRENT_RECORD_POINTER->remarks1, win_data[0].win_handle, REMARKS1_ICON); au_icon_get_text(CURRENT_RECORD_POINTER->remarks2, win_data[0].win_handle, REMARKS2_ICON); /* We need to convert text to integer here */ au_icon_get_text(temp_buf, win_data[0].win_handle, ALTITUDE_ICON); CURRENT_RECORD_POINTER->altitude = atoi(temp_buf); /* And here */ au_icon_get_text(temp_buf, win_data[0].win_handle, DELAY_ICON); CURRENT_RECORD_POINTER->delay = atoi(temp_buf); /* Record is now saved in memory */ /* Are we on the last record? If so, we add a new one */ if (CURRENT_RECORD_POINTER->next_record == NULL) { add_record(); } } void add_record(void) { jump_data *new_record; /*Information from window already saved */ new_record = calloc(1, sizeof(jump_data)); /* Initialise pointers */ new_record->prev_record = CURRENT_RECORD_POINTER; new_record->next_record = NULL; LAST_RECORD_NUMBER = new_record->jump_no = CURRENT_RECORD_POINTER->jump_no + 1; CURRENT_RECORD_POINTER->next_record = new_record; /* Switch view to the new record */ CURRENT_RECORD_POINTER = new_record; CURRENT_RECORD_NUMBER = CURRENT_RECORD_POINTER->jump_no; /* Update the window to display the new information */ update_window_info(); } void update_window_info(void) { char temp_string[255]; au_losecaret(); if (CURRENT_RECORD_POINTER->next_record == NULL) { au_icon_text_change("Add", win_data[0].win_handle, UPDATE_ICON); } else { au_icon_text_change("Update", win_data[0].win_handle, UPDATE_ICON); } sprintf(temp_string, "%d", CURRENT_RECORD_POINTER->jump_no); au_icon_text_change(temp_string, win_data[0].win_handle, CURRENT_RECORD_ICON); sprintf(temp_string, "%d", LAST_RECORD_NUMBER); au_icon_text_change(temp_string, win_data[0].win_handle, LAST_RECORD_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->date , win_data[0].win_handle, DATE_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->aircraft , win_data[0].win_handle, AIRCRAFT_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->dropzone , win_data[0].win_handle, DROPZONE_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->airwork , win_data[0].win_handle, AIRWORK_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->remarks1 , win_data[0].win_handle, REMARKS1_ICON); au_icon_text_change(CURRENT_RECORD_POINTER->remarks2 , win_data[0].win_handle, REMARKS2_ICON); sprintf(temp_string, "%d", CURRENT_RECORD_POINTER->altitude); au_icon_text_change(temp_string, win_data[0].win_handle, ALTITUDE_ICON); sprintf(temp_string, "%d", CURRENT_RECORD_POINTER->delay); au_icon_text_change(temp_string, win_data[0].win_handle, DELAY_ICON); return; } void open_main_window(void) { _kernel_swi_regs in, out; unsigned char temp_buffer[1024]; /* We need to update the current and last record numbers in the window * before opening */ update_window_info(); /* Now open the window */ au_wordtobyte(win_data[0].win_handle, temp_buffer, 0); in.r[1] = (int) temp_buffer; _kernel_swi(Wimp_GetWindowInfo, &in, &out); _kernel_swi(Wimp_OpenWindow, &in, &out); return; } void wimp_msg(int result, unsigned char pollblock[]) { unsigned long int message_action; /* The next line takes bytes 16 to 19 of the polling block and forms them into a word holding the message action number */ message_action = au_bytetoword(pollblock, 16); switch (message_action) { case 0 : QUIT_FLAG = 1; /* Message_Quit - time to go */ break; } return; } void openwindow(unsigned char pollblock[]) { _kernel_swi_regs in, out; in.r[1] = (int) pollblock; _kernel_swi(Wimp_OpenWindow, &in, &out); return; } void closewindow(unsigned char pollblock[]) { _kernel_swi_regs in, out; in.r[1] = (int) pollblock; _kernel_swi(Wimp_CloseWindow, &in, &out); return; } void loadtemplates(void) { au_opentemplate("<RAPS$Dir>.Templates"); if(au_loadtemplate("MainWindow", &win_data[0], 0) == 0) { au_report_error(1, "Template not found!", 1, appname); QUIT_FLAG = 1; } if(au_loadtemplate("ProgInfo", &win_data[1], 0) == 0) { au_report_error(1, "Template not found!", 1, appname); QUIT_FLAG = 1; } if(au_loadtemplate("xfer_send", &win_data[2], 0) == 0) { au_report_error(1, "Template not found!", 1, appname); QUIT_FLAG = 1; } au_closetemplate(); } void setup_database(void) { /* Initially, we need to set aside memory for the 'root' structure */ jmp_data_root = calloc(1, sizeof(jump_data)); /* Initialise pointers */ jmp_data_root->prev_record = jmp_data_root->next_record = NULL; jmp_data_root->jump_no = 1; CURRENT_RECORD_POINTER = jmp_data_root; }
00000000 2f 2a 20 52 41 50 53 20 2d 20 61 20 70 61 72 61 |/* RAPS - a para| 00000010 63 68 75 74 65 20 6a 75 6d 70 20 64 61 74 61 62 |chute jump datab| 00000020 61 73 65 20 70 72 6f 67 72 61 6d 0a 20 2a 20 54 |ase program. * T| 00000030 6f 20 64 65 6d 6f 6e 73 74 72 61 74 65 20 74 68 |o demonstrate th| 00000040 65 20 41 63 6f 72 6e 20 55 73 65 72 20 57 69 6d |e Acorn User Wim| 00000050 70 20 43 20 6c 69 62 72 61 72 79 0a 20 2a 20 62 |p C library. * b| 00000060 79 20 53 74 65 76 65 20 4d 75 6d 66 6f 72 64 20 |y Steve Mumford | 00000070 66 6f 72 20 41 63 6f 72 6e 20 55 73 65 72 2c 20 |for Acorn User, | 00000080 4e 6f 76 65 6d 62 65 72 20 31 39 39 36 20 2a 2f |November 1996 */| 00000090 0a 0a 2f 2a 20 23 69 6e 63 6c 75 64 65 73 20 2a |../* #includes *| 000000a0 2f 0a 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 |/..#include <std| 000000b0 69 6f 2e 68 3e 0a 23 69 6e 63 6c 75 64 65 20 3c |io.h>.#include <| 000000c0 73 74 64 6c 69 62 2e 68 3e 0a 23 69 6e 63 6c 75 |stdlib.h>.#inclu| 000000d0 64 65 20 3c 73 74 72 69 6e 67 2e 68 3e 0a 23 69 |de <string.h>.#i| 000000e0 6e 63 6c 75 64 65 20 22 41 55 4c 69 62 2e 68 22 |nclude "AULib.h"| 000000f0 0a 0a 2f 2a 20 23 64 65 66 69 6e 65 73 20 2a 2f |../* #defines */| 00000100 0a 0a 23 64 65 66 69 6e 65 20 50 4f 4c 4c 5f 4d |..#define POLL_M| 00000110 41 53 4b 20 31 0a 23 64 65 66 69 6e 65 20 4d 41 |ASK 1.#define MA| 00000120 58 5f 57 49 4e 44 4f 57 53 20 33 0a 23 64 65 66 |X_WINDOWS 3.#def| 00000130 69 6e 65 20 4d 41 58 5f 4d 45 4e 55 53 20 31 0a |ine MAX_MENUS 1.| 00000140 23 64 65 66 69 6e 65 20 4d 41 58 5f 4a 55 4d 50 |#define MAX_JUMP| 00000150 53 20 31 35 0a 23 64 65 66 69 6e 65 20 56 45 52 |S 15.#define VER| 00000160 53 49 4f 4e 5f 4e 55 4d 42 45 52 20 33 31 30 20 |SION_NUMBER 310 | 00000170 2f 2a 20 52 69 73 63 20 4f 53 20 76 65 72 73 69 |/* Risc OS versi| 00000180 6f 6e 20 6e 6f 2e 20 2a 20 31 30 30 20 2a 2f 0a |on no. * 100 */.| 00000190 0a 2f 2a 20 54 68 65 73 65 20 23 64 65 66 69 6e |./* These #defin| 000001a0 65 73 20 72 65 6c 61 74 65 20 74 6f 20 74 68 65 |es relate to the| 000001b0 20 69 63 6f 6e 20 6e 75 6d 62 65 72 73 20 69 6e | icon numbers in| 000001c0 20 74 68 65 20 74 65 6d 70 6c 61 74 65 20 66 69 | the template fi| 000001d0 6c 65 20 2a 2f 0a 0a 23 64 65 66 69 6e 65 20 43 |le */..#define C| 000001e0 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 49 43 |URRENT_RECORD_IC| 000001f0 4f 4e 20 32 0a 23 64 65 66 69 6e 65 20 4c 41 53 |ON 2.#define LAS| 00000200 54 5f 52 45 43 4f 52 44 5f 49 43 4f 4e 20 34 0a |T_RECORD_ICON 4.| 00000210 23 64 65 66 69 6e 65 20 50 52 45 56 5f 52 45 43 |#define PREV_REC| 00000220 4f 52 44 5f 49 43 4f 4e 20 35 0a 23 64 65 66 69 |ORD_ICON 5.#defi| 00000230 6e 65 20 4e 45 58 54 5f 52 45 43 4f 52 44 5f 49 |ne NEXT_RECORD_I| 00000240 43 4f 4e 20 36 0a 23 64 65 66 69 6e 65 20 44 41 |CON 6.#define DA| 00000250 54 45 5f 49 43 4f 4e 20 37 0a 23 64 65 66 69 6e |TE_ICON 7.#defin| 00000260 65 20 41 49 52 43 52 41 46 54 5f 49 43 4f 4e 20 |e AIRCRAFT_ICON | 00000270 39 0a 23 64 65 66 69 6e 65 20 44 52 4f 50 5a 4f |9.#define DROPZO| 00000280 4e 45 5f 49 43 4f 4e 20 31 31 0a 23 64 65 66 69 |NE_ICON 11.#defi| 00000290 6e 65 20 41 4c 54 49 54 55 44 45 5f 49 43 4f 4e |ne ALTITUDE_ICON| 000002a0 20 31 33 0a 23 64 65 66 69 6e 65 20 44 45 4c 41 | 13.#define DELA| 000002b0 59 5f 49 43 4f 4e 20 31 35 0a 23 64 65 66 69 6e |Y_ICON 15.#defin| 000002c0 65 20 41 49 52 57 4f 52 4b 5f 49 43 4f 4e 20 31 |e AIRWORK_ICON 1| 000002d0 37 0a 23 64 65 66 69 6e 65 20 52 45 4d 41 52 4b |7.#define REMARK| 000002e0 53 31 5f 49 43 4f 4e 20 31 39 0a 23 64 65 66 69 |S1_ICON 19.#defi| 000002f0 6e 65 20 52 45 4d 41 52 4b 53 32 5f 49 43 4f 4e |ne REMARKS2_ICON| 00000300 20 32 31 0a 23 64 65 66 69 6e 65 20 55 50 44 41 | 21.#define UPDA| 00000310 54 45 5f 49 43 4f 4e 20 32 32 0a 23 64 65 66 69 |TE_ICON 22.#defi| 00000320 6e 65 20 53 41 56 45 5f 49 43 4f 4e 20 30 0a 0a |ne SAVE_ICON 0..| 00000330 2f 2a 20 54 68 65 73 65 20 6e 65 78 74 20 23 64 |/* These next #d| 00000340 65 66 69 6e 65 73 20 73 65 74 20 75 70 20 74 68 |efines set up th| 00000350 65 20 6d 65 6e 75 20 73 65 6c 65 63 74 69 6f 6e |e menu selection| 00000360 20 63 68 6f 69 63 65 73 20 2a 2f 0a 0a 2f 2a 20 | choices */../* | 00000370 69 63 6f 6e 62 61 72 20 6d 65 6e 75 20 2a 2f 0a |iconbar menu */.| 00000380 23 64 65 66 69 6e 65 20 49 4e 46 4f 5f 4f 50 54 |#define INFO_OPT| 00000390 49 4f 4e 20 30 0a 23 64 65 66 69 6e 65 20 53 41 |ION 0.#define SA| 000003a0 56 45 5f 4f 50 54 49 4f 4e 20 31 0a 23 64 65 66 |VE_OPTION 1.#def| 000003b0 69 6e 65 20 51 55 49 54 5f 4f 50 54 49 4f 4e 20 |ine QUIT_OPTION | 000003c0 32 0a 0a 74 79 70 65 64 65 66 20 73 74 72 75 63 |2..typedef struc| 000003d0 74 20 6a 75 6d 70 5f 64 61 74 61 20 7b 0a 09 69 |t jump_data {..i| 000003e0 6e 74 20 6a 75 6d 70 5f 6e 6f 3b 0a 09 63 68 61 |nt jump_no;..cha| 000003f0 72 20 64 61 74 65 5b 31 31 5d 3b 0a 09 63 68 61 |r date[11];..cha| 00000400 72 20 61 69 72 63 72 61 66 74 5b 33 31 5d 3b 0a |r aircraft[31];.| 00000410 09 63 68 61 72 20 64 72 6f 70 7a 6f 6e 65 5b 35 |.char dropzone[5| 00000420 31 5d 3b 0a 09 69 6e 74 20 61 6c 74 69 74 75 64 |1];..int altitud| 00000430 65 3b 0a 09 69 6e 74 20 64 65 6c 61 79 3b 0a 09 |e;..int delay;..| 00000440 63 68 61 72 20 61 69 72 77 6f 72 6b 5b 31 33 5d |char airwork[13]| 00000450 3b 0a 09 63 68 61 72 20 72 65 6d 61 72 6b 73 31 |;..char remarks1| 00000460 5b 35 31 5d 3b 0a 09 63 68 61 72 20 72 65 6d 61 |[51];..char rema| 00000470 72 6b 73 32 5b 36 31 5d 3b 0a 09 73 74 72 75 63 |rks2[61];..struc| 00000480 74 20 6a 75 6d 70 5f 64 61 74 61 20 2a 70 72 65 |t jump_data *pre| 00000490 76 5f 72 65 63 6f 72 64 3b 0a 09 73 74 72 75 63 |v_record;..struc| 000004a0 74 20 6a 75 6d 70 5f 64 61 74 61 20 2a 6e 65 78 |t jump_data *nex| 000004b0 74 5f 72 65 63 6f 72 64 3b 0a 7d 20 6a 75 6d 70 |t_record;.} jump| 000004c0 5f 64 61 74 61 3b 0a 0a 2f 2a 20 47 6c 6f 62 61 |_data;../* Globa| 000004d0 6c 20 76 61 72 69 61 62 6c 65 73 20 2a 2f 0a 0a |l variables */..| 000004e0 69 6e 74 09 51 55 49 54 5f 46 4c 41 47 20 3d 20 |int.QUIT_FLAG = | 000004f0 30 3b 0a 69 6e 74 09 43 55 52 52 45 4e 54 5f 4d |0;.int.CURRENT_M| 00000500 45 4e 55 20 3d 20 30 3b 0a 69 6e 74 09 43 55 52 |ENU = 0;.int.CUR| 00000510 52 45 4e 54 5f 52 45 43 4f 52 44 5f 4e 55 4d 42 |RENT_RECORD_NUMB| 00000520 45 52 20 3d 20 31 3b 0a 69 6e 74 09 4c 41 53 54 |ER = 1;.int.LAST| 00000530 5f 52 45 43 4f 52 44 5f 4e 55 4d 42 45 52 20 3d |_RECORD_NUMBER =| 00000540 20 31 3b 0a 6a 75 6d 70 5f 64 61 74 61 09 2a 43 | 1;.jump_data.*C| 00000550 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f |URRENT_RECORD_PO| 00000560 49 4e 54 45 52 20 3d 20 4e 55 4c 4c 3b 0a 0a 77 |INTER = NULL;..w| 00000570 69 6e 64 6f 77 5f 64 61 74 61 09 77 69 6e 5f 64 |indow_data.win_d| 00000580 61 74 61 5b 4d 41 58 5f 57 49 4e 44 4f 57 53 5d |ata[MAX_WINDOWS]| 00000590 3b 0a 6d 65 6e 75 5f 64 61 74 61 09 6d 65 6e 5f |;.menu_data.men_| 000005a0 64 61 74 61 5b 4d 41 58 5f 4d 45 4e 55 53 5d 3b |data[MAX_MENUS];| 000005b0 0a 6a 75 6d 70 5f 64 61 74 61 09 2a 6a 6d 70 5f |.jump_data.*jmp_| 000005c0 64 61 74 61 5f 72 6f 6f 74 3b 0a 63 68 61 72 20 |data_root;.char | 000005d0 61 70 70 6e 61 6d 65 5b 5d 20 3d 20 22 52 41 50 |appname[] = "RAP| 000005e0 53 20 4a 75 6d 70 20 4c 6f 67 67 65 72 22 3b 0a |S Jump Logger";.| 000005f0 63 68 61 72 20 73 70 72 6e 61 6d 65 5b 5d 20 3d |char sprname[] =| 00000600 20 22 21 72 61 70 73 22 3b 0a 6c 6f 6e 67 20 69 | "!raps";.long i| 00000610 6e 74 20 6d 73 67 6c 69 73 74 5b 5d 20 3d 20 7b |nt msglist[] = {| 00000620 30 7d 3b 0a 0a 2f 2a 20 46 75 6e 63 74 69 6f 6e |0};../* Function| 00000630 20 70 72 6f 74 6f 74 79 70 69 6e 67 20 2a 2f 0a | prototyping */.| 00000640 0a 69 6e 74 09 6d 61 69 6e 28 76 6f 69 64 29 3b |.int.main(void);| 00000650 0a 76 6f 69 64 09 6f 70 65 6e 77 69 6e 64 6f 77 |.void.openwindow| 00000660 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 5b 5d |(unsigned char[]| 00000670 29 3b 0a 76 6f 69 64 09 63 6c 6f 73 65 77 69 6e |);.void.closewin| 00000680 64 6f 77 28 75 6e 73 69 67 6e 65 64 20 63 68 61 |dow(unsigned cha| 00000690 72 5b 5d 29 3b 0a 76 6f 69 64 09 6c 6f 61 64 74 |r[]);.void.loadt| 000006a0 65 6d 70 6c 61 74 65 73 28 76 6f 69 64 29 3b 0a |emplates(void);.| 000006b0 76 6f 69 64 09 6d 6f 75 73 65 5f 63 6c 69 63 6b |void.mouse_click| 000006c0 28 75 6e 73 69 67 6e 65 64 20 63 68 61 72 5b 5d |(unsigned char[]| 000006d0 29 3b 0a 76 6f 69 64 09 77 69 6d 70 5f 6d 73 67 |);.void.wimp_msg| 000006e0 28 69 6e 74 2c 20 75 6e 73 69 67 6e 65 64 20 63 |(int, unsigned c| 000006f0 68 61 72 5b 5d 29 3b 0a 76 6f 69 64 09 6f 70 65 |har[]);.void.ope| 00000700 6e 5f 6d 61 69 6e 5f 77 69 6e 64 6f 77 28 76 6f |n_main_window(vo| 00000710 69 64 29 3b 0a 76 6f 69 64 09 70 72 65 76 5f 72 |id);.void.prev_r| 00000720 65 63 6f 72 64 28 76 6f 69 64 29 3b 0a 76 6f 69 |ecord(void);.voi| 00000730 64 09 6e 65 78 74 5f 72 65 63 6f 72 64 28 76 6f |d.next_record(vo| 00000740 69 64 29 3b 0a 76 6f 69 64 09 75 70 64 61 74 65 |id);.void.update| 00000750 5f 77 69 6e 64 6f 77 5f 69 6e 66 6f 28 76 6f 69 |_window_info(voi| 00000760 64 29 3b 0a 76 6f 69 64 09 6d 65 6e 75 5f 73 65 |d);.void.menu_se| 00000770 6c 65 63 74 69 6f 6e 28 75 6e 73 69 67 6e 65 64 |lection(unsigned| 00000780 20 63 68 61 72 5b 5d 29 3b 0a 76 6f 69 64 09 73 | char[]);.void.s| 00000790 65 74 75 70 5f 64 61 74 61 62 61 73 65 28 76 6f |etup_database(vo| 000007a0 69 64 29 3b 0a 76 6f 69 64 09 75 70 64 61 74 65 |id);.void.update| 000007b0 5f 72 65 63 6f 72 64 28 76 6f 69 64 29 3b 0a 76 |_record(void);.v| 000007c0 6f 69 64 09 61 64 64 5f 72 65 63 6f 72 64 28 76 |oid.add_record(v| 000007d0 6f 69 64 29 3b 0a 0a 2f 2a 20 4d 61 69 6e 20 70 |oid);../* Main p| 000007e0 72 6f 67 72 61 6d 20 2a 2f 0a 0a 69 6e 74 0a 6d |rogram */..int.m| 000007f0 61 69 6e 28 29 0a 7b 0a 09 69 6e 74 09 74 61 73 |ain().{..int.tas| 00000800 6b 5f 68 61 6e 64 6c 65 2c 20 69 63 6f 6e 5f 68 |k_handle, icon_h| 00000810 61 6e 64 6c 65 3b 0a 0a 09 75 6e 73 69 67 6e 65 |andle;...unsigne| 00000820 64 20 63 68 61 72 09 70 6f 6c 6c 5f 62 6c 6f 63 |d char.poll_bloc| 00000830 6b 5b 32 35 36 5d 3b 0a 09 69 6e 74 09 70 6f 6c |k[256];..int.pol| 00000840 6c 5f 72 65 73 75 6c 74 3b 0a 09 69 6e 74 09 69 |l_result;..int.i| 00000850 20 3d 20 30 3b 0a 0a 09 73 65 74 75 70 5f 64 61 | = 0;...setup_da| 00000860 74 61 62 61 73 65 28 29 3b 0a 09 74 61 73 6b 5f |tabase();..task_| 00000870 68 61 6e 64 6c 65 20 3d 20 61 75 5f 69 6e 69 74 |handle = au_init| 00000880 69 61 6c 69 73 65 28 56 45 52 53 49 4f 4e 5f 4e |ialise(VERSION_N| 00000890 55 4d 42 45 52 2c 20 61 70 70 6e 61 6d 65 2c 20 |UMBER, appname, | 000008a0 6d 73 67 6c 69 73 74 29 3b 0a 09 69 63 6f 6e 5f |msglist);..icon_| 000008b0 68 61 6e 64 6c 65 20 3d 20 61 75 5f 63 72 65 61 |handle = au_crea| 000008c0 74 65 5f 69 63 6f 6e 62 61 72 5f 69 63 6f 6e 28 |te_iconbar_icon(| 000008d0 49 42 41 52 5f 50 52 49 4f 52 5f 41 50 50 2c 0a |IBAR_PRIOR_APP,.| 000008e0 09 09 09 49 42 41 52 5f 4f 4e 52 49 47 48 54 2c |...IBAR_ONRIGHT,| 000008f0 0a 09 09 09 49 43 4f 4e 5f 49 53 53 50 52 49 54 |....ICON_ISSPRIT| 00000900 45 20 7c 20 49 43 4f 4e 5f 48 43 45 4e 54 52 45 |E | ICON_HCENTRE| 00000910 20 7c 20 49 43 4f 4e 5f 56 43 45 4e 54 52 45 20 | | ICON_VCENTRE | 00000920 7c 20 49 43 4f 4e 5f 43 4c 49 43 4b 4e 4f 54 49 || ICON_CLICKNOTI| 00000930 46 49 45 53 4f 4e 43 45 2c 0a 09 09 09 73 70 72 |FIESONCE,....spr| 00000940 6e 61 6d 65 29 3b 0a 09 6c 6f 61 64 74 65 6d 70 |name);..loadtemp| 00000950 6c 61 74 65 73 28 29 3b 0a 09 2f 2a 61 75 5f 6f |lates();../*au_o| 00000960 70 65 6e 77 69 6e 5f 66 72 6f 6d 5f 74 65 6d 70 |penwin_from_temp| 00000970 6c 61 74 65 64 61 74 61 28 26 77 69 6e 5f 64 61 |latedata(&win_da| 00000980 74 61 5b 30 5d 2c 20 2d 31 29 3b 20 2a 2f 0a 09 |ta[0], -1); */..| 00000990 77 68 69 6c 65 20 28 51 55 49 54 5f 46 4c 41 47 |while (QUIT_FLAG| 000009a0 20 3d 3d 20 30 29 20 7b 0a 09 2f 2a 20 64 6f 20 | == 0) {../* do | 000009b0 73 6f 6d 65 20 70 6f 6c 6c 69 6e 67 20 2a 2f 0a |some polling */.| 000009c0 09 09 70 6f 6c 6c 5f 72 65 73 75 6c 74 20 3d 20 |..poll_result = | 000009d0 61 75 5f 77 69 6d 70 5f 70 6f 6c 6c 28 50 4f 4c |au_wimp_poll(POL| 000009e0 4c 5f 4d 41 53 4b 2c 20 70 6f 6c 6c 5f 62 6c 6f |L_MASK, poll_blo| 000009f0 63 6b 29 3b 0a 09 09 73 77 69 74 63 68 20 28 70 |ck);...switch (p| 00000a00 6f 6c 6c 5f 72 65 73 75 6c 74 29 20 7b 0a 09 09 |oll_result) {...| 00000a10 09 63 61 73 65 20 20 32 20 3a 20 6f 70 65 6e 77 |.case 2 : openw| 00000a20 69 6e 64 6f 77 28 70 6f 6c 6c 5f 62 6c 6f 63 6b |indow(poll_block| 00000a30 29 3b 0a 09 09 09 09 09 09 62 72 65 61 6b 3b 0a |);.......break;.| 00000a40 09 09 09 63 61 73 65 20 20 33 20 3a 20 63 6c 6f |...case 3 : clo| 00000a50 73 65 77 69 6e 64 6f 77 28 70 6f 6c 6c 5f 62 6c |sewindow(poll_bl| 00000a60 6f 63 6b 29 3b 0a 09 09 09 09 09 09 62 72 65 61 |ock);.......brea| 00000a70 6b 3b 0a 09 09 09 63 61 73 65 20 20 36 20 3a 20 |k;....case 6 : | 00000a80 6d 6f 75 73 65 5f 63 6c 69 63 6b 28 70 6f 6c 6c |mouse_click(poll| 00000a90 5f 62 6c 6f 63 6b 29 3b 0a 09 09 09 09 09 09 62 |_block);.......b| 00000aa0 72 65 61 6b 3b 0a 09 09 09 63 61 73 65 20 20 39 |reak;....case 9| 00000ab0 20 3a 20 6d 65 6e 75 5f 73 65 6c 65 63 74 69 6f | : menu_selectio| 00000ac0 6e 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 29 3b 0a 09 |n(poll_block);..| 00000ad0 09 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 63 |.....break;....c| 00000ae0 61 73 65 20 31 37 20 3a 0a 09 09 09 63 61 73 65 |ase 17 :....case| 00000af0 20 31 38 20 3a 0a 09 09 09 63 61 73 65 20 31 39 | 18 :....case 19| 00000b00 20 3a 20 77 69 6d 70 5f 6d 73 67 28 70 6f 6c 6c | : wimp_msg(poll| 00000b10 5f 72 65 73 75 6c 74 2c 20 70 6f 6c 6c 5f 62 6c |_result, poll_bl| 00000b20 6f 63 6b 29 3b 0a 09 09 09 09 09 09 62 72 65 61 |ock);.......brea| 00000b30 6b 3b 0a 09 09 7d 0a 09 7d 0a 09 61 75 5f 63 6c |k;...}..}..au_cl| 00000b40 6f 73 65 64 6f 77 6e 28 74 61 73 6b 5f 68 61 6e |osedown(task_han| 00000b50 64 6c 65 29 3b 0a 0a 09 66 6f 72 28 69 20 3d 20 |dle);...for(i = | 00000b60 30 3b 20 69 20 3c 20 4d 41 58 5f 57 49 4e 44 4f |0; i < MAX_WINDO| 00000b70 57 53 3b 20 69 2b 2b 29 20 7b 0a 09 09 66 72 65 |WS; i++) {...fre| 00000b80 65 28 77 69 6e 5f 64 61 74 61 5b 69 5d 2e 77 69 |e(win_data[i].wi| 00000b90 6e 5f 6e 61 6d 65 29 3b 0a 09 09 66 72 65 65 28 |n_name);...free(| 00000ba0 77 69 6e 5f 64 61 74 61 5b 69 5d 2e 62 75 66 66 |win_data[i].buff| 00000bb0 65 72 29 3b 0a 09 09 66 72 65 65 28 77 69 6e 5f |er);...free(win_| 00000bc0 64 61 74 61 5b 69 5d 2e 77 6f 72 6b 73 70 61 63 |data[i].workspac| 00000bd0 65 29 3b 0a 09 7d 0a 0a 09 2f 2a 20 23 52 65 6d |e);..}.../* #Rem| 00000be0 65 6d 62 65 72 20 74 6f 20 66 72 65 65 20 6d 65 |ember to free me| 00000bf0 6e 75 20 73 70 61 63 65 21 20 28 72 65 63 75 72 |nu space! (recur| 00000c00 73 69 6f 6e 3f 29 20 2a 2f 0a 7d 0a 0a 76 6f 69 |sion?) */.}..voi| 00000c10 64 20 6d 6f 75 73 65 5f 63 6c 69 63 6b 28 75 6e |d mouse_click(un| 00000c20 73 69 67 6e 65 64 20 63 68 61 72 20 70 6f 6c 6c |signed char poll| 00000c30 5f 62 6c 6f 63 6b 5b 5d 29 0a 7b 0a 09 2f 2a 20 |_block[]).{../* | 00000c40 54 68 65 20 64 72 61 67 67 69 6e 67 20 63 6f 64 |The dragging cod| 00000c50 65 20 61 6c 73 6f 20 67 6f 65 73 20 69 6e 20 68 |e also goes in h| 00000c60 65 72 65 2e 2e 2e 20 2a 2f 20 0a 09 69 6e 74 09 |ere... */ ..int.| 00000c70 63 6c 6b 3b 0a 09 6c 6f 6e 67 20 69 6e 74 09 69 |clk;..long int.i| 00000c80 63 6f 6e 5f 6e 75 6d 3b 0a 0a 09 2f 2a 20 44 65 |con_num;.../* De| 00000c90 74 65 72 6d 69 6e 65 20 77 68 69 63 68 20 62 75 |termine which bu| 00000ca0 74 74 6f 6e 20 77 61 73 20 70 72 65 73 73 65 64 |tton was pressed| 00000cb0 20 2a 2f 0a 09 63 6c 6b 20 3d 20 28 69 6e 74 29 | */..clk = (int)| 00000cc0 20 61 75 5f 62 79 74 65 74 6f 77 6f 72 64 28 70 | au_bytetoword(p| 00000cd0 6f 6c 6c 5f 62 6c 6f 63 6b 2c 20 38 29 3b 20 0a |oll_block, 8); .| 00000ce0 0a 09 69 66 28 28 61 75 5f 62 79 74 65 74 6f 77 |..if((au_bytetow| 00000cf0 6f 72 64 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 2c 20 |ord(poll_block, | 00000d00 31 32 29 20 3d 3d 20 2d 32 29 20 26 26 20 28 63 |12) == -2) && (c| 00000d10 6c 6b 20 3d 3d 20 34 29 29 20 7b 0a 09 6f 70 65 |lk == 4)) {..ope| 00000d20 6e 5f 6d 61 69 6e 5f 77 69 6e 64 6f 77 28 29 3b |n_main_window();| 00000d30 0a 09 7d 0a 0a 09 69 66 28 28 61 75 5f 62 79 74 |..}...if((au_byt| 00000d40 65 74 6f 77 6f 72 64 28 70 6f 6c 6c 5f 62 6c 6f |etoword(poll_blo| 00000d50 63 6b 2c 20 31 32 29 20 3d 3d 20 2d 32 29 20 26 |ck, 12) == -2) &| 00000d60 26 20 28 63 6c 6b 20 3d 3d 20 32 29 29 20 7b 0a |& (clk == 2)) {.| 00000d70 09 09 2f 2a 20 54 69 6d 65 20 74 6f 20 70 72 6f |../* Time to pro| 00000d80 64 75 63 65 20 61 20 6d 65 6e 75 20 2a 2f 0a 09 |duce a menu */..| 00000d90 09 61 75 5f 62 75 69 6c 64 6d 65 6e 75 28 22 52 |.au_buildmenu("R| 00000da0 41 50 53 22 2c 20 26 6d 65 6e 5f 64 61 74 61 5b |APS", &men_data[| 00000db0 30 5d 29 3b 0a 09 09 61 75 5f 61 64 64 74 6f 6d |0]);...au_addtom| 00000dc0 65 6e 75 28 22 49 6e 66 6f 22 2c 20 30 2c 20 77 |enu("Info", 0, w| 00000dd0 69 6e 5f 64 61 74 61 5b 31 5d 2e 77 69 6e 5f 68 |in_data[1].win_h| 00000de0 61 6e 64 6c 65 2c 20 30 2c 20 26 6d 65 6e 5f 64 |andle, 0, &men_d| 00000df0 61 74 61 5b 30 5d 29 3b 0a 09 09 61 75 5f 61 64 |ata[0]);...au_ad| 00000e00 64 74 6f 6d 65 6e 75 28 22 53 61 76 65 22 2c 20 |dtomenu("Save", | 00000e10 30 2c 20 77 69 6e 5f 64 61 74 61 5b 32 5d 2e 77 |0, win_data[2].w| 00000e20 69 6e 5f 68 61 6e 64 6c 65 2c 20 30 2c 20 26 6d |in_handle, 0, &m| 00000e30 65 6e 5f 64 61 74 61 5b 30 5d 29 3b 0a 09 09 61 |en_data[0]);...a| 00000e40 75 5f 61 64 64 74 6f 6d 65 6e 75 28 22 51 75 69 |u_addtomenu("Qui| 00000e50 74 22 2c 20 4d 45 4e 55 5f 4c 41 53 54 49 54 45 |t", MENU_LASTITE| 00000e60 4d 2c 20 2d 31 2c 20 30 2c 20 26 6d 65 6e 5f 64 |M, -1, 0, &men_d| 00000e70 61 74 61 5b 30 5d 29 3b 0a 09 09 61 75 5f 63 72 |ata[0]);...au_cr| 00000e80 65 61 74 65 6d 65 6e 75 28 26 6d 65 6e 5f 64 61 |eatemenu(&men_da| 00000e90 74 61 5b 30 5d 29 3b 0a 09 09 43 55 52 52 45 4e |ta[0]);...CURREN| 00000ea0 54 5f 4d 45 4e 55 20 3d 20 31 3b 20 2f 2a 20 6b |T_MENU = 1; /* k| 00000eb0 65 65 70 20 74 72 61 63 6b 20 6f 66 20 74 68 65 |eep track of the| 00000ec0 20 6c 61 73 74 20 6d 65 6e 75 20 77 65 20 6f 70 | last menu we op| 00000ed0 65 6e 65 64 20 2a 2f 0a 09 09 61 75 5f 6f 70 65 |ened */...au_ope| 00000ee0 6e 6d 65 6e 75 28 26 6d 65 6e 5f 64 61 74 61 5b |nmenu(&men_data[| 00000ef0 30 5d 2c 20 28 69 6e 74 29 20 61 75 5f 62 79 74 |0], (int) au_byt| 00000f00 65 74 6f 77 6f 72 64 28 70 6f 6c 6c 5f 62 6c 6f |etoword(poll_blo| 00000f10 63 6b 2c 20 30 29 20 2d 20 36 34 2c 20 28 34 34 |ck, 0) - 64, (44| 00000f20 2a 32 29 2b 39 36 29 3b 0a 09 09 72 65 74 75 72 |*2)+96);...retur| 00000f30 6e 3b 0a 09 7d 0a 0a 09 2f 2a 20 43 68 65 63 6b |n;..}.../* Check| 00000f40 20 74 6f 20 73 65 65 20 69 66 20 69 74 20 77 61 | to see if it wa| 00000f50 73 20 69 6e 20 74 68 65 20 6d 61 69 6e 20 77 69 |s in the main wi| 00000f60 6e 64 6f 77 20 2a 2f 0a 09 69 66 28 28 61 75 5f |ndow */..if((au_| 00000f70 62 79 74 65 74 6f 77 6f 72 64 28 70 6f 6c 6c 5f |bytetoword(poll_| 00000f80 62 6c 6f 63 6b 2c 20 31 32 29 20 3d 3d 20 77 69 |block, 12) == wi| 00000f90 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 |n_data[0].win_ha| 00000fa0 6e 64 6c 65 29 20 26 26 20 28 63 6c 6b 20 3d 3d |ndle) && (clk ==| 00000fb0 20 34 29 29 20 7b 0a 09 09 69 63 6f 6e 5f 6e 75 | 4)) {...icon_nu| 00000fc0 6d 20 3d 20 61 75 5f 62 79 74 65 74 6f 77 6f 72 |m = au_bytetowor| 00000fd0 64 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 2c 20 31 36 |d(poll_block, 16| 00000fe0 29 3b 0a 09 09 73 77 69 74 63 68 20 28 69 63 6f |);...switch (ico| 00000ff0 6e 5f 6e 75 6d 29 20 7b 0a 09 09 09 63 61 73 65 |n_num) {....case| 00001000 20 50 52 45 56 5f 52 45 43 4f 52 44 5f 49 43 4f | PREV_RECORD_ICO| 00001010 4e 20 3a 20 70 72 65 76 5f 72 65 63 6f 72 64 28 |N : prev_record(| 00001020 29 3b 0a 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 |);.....break;...| 00001030 09 63 61 73 65 20 4e 45 58 54 5f 52 45 43 4f 52 |.case NEXT_RECOR| 00001040 44 5f 49 43 4f 4e 20 3a 20 6e 65 78 74 5f 72 65 |D_ICON : next_re| 00001050 63 6f 72 64 28 29 3b 0a 09 09 09 09 62 72 65 61 |cord();.....brea| 00001060 6b 3b 0a 09 09 09 63 61 73 65 20 55 50 44 41 54 |k;....case UPDAT| 00001070 45 5f 49 43 4f 4e 20 3a 20 75 70 64 61 74 65 5f |E_ICON : update_| 00001080 72 65 63 6f 72 64 28 29 3b 0a 09 09 09 09 62 72 |record();.....br| 00001090 65 61 6b 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2a |eak;...}..}.../*| 000010a0 20 43 68 65 63 6b 20 74 6f 20 73 65 65 20 77 68 | Check to see wh| 000010b0 65 74 68 65 72 20 77 65 20 6e 65 65 64 20 74 6f |ether we need to| 000010c0 20 73 74 61 72 74 20 61 20 64 72 61 67 20 6f 70 | start a drag op| 000010d0 65 72 61 74 69 6f 6e 20 2d 20 64 72 61 67 73 20 |eration - drags | 000010e0 61 72 65 20 70 61 73 73 65 64 20 61 73 0a 09 20 |are passed as.. | 000010f0 2a 20 74 68 65 20 6d 6f 75 73 65 20 62 75 74 74 |* the mouse butt| 00001100 6f 6e 20 6e 75 6d 62 65 72 20 6d 75 6c 74 69 70 |on number multip| 00001110 6c 69 65 64 20 62 79 20 31 36 20 2a 2f 0a 0a 09 |lied by 16 */...| 00001120 69 66 28 28 61 75 5f 62 79 74 65 74 6f 77 6f 72 |if((au_bytetowor| 00001130 64 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 2c 20 31 32 |d(poll_block, 12| 00001140 29 20 3d 3d 20 77 69 6e 5f 64 61 74 61 5b 32 5d |) == win_data[2]| 00001150 2e 77 69 6e 5f 68 61 6e 64 6c 65 29 20 26 26 20 |.win_handle) && | 00001160 28 63 6c 6b 20 3d 3d 20 34 2a 31 36 29 29 20 7b |(clk == 4*16)) {| 00001170 0a 09 09 2f 2a 20 53 74 61 72 74 20 74 68 65 20 |.../* Start the | 00001180 64 72 61 67 20 6f 70 65 72 61 74 69 6f 6e 20 2a |drag operation *| 00001190 2f 0a 09 09 69 63 6f 6e 5f 6e 75 6d 20 3d 20 61 |/...icon_num = a| 000011a0 75 5f 62 79 74 65 74 6f 77 6f 72 64 28 70 6f 6c |u_bytetoword(pol| 000011b0 6c 5f 62 6c 6f 63 6b 2c 20 31 36 29 3b 0a 09 09 |l_block, 16);...| 000011c0 2f 2a 20 41 72 65 20 77 65 20 6f 76 65 72 20 74 |/* Are we over t| 000011d0 68 65 20 61 63 74 75 61 6c 20 66 69 6c 65 20 69 |he actual file i| 000011e0 63 6f 6e 20 69 6e 20 74 68 65 20 73 61 76 65 20 |con in the save | 000011f0 77 69 6e 64 6f 77 3f 20 2a 2f 0a 09 09 69 66 28 |window? */...if(| 00001200 69 63 6f 6e 5f 6e 75 6d 20 3d 3d 20 53 41 56 45 |icon_num == SAVE| 00001210 5f 49 43 4f 4e 29 20 7b 0a 09 09 09 61 75 5f 64 |_ICON) {....au_d| 00001220 72 61 67 62 6f 78 28 61 75 5f 62 79 74 65 74 6f |ragbox(au_byteto| 00001230 77 6f 72 64 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 2c |word(poll_block,| 00001240 20 31 32 29 2c 20 69 63 6f 6e 5f 6e 75 6d 29 3b | 12), icon_num);| 00001250 0a 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72 6e |...}..}...return| 00001260 3b 0a 7d 0a 0a 76 6f 69 64 20 6d 65 6e 75 5f 73 |;.}..void menu_s| 00001270 65 6c 65 63 74 69 6f 6e 28 75 6e 73 69 67 6e 65 |election(unsigne| 00001280 64 20 63 68 61 72 20 70 6f 6c 6c 5f 62 6c 6f 63 |d char poll_bloc| 00001290 6b 5b 5d 29 0a 7b 0a 09 6c 6f 6e 67 20 69 6e 74 |k[]).{..long int| 000012a0 09 66 69 72 73 74 5f 68 69 74 3b 0a 09 2f 2a 20 |.first_hit;../* | 000012b0 57 68 69 63 68 20 6d 65 6e 75 20 77 61 73 20 68 |Which menu was h| 000012c0 69 74 3f 20 2a 2f 0a 09 69 66 20 28 43 55 52 52 |it? */..if (CURR| 000012d0 45 4e 54 5f 4d 45 4e 55 20 3d 3d 20 31 29 20 7b |ENT_MENU == 1) {| 000012e0 0a 09 09 2f 2a 20 54 68 65 20 69 63 6f 6e 20 62 |.../* The icon b| 000012f0 61 72 20 6d 65 6e 75 20 67 6f 74 20 69 74 20 2d |ar menu got it -| 00001300 20 64 65 63 69 70 68 65 72 20 66 69 72 73 74 20 | decipher first | 00001310 6d 65 6e 75 20 73 75 62 73 65 6c 65 63 74 69 6f |menu subselectio| 00001320 6e 20 2a 2f 0a 09 09 66 69 72 73 74 5f 68 69 74 |n */...first_hit| 00001330 20 3d 20 61 75 5f 62 79 74 65 74 6f 77 6f 72 64 | = au_bytetoword| 00001340 28 70 6f 6c 6c 5f 62 6c 6f 63 6b 2c 20 30 29 3b |(poll_block, 0);| 00001350 0a 09 09 69 66 20 28 66 69 72 73 74 5f 68 69 74 |...if (first_hit| 00001360 20 3d 3d 20 51 55 49 54 5f 4f 50 54 49 4f 4e 29 | == QUIT_OPTION)| 00001370 20 7b 0a 09 09 09 51 55 49 54 5f 46 4c 41 47 20 | {....QUIT_FLAG | 00001380 3d 20 31 3b 0a 09 09 7d 0a 09 7d 0a 09 72 65 74 |= 1;...}..}..ret| 00001390 75 72 6e 3b 0a 7d 0a 0a 76 6f 69 64 20 70 72 65 |urn;.}..void pre| 000013a0 76 5f 72 65 63 6f 72 64 28 76 6f 69 64 29 0a 7b |v_record(void).{| 000013b0 0a 09 69 66 20 28 43 55 52 52 45 4e 54 5f 52 45 |..if (CURRENT_RE| 000013c0 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e 70 72 |CORD_POINTER->pr| 000013d0 65 76 5f 72 65 63 6f 72 64 20 21 3d 20 4e 55 4c |ev_record != NUL| 000013e0 4c 29 20 7b 0a 09 09 2f 2a 20 53 61 76 65 20 77 |L) {.../* Save w| 000013f0 69 6e 64 6f 77 20 69 6e 66 6f 72 6d 61 74 69 6f |indow informatio| 00001400 6e 3f 20 2a 2f 0a 09 09 43 55 52 52 45 4e 54 5f |n? */...CURRENT_| 00001410 52 45 43 4f 52 44 5f 50 4f 49 4e 54 45 52 20 3d |RECORD_POINTER =| 00001420 20 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f | CURRENT_RECORD_| 00001430 50 4f 49 4e 54 45 52 2d 3e 70 72 65 76 5f 72 65 |POINTER->prev_re| 00001440 63 6f 72 64 3b 0a 09 09 43 55 52 52 45 4e 54 5f |cord;...CURRENT_| 00001450 52 45 43 4f 52 44 5f 4e 55 4d 42 45 52 20 3d 20 |RECORD_NUMBER = | 00001460 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 00001470 4f 49 4e 54 45 52 2d 3e 6a 75 6d 70 5f 6e 6f 3b |OINTER->jump_no;| 00001480 0a 09 09 2f 2a 20 77 6f 75 6c 64 20 75 70 64 61 |.../* would upda| 00001490 74 65 20 77 69 6e 64 6f 77 20 69 6e 66 6f 20 68 |te window info h| 000014a0 65 72 65 20 2a 2f 0a 09 09 75 70 64 61 74 65 5f |ere */...update_| 000014b0 77 69 6e 64 6f 77 5f 69 6e 66 6f 28 29 3b 0a 09 |window_info();..| 000014c0 7d 0a 7d 0a 0a 76 6f 69 64 20 6e 65 78 74 5f 72 |}.}..void next_r| 000014d0 65 63 6f 72 64 28 76 6f 69 64 29 0a 7b 0a 09 69 |ecord(void).{..i| 000014e0 66 20 28 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 |f (CURRENT_RECOR| 000014f0 44 5f 50 4f 49 4e 54 45 52 2d 3e 6e 65 78 74 5f |D_POINTER->next_| 00001500 72 65 63 6f 72 64 20 21 3d 20 4e 55 4c 4c 29 20 |record != NULL) | 00001510 7b 0a 09 09 43 55 52 52 45 4e 54 5f 52 45 43 4f |{...CURRENT_RECO| 00001520 52 44 5f 50 4f 49 4e 54 45 52 20 3d 20 43 55 52 |RD_POINTER = CUR| 00001530 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e |RENT_RECORD_POIN| 00001540 54 45 52 2d 3e 6e 65 78 74 5f 72 65 63 6f 72 64 |TER->next_record| 00001550 3b 0a 09 09 43 55 52 52 45 4e 54 5f 52 45 43 4f |;...CURRENT_RECO| 00001560 52 44 5f 4e 55 4d 42 45 52 20 3d 20 43 55 52 52 |RD_NUMBER = CURR| 00001570 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e 54 |ENT_RECORD_POINT| 00001580 45 52 2d 3e 6a 75 6d 70 5f 6e 6f 3b 0a 09 09 2f |ER->jump_no;.../| 00001590 2a 20 77 6f 75 6c 64 20 75 70 64 61 74 65 20 77 |* would update w| 000015a0 69 6e 64 6f 77 20 69 6e 66 6f 20 68 65 72 65 20 |indow info here | 000015b0 2a 2f 0a 09 09 75 70 64 61 74 65 5f 77 69 6e 64 |*/...update_wind| 000015c0 6f 77 5f 69 6e 66 6f 28 29 3b 0a 09 7d 0a 7d 0a |ow_info();..}.}.| 000015d0 0a 76 6f 69 64 20 75 70 64 61 74 65 5f 72 65 63 |.void update_rec| 000015e0 6f 72 64 28 76 6f 69 64 29 0a 7b 0a 09 2f 2a 20 |ord(void).{../* | 000015f0 57 65 20 6e 65 65 64 20 61 20 74 65 6d 70 6f 72 |We need a tempor| 00001600 61 72 79 20 73 74 72 69 6e 67 20 62 75 66 66 65 |ary string buffe| 00001610 72 20 2a 2f 0a 09 63 68 61 72 20 74 65 6d 70 5f |r */..char temp_| 00001620 62 75 66 5b 32 35 35 5d 3b 0a 0a 09 2f 2a 20 53 |buf[255];.../* S| 00001630 61 76 65 20 77 69 6e 64 6f 77 20 69 6e 66 6f 72 |ave window infor| 00001640 6d 61 74 69 6f 6e 20 2a 2f 0a 09 61 75 5f 69 63 |mation */..au_ic| 00001650 6f 6e 5f 67 65 74 5f 74 65 78 74 28 43 55 52 52 |on_get_text(CURR| 00001660 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e 54 |ENT_RECORD_POINT| 00001670 45 52 2d 3e 64 61 74 65 2c 20 77 69 6e 5f 64 61 |ER->date, win_da| 00001680 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e 64 6c 65 |ta[0].win_handle| 00001690 2c 20 44 41 54 45 5f 49 43 4f 4e 29 3b 0a 09 61 |, DATE_ICON);..a| 000016a0 75 5f 69 63 6f 6e 5f 67 65 74 5f 74 65 78 74 28 |u_icon_get_text(| 000016b0 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 000016c0 4f 49 4e 54 45 52 2d 3e 61 69 72 63 72 61 66 74 |OINTER->aircraft| 000016d0 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 |, win_data[0].wi| 000016e0 6e 5f 68 61 6e 64 6c 65 2c 20 41 49 52 43 52 41 |n_handle, AIRCRA| 000016f0 46 54 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 63 |FT_ICON);..au_ic| 00001700 6f 6e 5f 67 65 74 5f 74 65 78 74 28 43 55 52 52 |on_get_text(CURR| 00001710 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e 54 |ENT_RECORD_POINT| 00001720 45 52 2d 3e 64 72 6f 70 7a 6f 6e 65 2c 20 77 69 |ER->dropzone, wi| 00001730 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 |n_data[0].win_ha| 00001740 6e 64 6c 65 2c 20 44 52 4f 50 5a 4f 4e 45 5f 49 |ndle, DROPZONE_I| 00001750 43 4f 4e 29 3b 0a 09 61 75 5f 69 63 6f 6e 5f 67 |CON);..au_icon_g| 00001760 65 74 5f 74 65 78 74 28 43 55 52 52 45 4e 54 5f |et_text(CURRENT_| 00001770 52 45 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e |RECORD_POINTER->| 00001780 61 69 72 77 6f 72 6b 2c 20 77 69 6e 5f 64 61 74 |airwork, win_dat| 00001790 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e 64 6c 65 2c |a[0].win_handle,| 000017a0 20 41 49 52 57 4f 52 4b 5f 49 43 4f 4e 29 3b 0a | AIRWORK_ICON);.| 000017b0 09 61 75 5f 69 63 6f 6e 5f 67 65 74 5f 74 65 78 |.au_icon_get_tex| 000017c0 74 28 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 |t(CURRENT_RECORD| 000017d0 5f 50 4f 49 4e 54 45 52 2d 3e 72 65 6d 61 72 6b |_POINTER->remark| 000017e0 73 31 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e |s1, win_data[0].| 000017f0 77 69 6e 5f 68 61 6e 64 6c 65 2c 20 52 45 4d 41 |win_handle, REMA| 00001800 52 4b 53 31 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f |RKS1_ICON);..au_| 00001810 69 63 6f 6e 5f 67 65 74 5f 74 65 78 74 28 43 55 |icon_get_text(CU| 00001820 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 |RRENT_RECORD_POI| 00001830 4e 54 45 52 2d 3e 72 65 6d 61 72 6b 73 32 2c 20 |NTER->remarks2, | 00001840 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f |win_data[0].win_| 00001850 68 61 6e 64 6c 65 2c 20 52 45 4d 41 52 4b 53 32 |handle, REMARKS2| 00001860 5f 49 43 4f 4e 29 3b 0a 09 2f 2a 20 57 65 20 6e |_ICON);../* We n| 00001870 65 65 64 20 74 6f 20 63 6f 6e 76 65 72 74 20 74 |eed to convert t| 00001880 65 78 74 20 74 6f 20 69 6e 74 65 67 65 72 20 68 |ext to integer h| 00001890 65 72 65 20 2a 2f 0a 09 61 75 5f 69 63 6f 6e 5f |ere */..au_icon_| 000018a0 67 65 74 5f 74 65 78 74 28 74 65 6d 70 5f 62 75 |get_text(temp_bu| 000018b0 66 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 |f, win_data[0].w| 000018c0 69 6e 5f 68 61 6e 64 6c 65 2c 20 41 4c 54 49 54 |in_handle, ALTIT| 000018d0 55 44 45 5f 49 43 4f 4e 29 3b 0a 09 43 55 52 52 |UDE_ICON);..CURR| 000018e0 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e 54 |ENT_RECORD_POINT| 000018f0 45 52 2d 3e 61 6c 74 69 74 75 64 65 20 3d 20 61 |ER->altitude = a| 00001900 74 6f 69 28 74 65 6d 70 5f 62 75 66 29 3b 0a 0a |toi(temp_buf);..| 00001910 09 2f 2a 20 41 6e 64 20 68 65 72 65 20 2a 2f 0a |./* And here */.| 00001920 09 61 75 5f 69 63 6f 6e 5f 67 65 74 5f 74 65 78 |.au_icon_get_tex| 00001930 74 28 74 65 6d 70 5f 62 75 66 2c 20 77 69 6e 5f |t(temp_buf, win_| 00001940 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e 64 |data[0].win_hand| 00001950 6c 65 2c 20 44 45 4c 41 59 5f 49 43 4f 4e 29 3b |le, DELAY_ICON);| 00001960 0a 09 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 |..CURRENT_RECORD| 00001970 5f 50 4f 49 4e 54 45 52 2d 3e 64 65 6c 61 79 20 |_POINTER->delay | 00001980 3d 20 61 74 6f 69 28 74 65 6d 70 5f 62 75 66 29 |= atoi(temp_buf)| 00001990 3b 0a 09 2f 2a 20 52 65 63 6f 72 64 20 69 73 20 |;../* Record is | 000019a0 6e 6f 77 20 73 61 76 65 64 20 69 6e 20 6d 65 6d |now saved in mem| 000019b0 6f 72 79 20 2a 2f 0a 0a 09 2f 2a 20 41 72 65 20 |ory */.../* Are | 000019c0 77 65 20 6f 6e 20 74 68 65 20 6c 61 73 74 20 72 |we on the last r| 000019d0 65 63 6f 72 64 3f 20 49 66 20 73 6f 2c 20 77 65 |ecord? If so, we| 000019e0 20 61 64 64 20 61 20 6e 65 77 20 6f 6e 65 20 2a | add a new one *| 000019f0 2f 0a 09 69 66 20 28 43 55 52 52 45 4e 54 5f 52 |/..if (CURRENT_R| 00001a00 45 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e 6e |ECORD_POINTER->n| 00001a10 65 78 74 5f 72 65 63 6f 72 64 20 3d 3d 20 4e 55 |ext_record == NU| 00001a20 4c 4c 29 20 7b 0a 09 09 61 64 64 5f 72 65 63 6f |LL) {...add_reco| 00001a30 72 64 28 29 3b 0a 09 7d 0a 7d 0a 0a 76 6f 69 64 |rd();..}.}..void| 00001a40 20 61 64 64 5f 72 65 63 6f 72 64 28 76 6f 69 64 | add_record(void| 00001a50 29 0a 7b 0a 09 6a 75 6d 70 5f 64 61 74 61 09 2a |).{..jump_data.*| 00001a60 6e 65 77 5f 72 65 63 6f 72 64 3b 0a 0a 09 2f 2a |new_record;.../*| 00001a70 49 6e 66 6f 72 6d 61 74 69 6f 6e 20 66 72 6f 6d |Information from| 00001a80 20 77 69 6e 64 6f 77 20 61 6c 72 65 61 64 79 20 | window already | 00001a90 73 61 76 65 64 20 2a 2f 0a 0a 09 6e 65 77 5f 72 |saved */...new_r| 00001aa0 65 63 6f 72 64 20 3d 20 63 61 6c 6c 6f 63 28 31 |ecord = calloc(1| 00001ab0 2c 20 73 69 7a 65 6f 66 28 6a 75 6d 70 5f 64 61 |, sizeof(jump_da| 00001ac0 74 61 29 29 3b 0a 09 2f 2a 20 49 6e 69 74 69 61 |ta));../* Initia| 00001ad0 6c 69 73 65 20 70 6f 69 6e 74 65 72 73 20 2a 2f |lise pointers */| 00001ae0 0a 09 6e 65 77 5f 72 65 63 6f 72 64 2d 3e 70 72 |..new_record->pr| 00001af0 65 76 5f 72 65 63 6f 72 64 20 3d 20 43 55 52 52 |ev_record = CURR| 00001b00 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 4e 54 |ENT_RECORD_POINT| 00001b10 45 52 3b 0a 09 6e 65 77 5f 72 65 63 6f 72 64 2d |ER;..new_record-| 00001b20 3e 6e 65 78 74 5f 72 65 63 6f 72 64 20 3d 20 4e |>next_record = N| 00001b30 55 4c 4c 3b 0a 09 4c 41 53 54 5f 52 45 43 4f 52 |ULL;..LAST_RECOR| 00001b40 44 5f 4e 55 4d 42 45 52 20 3d 20 6e 65 77 5f 72 |D_NUMBER = new_r| 00001b50 65 63 6f 72 64 2d 3e 6a 75 6d 70 5f 6e 6f 20 3d |ecord->jump_no =| 00001b60 20 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f | CURRENT_RECORD_| 00001b70 50 4f 49 4e 54 45 52 2d 3e 6a 75 6d 70 5f 6e 6f |POINTER->jump_no| 00001b80 20 2b 20 31 3b 0a 09 43 55 52 52 45 4e 54 5f 52 | + 1;..CURRENT_R| 00001b90 45 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e 6e |ECORD_POINTER->n| 00001ba0 65 78 74 5f 72 65 63 6f 72 64 20 3d 20 6e 65 77 |ext_record = new| 00001bb0 5f 72 65 63 6f 72 64 3b 0a 0a 09 2f 2a 20 53 77 |_record;.../* Sw| 00001bc0 69 74 63 68 20 76 69 65 77 20 74 6f 20 74 68 65 |itch view to the| 00001bd0 20 6e 65 77 20 72 65 63 6f 72 64 20 2a 2f 0a 09 | new record */..| 00001be0 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 00001bf0 4f 49 4e 54 45 52 20 3d 20 6e 65 77 5f 72 65 63 |OINTER = new_rec| 00001c00 6f 72 64 3b 0a 09 43 55 52 52 45 4e 54 5f 52 45 |ord;..CURRENT_RE| 00001c10 43 4f 52 44 5f 4e 55 4d 42 45 52 20 3d 20 43 55 |CORD_NUMBER = CU| 00001c20 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 |RRENT_RECORD_POI| 00001c30 4e 54 45 52 2d 3e 6a 75 6d 70 5f 6e 6f 3b 0a 0a |NTER->jump_no;..| 00001c40 09 2f 2a 20 55 70 64 61 74 65 20 74 68 65 20 77 |./* Update the w| 00001c50 69 6e 64 6f 77 20 74 6f 20 64 69 73 70 6c 61 79 |indow to display| 00001c60 20 74 68 65 20 6e 65 77 20 69 6e 66 6f 72 6d 61 | the new informa| 00001c70 74 69 6f 6e 20 2a 2f 0a 09 75 70 64 61 74 65 5f |tion */..update_| 00001c80 77 69 6e 64 6f 77 5f 69 6e 66 6f 28 29 3b 0a 7d |window_info();.}| 00001c90 0a 0a 76 6f 69 64 20 75 70 64 61 74 65 5f 77 69 |..void update_wi| 00001ca0 6e 64 6f 77 5f 69 6e 66 6f 28 76 6f 69 64 29 0a |ndow_info(void).| 00001cb0 7b 0a 09 63 68 61 72 09 74 65 6d 70 5f 73 74 72 |{..char.temp_str| 00001cc0 69 6e 67 5b 32 35 35 5d 3b 0a 0a 09 61 75 5f 6c |ing[255];...au_l| 00001cd0 6f 73 65 63 61 72 65 74 28 29 3b 0a 09 69 66 20 |osecaret();..if | 00001ce0 28 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f |(CURRENT_RECORD_| 00001cf0 50 4f 49 4e 54 45 52 2d 3e 6e 65 78 74 5f 72 65 |POINTER->next_re| 00001d00 63 6f 72 64 20 3d 3d 20 4e 55 4c 4c 29 20 7b 0a |cord == NULL) {.| 00001d10 09 09 61 75 5f 69 63 6f 6e 5f 74 65 78 74 5f 63 |..au_icon_text_c| 00001d20 68 61 6e 67 65 28 22 41 64 64 22 2c 20 77 69 6e |hange("Add", win| 00001d30 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e |_data[0].win_han| 00001d40 64 6c 65 2c 20 55 50 44 41 54 45 5f 49 43 4f 4e |dle, UPDATE_ICON| 00001d50 29 3b 0a 09 7d 20 65 6c 73 65 20 7b 0a 09 09 61 |);..} else {...a| 00001d60 75 5f 69 63 6f 6e 5f 74 65 78 74 5f 63 68 61 6e |u_icon_text_chan| 00001d70 67 65 28 22 55 70 64 61 74 65 22 2c 20 77 69 6e |ge("Update", win| 00001d80 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e |_data[0].win_han| 00001d90 64 6c 65 2c 20 55 50 44 41 54 45 5f 49 43 4f 4e |dle, UPDATE_ICON| 00001da0 29 3b 0a 09 7d 0a 09 73 70 72 69 6e 74 66 28 74 |);..}..sprintf(t| 00001db0 65 6d 70 5f 73 74 72 69 6e 67 2c 20 22 25 64 22 |emp_string, "%d"| 00001dc0 2c 20 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 |, CURRENT_RECORD| 00001dd0 5f 50 4f 49 4e 54 45 52 2d 3e 6a 75 6d 70 5f 6e |_POINTER->jump_n| 00001de0 6f 29 3b 0a 09 61 75 5f 69 63 6f 6e 5f 74 65 78 |o);..au_icon_tex| 00001df0 74 5f 63 68 61 6e 67 65 28 74 65 6d 70 5f 73 74 |t_change(temp_st| 00001e00 72 69 6e 67 2c 20 77 69 6e 5f 64 61 74 61 5b 30 |ring, win_data[0| 00001e10 5d 2e 77 69 6e 5f 68 61 6e 64 6c 65 2c 20 43 55 |].win_handle, CU| 00001e20 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 49 43 4f |RRENT_RECORD_ICO| 00001e30 4e 29 3b 0a 09 73 70 72 69 6e 74 66 28 74 65 6d |N);..sprintf(tem| 00001e40 70 5f 73 74 72 69 6e 67 2c 20 22 25 64 22 2c 20 |p_string, "%d", | 00001e50 4c 41 53 54 5f 52 45 43 4f 52 44 5f 4e 55 4d 42 |LAST_RECORD_NUMB| 00001e60 45 52 29 3b 0a 09 61 75 5f 69 63 6f 6e 5f 74 65 |ER);..au_icon_te| 00001e70 78 74 5f 63 68 61 6e 67 65 28 74 65 6d 70 5f 73 |xt_change(temp_s| 00001e80 74 72 69 6e 67 2c 20 77 69 6e 5f 64 61 74 61 5b |tring, win_data[| 00001e90 30 5d 2e 77 69 6e 5f 68 61 6e 64 6c 65 2c 20 4c |0].win_handle, L| 00001ea0 41 53 54 5f 52 45 43 4f 52 44 5f 49 43 4f 4e 29 |AST_RECORD_ICON)| 00001eb0 3b 0a 0a 09 61 75 5f 69 63 6f 6e 5f 74 65 78 74 |;...au_icon_text| 00001ec0 5f 63 68 61 6e 67 65 28 43 55 52 52 45 4e 54 5f |_change(CURRENT_| 00001ed0 52 45 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e |RECORD_POINTER->| 00001ee0 64 61 74 65 20 2c 20 77 69 6e 5f 64 61 74 61 5b |date , win_data[| 00001ef0 30 5d 2e 77 69 6e 5f 68 61 6e 64 6c 65 2c 20 44 |0].win_handle, D| 00001f00 41 54 45 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 |ATE_ICON);..au_i| 00001f10 63 6f 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 |con_text_change(| 00001f20 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 00001f30 4f 49 4e 54 45 52 2d 3e 61 69 72 63 72 61 66 74 |OINTER->aircraft| 00001f40 20 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 | , win_data[0].w| 00001f50 69 6e 5f 68 61 6e 64 6c 65 2c 20 41 49 52 43 52 |in_handle, AIRCR| 00001f60 41 46 54 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 |AFT_ICON);..au_i| 00001f70 63 6f 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 |con_text_change(| 00001f80 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 00001f90 4f 49 4e 54 45 52 2d 3e 64 72 6f 70 7a 6f 6e 65 |OINTER->dropzone| 00001fa0 20 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 | , win_data[0].w| 00001fb0 69 6e 5f 68 61 6e 64 6c 65 2c 20 44 52 4f 50 5a |in_handle, DROPZ| 00001fc0 4f 4e 45 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 |ONE_ICON);..au_i| 00001fd0 63 6f 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 |con_text_change(| 00001fe0 43 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 |CURRENT_RECORD_P| 00001ff0 4f 49 4e 54 45 52 2d 3e 61 69 72 77 6f 72 6b 20 |OINTER->airwork | 00002000 2c 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 |, win_data[0].wi| 00002010 6e 5f 68 61 6e 64 6c 65 2c 20 41 49 52 57 4f 52 |n_handle, AIRWOR| 00002020 4b 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 63 6f |K_ICON);..au_ico| 00002030 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 43 55 |n_text_change(CU| 00002040 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 |RRENT_RECORD_POI| 00002050 4e 54 45 52 2d 3e 72 65 6d 61 72 6b 73 31 20 2c |NTER->remarks1 ,| 00002060 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e | win_data[0].win| 00002070 5f 68 61 6e 64 6c 65 2c 20 52 45 4d 41 52 4b 53 |_handle, REMARKS| 00002080 31 5f 49 43 4f 4e 29 3b 0a 09 61 75 5f 69 63 6f |1_ICON);..au_ico| 00002090 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 43 55 |n_text_change(CU| 000020a0 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f 49 |RRENT_RECORD_POI| 000020b0 4e 54 45 52 2d 3e 72 65 6d 61 72 6b 73 32 20 2c |NTER->remarks2 ,| 000020c0 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e | win_data[0].win| 000020d0 5f 68 61 6e 64 6c 65 2c 20 52 45 4d 41 52 4b 53 |_handle, REMARKS| 000020e0 32 5f 49 43 4f 4e 29 3b 0a 0a 09 73 70 72 69 6e |2_ICON);...sprin| 000020f0 74 66 28 74 65 6d 70 5f 73 74 72 69 6e 67 2c 20 |tf(temp_string, | 00002100 22 25 64 22 2c 20 43 55 52 52 45 4e 54 5f 52 45 |"%d", CURRENT_RE| 00002110 43 4f 52 44 5f 50 4f 49 4e 54 45 52 2d 3e 61 6c |CORD_POINTER->al| 00002120 74 69 74 75 64 65 29 3b 0a 09 61 75 5f 69 63 6f |titude);..au_ico| 00002130 6e 5f 74 65 78 74 5f 63 68 61 6e 67 65 28 74 65 |n_text_change(te| 00002140 6d 70 5f 73 74 72 69 6e 67 2c 20 77 69 6e 5f 64 |mp_string, win_d| 00002150 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e 64 6c |ata[0].win_handl| 00002160 65 2c 20 41 4c 54 49 54 55 44 45 5f 49 43 4f 4e |e, ALTITUDE_ICON| 00002170 29 3b 0a 09 73 70 72 69 6e 74 66 28 74 65 6d 70 |);..sprintf(temp| 00002180 5f 73 74 72 69 6e 67 2c 20 22 25 64 22 2c 20 43 |_string, "%d", C| 00002190 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f |URRENT_RECORD_PO| 000021a0 49 4e 54 45 52 2d 3e 64 65 6c 61 79 29 3b 0a 09 |INTER->delay);..| 000021b0 61 75 5f 69 63 6f 6e 5f 74 65 78 74 5f 63 68 61 |au_icon_text_cha| 000021c0 6e 67 65 28 74 65 6d 70 5f 73 74 72 69 6e 67 2c |nge(temp_string,| 000021d0 20 77 69 6e 5f 64 61 74 61 5b 30 5d 2e 77 69 6e | win_data[0].win| 000021e0 5f 68 61 6e 64 6c 65 2c 20 44 45 4c 41 59 5f 49 |_handle, DELAY_I| 000021f0 43 4f 4e 29 3b 0a 09 72 65 74 75 72 6e 3b 0a 7d |CON);..return;.}| 00002200 0a 0a 76 6f 69 64 20 6f 70 65 6e 5f 6d 61 69 6e |..void open_main| 00002210 5f 77 69 6e 64 6f 77 28 76 6f 69 64 29 0a 7b 0a |_window(void).{.| 00002220 09 5f 6b 65 72 6e 65 6c 5f 73 77 69 5f 72 65 67 |._kernel_swi_reg| 00002230 73 09 69 6e 2c 20 6f 75 74 3b 0a 09 75 6e 73 69 |s.in, out;..unsi| 00002240 67 6e 65 64 20 63 68 61 72 09 74 65 6d 70 5f 62 |gned char.temp_b| 00002250 75 66 66 65 72 5b 31 30 32 34 5d 3b 0a 0a 2f 2a |uffer[1024];../*| 00002260 20 57 65 20 6e 65 65 64 20 74 6f 20 75 70 64 61 | We need to upda| 00002270 74 65 20 74 68 65 20 63 75 72 72 65 6e 74 20 61 |te the current a| 00002280 6e 64 20 6c 61 73 74 20 72 65 63 6f 72 64 20 6e |nd last record n| 00002290 75 6d 62 65 72 73 20 69 6e 20 74 68 65 20 77 69 |umbers in the wi| 000022a0 6e 64 6f 77 0a 20 2a 20 62 65 66 6f 72 65 20 6f |ndow. * before o| 000022b0 70 65 6e 69 6e 67 20 2a 2f 0a 0a 09 75 70 64 61 |pening */...upda| 000022c0 74 65 5f 77 69 6e 64 6f 77 5f 69 6e 66 6f 28 29 |te_window_info()| 000022d0 3b 0a 0a 2f 2a 20 4e 6f 77 20 6f 70 65 6e 20 74 |;../* Now open t| 000022e0 68 65 20 77 69 6e 64 6f 77 20 2a 2f 0a 0a 09 61 |he window */...a| 000022f0 75 5f 77 6f 72 64 74 6f 62 79 74 65 28 77 69 6e |u_wordtobyte(win| 00002300 5f 64 61 74 61 5b 30 5d 2e 77 69 6e 5f 68 61 6e |_data[0].win_han| 00002310 64 6c 65 2c 20 74 65 6d 70 5f 62 75 66 66 65 72 |dle, temp_buffer| 00002320 2c 20 30 29 3b 0a 09 69 6e 2e 72 5b 31 5d 20 3d |, 0);..in.r[1] =| 00002330 20 28 69 6e 74 29 20 74 65 6d 70 5f 62 75 66 66 | (int) temp_buff| 00002340 65 72 3b 0a 09 5f 6b 65 72 6e 65 6c 5f 73 77 69 |er;.._kernel_swi| 00002350 28 57 69 6d 70 5f 47 65 74 57 69 6e 64 6f 77 49 |(Wimp_GetWindowI| 00002360 6e 66 6f 2c 20 26 69 6e 2c 20 26 6f 75 74 29 3b |nfo, &in, &out);| 00002370 0a 09 5f 6b 65 72 6e 65 6c 5f 73 77 69 28 57 69 |.._kernel_swi(Wi| 00002380 6d 70 5f 4f 70 65 6e 57 69 6e 64 6f 77 2c 20 26 |mp_OpenWindow, &| 00002390 69 6e 2c 20 26 6f 75 74 29 3b 0a 09 72 65 74 75 |in, &out);..retu| 000023a0 72 6e 3b 0a 7d 0a 0a 76 6f 69 64 20 77 69 6d 70 |rn;.}..void wimp| 000023b0 5f 6d 73 67 28 69 6e 74 20 72 65 73 75 6c 74 2c |_msg(int result,| 000023c0 20 75 6e 73 69 67 6e 65 64 20 63 68 61 72 20 70 | unsigned char p| 000023d0 6f 6c 6c 62 6c 6f 63 6b 5b 5d 29 0a 7b 0a 09 75 |ollblock[]).{..u| 000023e0 6e 73 69 67 6e 65 64 20 6c 6f 6e 67 20 69 6e 74 |nsigned long int| 000023f0 20 20 20 6d 65 73 73 61 67 65 5f 61 63 74 69 6f | message_actio| 00002400 6e 3b 0a 09 0a 09 2f 2a 20 54 68 65 20 6e 65 78 |n;..../* The nex| 00002410 74 20 6c 69 6e 65 20 74 61 6b 65 73 20 62 79 74 |t line takes byt| 00002420 65 73 20 31 36 20 74 6f 20 31 39 20 6f 66 20 74 |es 16 to 19 of t| 00002430 68 65 20 70 6f 6c 6c 69 6e 67 20 62 6c 6f 63 6b |he polling block| 00002440 20 61 6e 64 20 66 6f 72 6d 73 20 74 68 65 6d 0a | and forms them.| 00002450 09 20 20 20 69 6e 74 6f 20 61 20 77 6f 72 64 20 |. into a word | 00002460 68 6f 6c 64 69 6e 67 20 74 68 65 20 6d 65 73 73 |holding the mess| 00002470 61 67 65 20 61 63 74 69 6f 6e 20 6e 75 6d 62 65 |age action numbe| 00002480 72 20 2a 2f 0a 09 6d 65 73 73 61 67 65 5f 61 63 |r */..message_ac| 00002490 74 69 6f 6e 20 3d 20 61 75 5f 62 79 74 65 74 6f |tion = au_byteto| 000024a0 77 6f 72 64 28 70 6f 6c 6c 62 6c 6f 63 6b 2c 20 |word(pollblock, | 000024b0 31 36 29 3b 0a 0a 09 73 77 69 74 63 68 20 28 6d |16);...switch (m| 000024c0 65 73 73 61 67 65 5f 61 63 74 69 6f 6e 29 20 7b |essage_action) {| 000024d0 0a 09 09 63 61 73 65 20 30 20 3a 20 51 55 49 54 |...case 0 : QUIT| 000024e0 5f 46 4c 41 47 20 3d 20 31 3b 20 2f 2a 20 4d 65 |_FLAG = 1; /* Me| 000024f0 73 73 61 67 65 5f 51 75 69 74 20 2d 20 74 69 6d |ssage_Quit - tim| 00002500 65 20 74 6f 20 67 6f 20 2a 2f 0a 09 09 09 09 62 |e to go */.....b| 00002510 72 65 61 6b 3b 0a 09 7d 0a 09 72 65 74 75 72 6e |reak;..}..return| 00002520 3b 0a 7d 0a 0a 0a 76 6f 69 64 20 6f 70 65 6e 77 |;.}...void openw| 00002530 69 6e 64 6f 77 28 75 6e 73 69 67 6e 65 64 20 63 |indow(unsigned c| 00002540 68 61 72 20 70 6f 6c 6c 62 6c 6f 63 6b 5b 5d 29 |har pollblock[])| 00002550 0a 7b 0a 20 20 20 5f 6b 65 72 6e 65 6c 5f 73 77 |.{. _kernel_sw| 00002560 69 5f 72 65 67 73 20 69 6e 2c 20 6f 75 74 3b 0a |i_regs in, out;.| 00002570 0a 20 20 20 69 6e 2e 72 5b 31 5d 20 3d 20 28 69 |. in.r[1] = (i| 00002580 6e 74 29 20 70 6f 6c 6c 62 6c 6f 63 6b 3b 0a 20 |nt) pollblock;. | 00002590 20 20 5f 6b 65 72 6e 65 6c 5f 73 77 69 28 57 69 | _kernel_swi(Wi| 000025a0 6d 70 5f 4f 70 65 6e 57 69 6e 64 6f 77 2c 20 26 |mp_OpenWindow, &| 000025b0 69 6e 2c 20 26 6f 75 74 29 3b 0a 20 20 20 72 65 |in, &out);. re| 000025c0 74 75 72 6e 3b 0a 7d 0a 0a 76 6f 69 64 20 63 6c |turn;.}..void cl| 000025d0 6f 73 65 77 69 6e 64 6f 77 28 75 6e 73 69 67 6e |osewindow(unsign| 000025e0 65 64 20 63 68 61 72 20 70 6f 6c 6c 62 6c 6f 63 |ed char pollbloc| 000025f0 6b 5b 5d 29 0a 7b 0a 20 20 20 5f 6b 65 72 6e 65 |k[]).{. _kerne| 00002600 6c 5f 73 77 69 5f 72 65 67 73 20 69 6e 2c 20 6f |l_swi_regs in, o| 00002610 75 74 3b 0a 0a 20 20 20 69 6e 2e 72 5b 31 5d 20 |ut;.. in.r[1] | 00002620 3d 20 28 69 6e 74 29 20 70 6f 6c 6c 62 6c 6f 63 |= (int) pollbloc| 00002630 6b 3b 0a 20 20 20 5f 6b 65 72 6e 65 6c 5f 73 77 |k;. _kernel_sw| 00002640 69 28 57 69 6d 70 5f 43 6c 6f 73 65 57 69 6e 64 |i(Wimp_CloseWind| 00002650 6f 77 2c 20 26 69 6e 2c 20 26 6f 75 74 29 3b 0a |ow, &in, &out);.| 00002660 20 20 20 72 65 74 75 72 6e 3b 0a 7d 0a 0a 76 6f | return;.}..vo| 00002670 69 64 20 6c 6f 61 64 74 65 6d 70 6c 61 74 65 73 |id loadtemplates| 00002680 28 76 6f 69 64 29 0a 7b 0a 09 61 75 5f 6f 70 65 |(void).{..au_ope| 00002690 6e 74 65 6d 70 6c 61 74 65 28 22 3c 52 41 50 53 |ntemplate("<RAPS| 000026a0 24 44 69 72 3e 2e 54 65 6d 70 6c 61 74 65 73 22 |$Dir>.Templates"| 000026b0 29 3b 0a 09 69 66 28 61 75 5f 6c 6f 61 64 74 65 |);..if(au_loadte| 000026c0 6d 70 6c 61 74 65 28 22 4d 61 69 6e 57 69 6e 64 |mplate("MainWind| 000026d0 6f 77 22 2c 20 26 77 69 6e 5f 64 61 74 61 5b 30 |ow", &win_data[0| 000026e0 5d 2c 20 30 29 20 3d 3d 20 30 29 20 7b 0a 09 09 |], 0) == 0) {...| 000026f0 61 75 5f 72 65 70 6f 72 74 5f 65 72 72 6f 72 28 |au_report_error(| 00002700 31 2c 20 22 54 65 6d 70 6c 61 74 65 20 6e 6f 74 |1, "Template not| 00002710 20 66 6f 75 6e 64 21 22 2c 20 31 2c 20 61 70 70 | found!", 1, app| 00002720 6e 61 6d 65 29 3b 0a 09 09 51 55 49 54 5f 46 4c |name);...QUIT_FL| 00002730 41 47 20 3d 20 31 3b 0a 09 7d 0a 09 69 66 28 61 |AG = 1;..}..if(a| 00002740 75 5f 6c 6f 61 64 74 65 6d 70 6c 61 74 65 28 22 |u_loadtemplate("| 00002750 50 72 6f 67 49 6e 66 6f 22 2c 20 26 77 69 6e 5f |ProgInfo", &win_| 00002760 64 61 74 61 5b 31 5d 2c 20 30 29 20 3d 3d 20 30 |data[1], 0) == 0| 00002770 29 20 7b 0a 09 09 61 75 5f 72 65 70 6f 72 74 5f |) {...au_report_| 00002780 65 72 72 6f 72 28 31 2c 20 22 54 65 6d 70 6c 61 |error(1, "Templa| 00002790 74 65 20 6e 6f 74 20 66 6f 75 6e 64 21 22 2c 20 |te not found!", | 000027a0 31 2c 20 61 70 70 6e 61 6d 65 29 3b 0a 09 09 51 |1, appname);...Q| 000027b0 55 49 54 5f 46 4c 41 47 20 3d 20 31 3b 0a 09 7d |UIT_FLAG = 1;..}| 000027c0 0a 09 69 66 28 61 75 5f 6c 6f 61 64 74 65 6d 70 |..if(au_loadtemp| 000027d0 6c 61 74 65 28 22 78 66 65 72 5f 73 65 6e 64 22 |late("xfer_send"| 000027e0 2c 20 26 77 69 6e 5f 64 61 74 61 5b 32 5d 2c 20 |, &win_data[2], | 000027f0 30 29 20 3d 3d 20 30 29 20 7b 0a 09 09 61 75 5f |0) == 0) {...au_| 00002800 72 65 70 6f 72 74 5f 65 72 72 6f 72 28 31 2c 20 |report_error(1, | 00002810 22 54 65 6d 70 6c 61 74 65 20 6e 6f 74 20 66 6f |"Template not fo| 00002820 75 6e 64 21 22 2c 20 31 2c 20 61 70 70 6e 61 6d |und!", 1, appnam| 00002830 65 29 3b 0a 09 09 51 55 49 54 5f 46 4c 41 47 20 |e);...QUIT_FLAG | 00002840 3d 20 31 3b 0a 09 7d 0a 0a 09 61 75 5f 63 6c 6f |= 1;..}...au_clo| 00002850 73 65 74 65 6d 70 6c 61 74 65 28 29 3b 0a 7d 0a |setemplate();.}.| 00002860 0a 76 6f 69 64 20 73 65 74 75 70 5f 64 61 74 61 |.void setup_data| 00002870 62 61 73 65 28 76 6f 69 64 29 0a 7b 0a 0a 09 2f |base(void).{.../| 00002880 2a 20 49 6e 69 74 69 61 6c 6c 79 2c 20 77 65 20 |* Initially, we | 00002890 6e 65 65 64 20 74 6f 20 73 65 74 20 61 73 69 64 |need to set asid| 000028a0 65 20 6d 65 6d 6f 72 79 20 66 6f 72 20 74 68 65 |e memory for the| 000028b0 20 27 72 6f 6f 74 27 20 73 74 72 75 63 74 75 72 | 'root' structur| 000028c0 65 20 2a 2f 0a 0a 09 6a 6d 70 5f 64 61 74 61 5f |e */...jmp_data_| 000028d0 72 6f 6f 74 20 3d 20 63 61 6c 6c 6f 63 28 31 2c |root = calloc(1,| 000028e0 20 73 69 7a 65 6f 66 28 6a 75 6d 70 5f 64 61 74 | sizeof(jump_dat| 000028f0 61 29 29 3b 0a 09 2f 2a 20 49 6e 69 74 69 61 6c |a));../* Initial| 00002900 69 73 65 20 70 6f 69 6e 74 65 72 73 20 2a 2f 0a |ise pointers */.| 00002910 09 6a 6d 70 5f 64 61 74 61 5f 72 6f 6f 74 2d 3e |.jmp_data_root->| 00002920 70 72 65 76 5f 72 65 63 6f 72 64 20 3d 20 6a 6d |prev_record = jm| 00002930 70 5f 64 61 74 61 5f 72 6f 6f 74 2d 3e 6e 65 78 |p_data_root->nex| 00002940 74 5f 72 65 63 6f 72 64 20 3d 20 4e 55 4c 4c 3b |t_record = NULL;| 00002950 0a 09 6a 6d 70 5f 64 61 74 61 5f 72 6f 6f 74 2d |..jmp_data_root-| 00002960 3e 6a 75 6d 70 5f 6e 6f 20 3d 20 31 3b 0a 09 43 |>jump_no = 1;..C| 00002970 55 52 52 45 4e 54 5f 52 45 43 4f 52 44 5f 50 4f |URRENT_RECORD_PO| 00002980 49 4e 54 45 52 20 3d 20 6a 6d 70 5f 64 61 74 61 |INTER = jmp_data| 00002990 5f 72 6f 6f 74 3b 0a 7d 0a |_root;.}.| 00002999