home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / x / volume14 / boss / patch3 / patch
Text File  |  1991-08-26  |  32KB  |  1,091 lines

  1. *** Makefile.orig    Wed Jul 24 09:38:23 1991
  2. --- Makefile    Fri May 17 09:10:01 1991
  3. ***************
  4. *** 22,28 ****
  5.   
  6.   OFILES        = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
  7.             database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
  8. !           expand.o filename_completion.o list_misc.o misc.o object.o packet.o \
  9.             parse.o pinned_menu_notify.o place_dialog.o print.o \
  10.             record.o send_mail.o window_misc.o
  11.   
  12. --- 22,28 ----
  13.   
  14.   OFILES        = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
  15.             database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
  16. !           expand.o filename_completion.o getopt.o list_misc.o misc.o object.o packet.o \
  17.             parse.o pinned_menu_notify.o place_dialog.o print.o \
  18.             record.o send_mail.o window_misc.o
  19.   
  20. *** README.orig    Wed Jul 24 09:38:25 1991
  21. --- README    Wed Jul 24 09:36:03 1991
  22. ***************
  23. *** 17,23 ****
  24.   /*    without prior permission from Harris Corporation.         */
  25.   /************************************************************************/
  26.   
  27. !             Boss Version 1.0
  28.   
  29.        Boss lets Casio BOSS users transfer data between their BOSS and
  30.   a workstation.  Users can also convert BOSS schedule items to formats useful
  31. --- 17,23 ----
  32.   /*    without prior permission from Harris Corporation.         */
  33.   /************************************************************************/
  34.   
  35. !             Boss Version 1.0c
  36.   
  37.        Boss lets Casio BOSS users transfer data between their BOSS and
  38.   a workstation.  Users can also convert BOSS schedule items to formats useful
  39. *** Imakefile.orig    Wed Jul 24 09:38:25 1991
  40. --- Imakefile    Fri May 17 09:10:01 1991
  41. ***************
  42. *** 12,24 ****
  43.   
  44.   SRCS        = about.c boss.c boss_ui.c busy.c calentool.c casio_master.c casio_slave.c \
  45.             database.c do_clear.c do_load.c do_port.c do_schedule.c do_store.c \
  46. !           expand.c filename_completion.c list_misc.c misc.c object.c packet.c \
  47.             parse.y pinned_menu_notify.c place_dialog.c print.c \
  48.             record.c send_mail.c window_misc.c
  49.   
  50.   OBJS        = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
  51.             database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
  52. !           expand.o filename_completion.o list_misc.o misc.o object.o packet.o \
  53.             parse.o pinned_menu_notify.o place_dialog.o print.o \
  54.             record.o send_mail.o window_misc.o
  55.   
  56. --- 12,24 ----
  57.   
  58.   SRCS        = about.c boss.c boss_ui.c busy.c calentool.c casio_master.c casio_slave.c \
  59.             database.c do_clear.c do_load.c do_port.c do_schedule.c do_store.c \
  60. !           expand.c filename_completion.c getopt.c list_misc.c misc.c object.c packet.c \
  61.             parse.y pinned_menu_notify.c place_dialog.c print.c \
  62.             record.c send_mail.c window_misc.c
  63.   
  64.   OBJS        = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
  65.             database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
  66. !           expand.o filename_completion.o getopt.o list_misc.o misc.o object.o packet.o \
  67.             parse.o pinned_menu_notify.o place_dialog.o print.o \
  68.             record.o send_mail.o window_misc.o
  69.   
  70. *** boss.man.orig    Wed Jul 24 09:38:26 1991
  71. --- boss.man    Wed Mar 27 07:27:30 1991
  72. ***************
  73. *** 75,82 ****
  74.   The text fields associated with \*(lqCasio-format file\*(rq and \*(lqASCII text file\*(rq
  75.   provide file name completion, like \f2csh\fP(1), by typing
  76.   a space or carriage return.
  77. ! .IP "\fBFile: Save Data...\fP"
  78. ! brings up the \fBSave Data\fP dialog box.  This dialog contains a non-exclusive
  79.   setting labeled \*(lqStore items\*(rq that lets you choose which items are to
  80.   be stored.  Only those items selected in this setting will be written to the
  81.   destination selected.
  82. --- 75,82 ----
  83.   The text fields associated with \*(lqCasio-format file\*(rq and \*(lqASCII text file\*(rq
  84.   provide file name completion, like \f2csh\fP(1), by typing
  85.   a space or carriage return.
  86. ! .IP "\fBFile: Store Data...\fP"
  87. ! brings up the \fBStore Data\fP dialog box.  This dialog contains a non-exclusive
  88.   setting labeled \*(lqStore items\*(rq that lets you choose which items are to
  89.   be stored.  Only those items selected in this setting will be written to the
  90.   destination selected.
  91. *** boss_ui.c.orig    Wed Jul 24 09:38:29 1991
  92. --- boss_ui.c    Wed Jul 24 09:38:17 1991
  93. ***************
  94. *** 103,109 ****
  95.           XV_KEY_DATA, INSTANCE, ip,
  96.           MENU_ITEM,
  97.               XV_KEY_DATA, INSTANCE, ip,
  98. !             MENU_STRING, "Port properties...",
  99.               MENU_GEN_PROC, port_dialog,
  100.               NULL,
  101.           MENU_DEFAULT, 2,
  102. --- 103,109 ----
  103.           XV_KEY_DATA, INSTANCE, ip,
  104.           MENU_ITEM,
  105.               XV_KEY_DATA, INSTANCE, ip,
  106. !             MENU_STRING, "Port Properties...",
  107.               MENU_GEN_PROC, port_dialog,
  108.               NULL,
  109.           MENU_DEFAULT, 2,
  110. ***************
  111. *** 192,198 ****
  112.           XV_KEY_DATA, INSTANCE, ip,
  113.           XV_WIDTH, 256,
  114.           XV_HEIGHT, 88,
  115. !         XV_LABEL, "Boss 1.0b",
  116.           FRAME_CLOSED, FALSE,
  117.           FRAME_SHOW_FOOTER, FALSE,
  118.           FRAME_SHOW_RESIZE_CORNER, FALSE,
  119. --- 192,198 ----
  120.           XV_KEY_DATA, INSTANCE, ip,
  121.           XV_WIDTH, 256,
  122.           XV_HEIGHT, 88,
  123. !         XV_LABEL, "Boss 1.0c",
  124.           FRAME_CLOSED, FALSE,
  125.           FRAME_SHOW_FOOTER, FALSE,
  126.           FRAME_SHOW_RESIZE_CORNER, FALSE,
  127. ***************
  128. *** 1658,1666 ****
  129.           XV_HELP_DATA, "boss:msg_1",
  130.           XV_X, 222,
  131.           XV_Y, 14,
  132. !         XV_WIDTH, 66,
  133.           XV_HEIGHT, 13,
  134. !         PANEL_LABEL_STRING, "Boss 1.0b",
  135.           PANEL_LABEL_BOLD, TRUE,
  136.           NULL);
  137.       return obj;
  138. --- 1658,1666 ----
  139.           XV_HELP_DATA, "boss:msg_1",
  140.           XV_X, 222,
  141.           XV_Y, 14,
  142. !         XV_WIDTH, 64,
  143.           XV_HEIGHT, 13,
  144. !         PANEL_LABEL_STRING, "Boss 1.0c",
  145.           PANEL_LABEL_BOLD, TRUE,
  146.           NULL);
  147.       return obj;
  148. ***************
  149. *** 2063,2073 ****
  150.       obj = xv_create(owner, PANEL_BUTTON,
  151.           XV_KEY_DATA, INSTANCE, ip,
  152.           XV_HELP_DATA, "boss:send_mail",
  153. !         XV_X, 215,
  154.           XV_Y, 352,
  155. !         XV_WIDTH, 78,
  156.           XV_HEIGHT, 20,
  157. !         PANEL_LABEL_STRING, "Send Mail",
  158.           PANEL_NOTIFY_PROC, popup_send_mail,
  159.           NULL);
  160.       return obj;
  161. --- 2063,2073 ----
  162.       obj = xv_create(owner, PANEL_BUTTON,
  163.           XV_KEY_DATA, INSTANCE, ip,
  164.           XV_HELP_DATA, "boss:send_mail",
  165. !         XV_X, 210,
  166.           XV_Y, 352,
  167. !         XV_WIDTH, 87,
  168.           XV_HEIGHT, 20,
  169. !         PANEL_LABEL_STRING, "Send Mail...",
  170.           PANEL_NOTIFY_PROC, popup_send_mail,
  171.           NULL);
  172.       return obj;
  173. *** casio.h.orig    Wed Jul 24 09:38:34 1991
  174. --- casio.h    Wed Jul 17 08:26:00 1991
  175. ***************
  176. *** 24,33 ****
  177.   /************************************************************************/
  178.   
  179.   #define        PACKET_START        ':'
  180. ! #define        XMIT_TERMINATE        '!'
  181. ! #define        RCV_ERROR        '"'
  182. ! #define        PACKET_ACK        '#'
  183. ! #define        MODE_ERROR        '$'
  184.   
  185.   PUBLIC    int    open_casio();
  186.   PUBLIC    int    read_casio();
  187. --- 24,34 ----
  188.   /************************************************************************/
  189.   
  190.   #define        PACKET_START        ':'
  191. ! #define        XMIT_TERMINATE        0x21
  192. ! #define        RCV_ERROR        0x22
  193. ! #define        PACKET_ACK        0x23
  194. ! #define        MODE_ERROR        0x24
  195. ! #define        XMIT_ERROR        0x3f
  196.   
  197.   PUBLIC    int    open_casio();
  198.   PUBLIC    int    read_casio();
  199. *** casio_master.c.orig    Wed Jul 24 09:38:35 1991
  200. --- casio_master.c    Wed Jun 19 10:18:45 1991
  201. ***************
  202. *** 220,227 ****
  203.   byte    b;
  204.   
  205.   {
  206. !     buf[0] = FLUSH_CASIO;
  207.       buf[1] = b;
  208.       if (do_write(buf, 2))
  209.          read_reply();
  210.   }
  211. --- 220,239 ----
  212.   byte    b;
  213.   
  214.   {
  215. !     buf[0] = UNGET_BYTE;
  216.       buf[1] = b;
  217.       if (do_write(buf, 2))
  218. +        read_reply();
  219. + }
  220. + /************************************************************************/
  221. + EXPORT    wait_casio(delay)
  222. + int    delay;
  223. + {
  224. +     buf[0] = WAIT_CASIO;
  225. +     bcopy(&delay, buf + 1, sizeof(int));
  226. +     if (do_write(buf, 5))
  227.          read_reply();
  228.   }
  229. *** casio_slave.c.orig    Wed Jul 24 09:38:36 1991
  230. --- casio_slave.c    Wed Jun 19 10:18:44 1991
  231. ***************
  232. *** 292,297 ****
  233. --- 292,304 ----
  234.             case UNGET_BYTE           : if ((b = getc(commands_in)) != EOF)
  235.                                  unget_byte(b);
  236.                               break;
  237. +           case WAIT_CASIO           : if (fread(&timeout, 1, sizeof(int), commands_in) == sizeof(int)) {
  238. +                                usleep(timeout * 1000);
  239. +                                return_result(NULL);
  240. +                                }
  241. +                             else
  242. +                                return_result("Error reading WAIT_CASIO parameters in Casio slave");
  243. +                             break;
  244.             default                   : return_result("Unknown protocol command: %d", cmd);
  245.                               break;
  246.             }
  247. *** do_load.c.orig    Wed Jul 24 09:38:38 1991
  248. --- do_load.c    Wed Jul 17 15:42:24 1991
  249. ***************
  250. *** 55,66 ****
  251.             xv_set(dialog->casio_source,
  252.                       PANEL_VALUE, casio_file,
  253.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  254. !                     PANEL_NOTIFY_STRING, "\n\r ",
  255.                       PANEL_INACTIVE, TRUE,
  256.                    NULL);
  257.             xv_set(dialog->ascii_source,
  258.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  259. !                     PANEL_NOTIFY_STRING, "\n\r ",
  260.                       PANEL_INACTIVE, TRUE,
  261.                    NULL);
  262.             xv_set(dialog->source, PANEL_VALUE, 0, NULL);
  263. --- 55,66 ----
  264.             xv_set(dialog->casio_source,
  265.                       PANEL_VALUE, casio_file,
  266.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  267. !                     PANEL_NOTIFY_STRING, "\n\r\t ",
  268.                       PANEL_INACTIVE, TRUE,
  269.                    NULL);
  270.             xv_set(dialog->ascii_source,
  271.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  272. !                     PANEL_NOTIFY_STRING, "\n\r\t ",
  273.                       PANEL_INACTIVE, TRUE,
  274.                    NULL);
  275.             xv_set(dialog->source, PANEL_VALUE, 0, NULL);
  276. *** do_schedule.c.orig    Wed Jul 24 09:38:40 1991
  277. --- do_schedule.c    Wed Jul 17 15:42:23 1991
  278. ***************
  279. *** 188,194 ****
  280.             xv_set(dialog->appt_file,
  281.                       PANEL_VALUE, appts_file,
  282.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  283. !                     PANEL_NOTIFY_STRING, "\n\r ",
  284.                       PANEL_INACTIVE, FALSE,
  285.                    NULL);
  286.             xv_set(dialog->schedule_format, PANEL_VALUE, 0, NULL);
  287. --- 188,194 ----
  288.             xv_set(dialog->appt_file,
  289.                       PANEL_VALUE, appts_file,
  290.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  291. !                     PANEL_NOTIFY_STRING, "\n\r\t ",
  292.                       PANEL_INACTIVE, FALSE,
  293.                    NULL);
  294.             xv_set(dialog->schedule_format, PANEL_VALUE, 0, NULL);
  295. *** do_store.c.orig    Wed Jul 24 09:38:41 1991
  296. --- do_store.c    Wed Jul 17 15:42:23 1991
  297. ***************
  298. *** 57,68 ****
  299.             xv_set(dialog->casio_dest,
  300.                       PANEL_VALUE, casio_file,
  301.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  302. !                     PANEL_NOTIFY_STRING, "\n\r ",
  303.                       PANEL_INACTIVE, TRUE,
  304.                    NULL);
  305.             xv_set(dialog->ascii_dest,
  306.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  307. !                     PANEL_NOTIFY_STRING, "\n\r ",
  308.                       PANEL_INACTIVE, TRUE,
  309.                    NULL);
  310.             xv_set(dialog->store_data, PANEL_VALUE, (1 << MAX_OBJECT_KINDS) - 1, NULL);
  311. --- 57,68 ----
  312.             xv_set(dialog->casio_dest,
  313.                       PANEL_VALUE, casio_file,
  314.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  315. !                     PANEL_NOTIFY_STRING, "\n\r\t ",
  316.                       PANEL_INACTIVE, TRUE,
  317.                    NULL);
  318.             xv_set(dialog->ascii_dest,
  319.                       PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
  320. !                     PANEL_NOTIFY_STRING, "\n\r\t ",
  321.                       PANEL_INACTIVE, TRUE,
  322.                    NULL);
  323.             xv_set(dialog->store_data, PANEL_VALUE, (1 << MAX_OBJECT_KINDS) - 1, NULL);
  324. *** filename_completion.c.orig    Wed Jul 24 09:38:42 1991
  325. --- filename_completion.c    Wed Jul 17 15:42:21 1991
  326. ***************
  327. *** 41,47 ****
  328.   
  329.       switch (event_action(event)) {
  330.          case '\n' :
  331. !        case '\r' :
  332.          case ' '  : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
  333.                    window_bell(xv_get(item, XV_OWNER));
  334.                     else
  335. --- 41,47 ----
  336.   
  337.       switch (event_action(event)) {
  338.          case '\n' :
  339. !        case '\r' : 
  340.          case ' '  : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
  341.                    window_bell(xv_get(item, XV_OWNER));
  342.                     else
  343. *** getopt.c.orig    Wed Jul 24 09:38:43 1991
  344. --- getopt.c    Fri May 17 09:10:22 1991
  345. ***************
  346. *** 0 ****
  347. --- 1,64 ----
  348. + /************************************************************************/
  349. + /*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  350. + /*                                    */
  351. + /*    Full ownership of this software, and all rights pertaining to     */
  352. + /*    the for-profit distribution of this software, are retained by     */
  353. + /*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  354. + /*    use this software without fee.  This software is provided "as     */
  355. + /*    is" without express or implied warranty.  You may redistribute     */
  356. + /*    this software, provided that this copyright notice is retained,    */
  357. + /*    and that the software is not distributed for profit.  If you     */
  358. + /*    wish to use this software in a profit-making venture, you must     */
  359. + /*    first license this code and its underlying technology from     */
  360. + /*    Harris Corporation.                         */
  361. + /*                                    */
  362. + /*    Bottom line: you can have this software, you can use it, you     */
  363. + /*    can give it away.  You just can't sell any or all parts of it     */
  364. + /*    without prior permission from Harris Corporation.         */
  365. + /************************************************************************/
  366. + #include    <stdio.h>
  367. + #include    "manifest.h"
  368. + /************************************************************************/
  369. + PRIVATE    delarg(argc, argv)
  370. + int    *argc;
  371. + char    **argv;
  372. + {    char    *p;
  373. +     while (*argv = *(argv+1))
  374. +        argv++;
  375. +     (*argc)--;
  376. + }
  377. + /************************************************************************/
  378. + EXPORT    char    getopt(argc, argv, opts, parm)
  379. + int    *argc;
  380. + char    **argv;
  381. + char    *opts;
  382. + char    **parm;
  383. + {    char    c, *p, *strcpy(), *index();
  384. +     int    killed;
  385. +     *parm = NULL;
  386. +     while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  387. +        argv++;
  388. +     if (*argv == NULL)
  389. +        return(EOF);
  390. +     c = *(*argv+1);
  391. +     *++(*argv) = '-';
  392. +     if (killed = (*(*argv+1) == '\0'))
  393. +        delarg(argc, argv);
  394. +     if ((p = index(opts, c)) == NULL)
  395. +        c = '\0';
  396. +     else if (*(p+1) == ':') {
  397. +        *parm = killed ? *argv : *argv+1;
  398. +        delarg(argc, argv);
  399. +        }
  400. +     return(c);
  401. + }
  402. *** misc.c.orig    Wed Jul 24 09:38:46 1991
  403. --- misc.c    Fri May 17 09:10:00 1991
  404. ***************
  405. *** 117,164 ****
  406.   }
  407.   
  408.   /************************************************************************/
  409. - PRIVATE    delarg(argc, argv)
  410. - int    *argc;
  411. - char    **argv;
  412. - {    char    *p;
  413. -     while (*argv = *(argv+1))
  414. -        argv++;
  415. -     (*argc)--;
  416. - }
  417. - /************************************************************************/
  418. - EXPORT    char    getopt(argc, argv, opts, parm)
  419. - int    *argc;
  420. - char    **argv;
  421. - char    *opts;
  422. - char    **parm;
  423. - {    char    c, *p, *index();
  424. -     int    killed;
  425. -     *parm = NULL;
  426. -     while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
  427. -        argv++;
  428. -     if (*argv == NULL)
  429. -        return(EOF);
  430. -     c = *(*argv+1);
  431. -     *++(*argv) = '-';
  432. -     if (killed = (*(*argv+1) == '\0'))
  433. -        delarg(argc, argv);
  434. -     if ((p = index(opts, c)) == NULL)
  435. -        c = '\0';
  436. -     else if (*(p+1) == ':') {
  437. -        *parm = killed ? *argv : *argv+1;
  438. -        delarg(argc, argv);
  439. -        }
  440. -     return(c);
  441. - }
  442. - /************************************************************************/
  443.   EXPORT    int    is_empty(s)
  444.   
  445.   char    *s;
  446. --- 117,122 ----
  447. *** object.c.orig    Wed Jul 24 09:38:46 1991
  448. --- object.c    Wed Jul 17 15:18:34 1991
  449. ***************
  450. *** 24,29 ****
  451. --- 24,30 ----
  452.   /************************************************************************/
  453.   
  454.   #include    "manifest.h"
  455. + #include    "packet.h"
  456.   #include    "record.h"
  457.   #include    "object.h"
  458.   
  459. ***************
  460. *** 44,52 ****
  461.   
  462.   object    *obj;
  463.   
  464. ! {
  465. !     if (obj->buf)
  466. !        free(obj->buf);
  467.       free(obj);
  468.   }
  469.   
  470. --- 45,55 ----
  471.   
  472.   object    *obj;
  473.   
  474. ! {    int    i;
  475. !     for (i = 0; i < MAX_FIELDS + 1; i++)
  476. !        if (obj->field[i])
  477. !           free(obj->field[i]);
  478.       free(obj);
  479.   }
  480.   
  481. ***************
  482. *** 73,84 ****
  483.   
  484.       obj = create_object();
  485.       obj->kind = OBJ_MEMO;
  486. !     obj->buf = (byte *) malloc(sizeof(byte) * MAX_OBJECT_DATA);
  487. !     strcpy(obj->buf, buf);
  488. !     for (buf = obj->buf; *buf; buf++)
  489.          if (*buf == '\n')
  490.             *buf = '\r';
  491. -     obj->mem_memo = obj->buf;
  492.       return(obj);
  493.   }
  494.   
  495. --- 76,87 ----
  496.   
  497.       obj = create_object();
  498.       obj->kind = OBJ_MEMO;
  499. !     obj->mem_memo = (byte *) strsave(buf);
  500. !     if (strlen(buf) >= MAX_OBJECT_DATA)
  501. !        obj->mem_memo[MAX_OBJECT_DATA] = '\0';
  502. !     for (buf = obj->mem_memo; *buf; buf++)
  503.          if (*buf == '\n')
  504.             *buf = '\r';
  505.       return(obj);
  506.   }
  507.   
  508. ***************
  509. *** 88,94 ****
  510.   record    *rec;
  511.   
  512.   {    object    *obj;
  513. !     byte    *p;
  514.       int    i;
  515.   
  516.       if (rec->type != REC_MODE)
  517. --- 91,97 ----
  518.   record    *rec;
  519.   
  520.   {    object    *obj;
  521. !     byte    *p, buf[MAX_OBJECT_DATA];
  522.       int    i;
  523.   
  524.       if (rec->type != REC_MODE)
  525. ***************
  526. *** 95,109 ****
  527.          return(NULL);
  528.       obj = create_object();
  529.       obj->from_casio = TRUE;
  530.       for ( ; rec; rec = rec->next)
  531.          switch(rec->type) {
  532. !           case REC_DATA     : if (address_kind(rec->address) == REC_DATA_DATA) {
  533. !                            if (obj->buf == NULL) {
  534. !                               obj->buf = (byte *) malloc(sizeof(byte) * MAX_OBJECT_DATA);
  535. !                               bzero(obj->buf, sizeof(byte) * MAX_OBJECT_DATA);
  536. !                               }
  537. !                            bcopy(rec->data, obj->buf + address_start(rec->address), rec->length);
  538. !                            }
  539.                           else if (address_kind(rec->address) == REC_DATA_ALARM) {
  540.                              if (obj->kind == OBJ_SCHEDULE)
  541.                                 ascii_to_time(rec->data, &obj->sch_alarm_time, NULL);
  542. --- 98,108 ----
  543.          return(NULL);
  544.       obj = create_object();
  545.       obj->from_casio = TRUE;
  546. +     bzero(buf, sizeof(buf));
  547.       for ( ; rec; rec = rec->next)
  548.          switch(rec->type) {
  549. !           case REC_DATA     : if (address_kind(rec->address) == REC_DATA_DATA)
  550. !                            bcopy(rec->data, buf + address_start(rec->address), rec->length);
  551.                           else if (address_kind(rec->address) == REC_DATA_ALARM) {
  552.                              if (obj->kind == OBJ_SCHEDULE)
  553.                                 ascii_to_time(rec->data, &obj->sch_alarm_time, NULL);
  554. ***************
  555. *** 177,188 ****
  556.                           free_object(obj);
  557.                           return(NULL);
  558.             }
  559. !     if (obj->buf) {
  560. !        obj->field[0] = obj->buf;
  561. !        for (p = obj->buf, i = 1; *p; p++)
  562.             if (*p == CASIO_END_ENTRY) {
  563.                *p = '\0';
  564. !              obj->field[i++] = p + 1;
  565.                }
  566.          for ( ; i < MAX_FIELDS; i++)
  567.             obj->field[i] = NULL;
  568. --- 176,188 ----
  569.                           free_object(obj);
  570.                           return(NULL);
  571.             }
  572. !     if (*buf) {
  573. !        obj->field[0] = buf;
  574. !        for (p = buf, i = 0; *p; p++)
  575.             if (*p == CASIO_END_ENTRY) {
  576.                *p = '\0';
  577. !              obj->field[i] = (byte *) strsave(obj->field[i]);
  578. !              obj->field[++i] = p + 1;
  579.                }
  580.          for ( ; i < MAX_FIELDS; i++)
  581.             obj->field[i] = NULL;
  582. ***************
  583. *** 199,205 ****
  584.   object    *obj;
  585.   
  586.   {    record    *head, *rec;
  587. !     int    i;
  588.       byte    *p, *q;
  589.   
  590.       head = rec = make_mode_record(0); /* use a dummy mode value */
  591. --- 199,205 ----
  592.   object    *obj;
  593.   
  594.   {    record    *head, *rec;
  595. !     int    i, last, offset;
  596.       byte    *p, *q;
  597.   
  598.       head = rec = make_mode_record(0); /* use a dummy mode value */
  599. ***************
  600. *** 238,268 ****
  601.          free_record(head);
  602.          return(NULL);
  603.          }
  604. !     for (i = 0; i < MAX_FIELDS; i++)
  605. !        if (p = obj->field[i])
  606. !           do {
  607. !              rec->next = create_record();
  608. !              rec = rec->next;
  609. !              rec->type = REC_DATA;
  610. !              if (q = (byte *) index(p, CASIO_END_LINE))
  611. !                 rec->length = q - p + 1;
  612. !              else
  613. !                 rec->length = strlen(p) + 1;
  614. !              rec->address = REC_DATA_DATA + p - obj->buf;
  615. !              bcopy(p, rec->data, rec->length - 1);
  616. !              if (q) {
  617. !                 rec->data[rec->length - 1] = CASIO_END_LINE;
  618. !                 p = q + 1;
  619. !                 }
  620. !              else if (obj->field[i + 1]) {
  621. !                 rec->data[rec->length - 1] = CASIO_END_ENTRY;
  622. !                 p += rec->length - 1;
  623. !                 }
  624. !              else {
  625. !                 rec->length--;
  626. !                 p += rec->length;
  627. !                 }
  628. !              } while (*p);
  629.       rec->next = create_record();
  630.       rec = rec->next;
  631.       rec->length = 0;
  632. --- 238,269 ----
  633.          free_record(head);
  634.          return(NULL);
  635.          }
  636. !     for (last = MAX_FIELDS; last >= 0 && obj->field[last] == NULL; last--)
  637. !        ;
  638. !     for (i = offset = 0; i <= last; i++) {
  639. !        p = obj->field[i];
  640. !        do {
  641. !           rec->next = create_record();
  642. !           rec = rec->next;
  643. !           rec->type = REC_DATA;
  644. !           rec->address = REC_DATA_DATA + offset;
  645. !           if (p == NULL)
  646. !              rec->length = 0;
  647. !           else if (q = (byte *) index(p, CASIO_END_LINE))
  648. !              rec->length = q - p + 1;
  649. !           else
  650. !              rec->length = strlen(p);
  651. !           if (rec->length > 127)
  652. !              rec->length = 127;
  653. !           if (p) {
  654. !              bcopy(p, rec->data, rec->length);
  655. !              p += rec->length;
  656. !              }
  657. !           if ((p == NULL || *p == '\0') && i < last)
  658. !              rec->data[rec->length++] = CASIO_END_ENTRY;
  659. !           offset += rec->length;
  660. !           } while (p && *p);
  661. !        }
  662.       rec->next = create_record();
  663.       rec = rec->next;
  664.       rec->length = 0;
  665. ***************
  666. *** 277,296 ****
  667.   object    *obj;
  668.   
  669.   {    record    *rec, *r;
  670.   
  671. !     rec = object_to_record(obj);
  672. !     if (!send_record(rec))
  673. !        return(FALSE);
  674. !     while (rec) {
  675. !        r = rec;
  676. !        rec = rec->next;
  677. !        free_record(r);
  678.          }
  679. !     if (!wait_for_acknowledgement()) {
  680. !        error("BOSS did not acknowledge receipt of object");
  681. !        return(FALSE);
  682. !        }
  683. !     return(TRUE);
  684.   }
  685.   
  686.   /************************************************************************/
  687. --- 278,305 ----
  688.   object    *obj;
  689.   
  690.   {    record    *rec, *r;
  691. +     int    result, retries;
  692.   
  693. !     for (retries = 4; retries > 0; retries--) {
  694. !        rec = object_to_record(obj);
  695. !        if (!send_record(rec))
  696. !           return(FALSE);
  697. !        while (rec) {
  698. !           r = rec;
  699. !           rec = rec->next;
  700. !           free_record(r);
  701. !           }
  702. !        if ((result = wait_for_acknowledgement()) == OBJECT_RECEIVED)
  703. !           return(TRUE);
  704. !        else if (result == OBJECT_RESEND)
  705. !           wait_casio(3000); /* let's all catch our breath */
  706. !        else {
  707. !           error("BOSS did not acknowledge receipt of object");
  708. !           return(FALSE);
  709. !           }
  710.          }
  711. !     error("Transmission aborted due to repeated failures reported by BOSS");
  712. !     return(FALSE);
  713.   }
  714.   
  715.   /************************************************************************/
  716. *** object.h.orig    Wed Jul 24 09:38:47 1991
  717. --- object.h    Wed Jul 17 10:02:34 1991
  718. ***************
  719. *** 67,73 ****
  720.   
  721.   struct    o_rec    {int    kind;
  722.            int    from_casio;
  723. -          byte    *buf;
  724.            byte    *field[MAX_FIELDS + 1];
  725.            byte    marked;
  726.            date    sch_date;
  727. --- 67,72 ----
  728. *** packet.c.orig    Wed Jul 24 09:38:48 1991
  729. --- packet.c    Wed Jul 17 08:25:59 1991
  730. ***************
  731. *** 25,30 ****
  732. --- 25,31 ----
  733.   
  734.   #include    "manifest.h"
  735.   #include    "casio.h"
  736. + #include    "packet.h"
  737.   
  738.   PRIVATE    int    session_open = FALSE;
  739.   PRIVATE    char    hex[] = "0123456789ABCDEF";
  740. ***************
  741. *** 130,136 ****
  742.                error("error awaiting packet ACK from BOSS");
  743.                return(FALSE);
  744.                }
  745. !           else if (b == '?') {
  746.                disable_flow_control();
  747.                usleep(20000);
  748.                i = read_casio(&b, 1, 1000);
  749. --- 131,137 ----
  750.                error("error awaiting packet ACK from BOSS");
  751.                return(FALSE);
  752.                }
  753. !           else if (b == RCV_ERROR) {
  754.                disable_flow_control();
  755.                usleep(20000);
  756.                i = read_casio(&b, 1, 1000);
  757. ***************
  758. *** 217,226 ****
  759.   
  760.       if (read_casio(&b, 1, 60000) == 1)
  761.          if (b == PACKET_ACK)
  762. !           return(TRUE);
  763.          else
  764.             error("invalid object acknowledgement: %c (%02x)", b, b);
  765.       else
  766.          error("no acknowledgement received from BOSS");
  767. !     return(FALSE);
  768.   }
  769. --- 218,229 ----
  770.   
  771.       if (read_casio(&b, 1, 60000) == 1)
  772.          if (b == PACKET_ACK)
  773. !           return(OBJECT_RECEIVED);
  774. !        else if (b == XMIT_ERROR)
  775. !           return(OBJECT_RESEND);
  776.          else
  777.             error("invalid object acknowledgement: %c (%02x)", b, b);
  778.       else
  779.          error("no acknowledgement received from BOSS");
  780. !     return(OBJECT_ERROR);
  781.   }
  782. *** packet.h.orig    Wed Jul 24 09:38:49 1991
  783. --- packet.h    Wed Jul 17 08:26:01 1991
  784. ***************
  785. *** 35,40 ****
  786. --- 35,44 ----
  787.   #define        PORT_TTYA        0
  788.   #define        PORT_TTYB        1
  789.   
  790. + #define        OBJECT_RECEIVED        0
  791. + #define        OBJECT_RESEND        1
  792. + #define        OBJECT_ERROR        2
  793.   PUBLIC    int    start_session();
  794.   PUBLIC    int    send_packet();
  795.   PUBLIC    int    receive_packet();
  796. *** parse.y.orig    Wed Jul 24 09:38:49 1991
  797. --- parse.y    Wed Jul 17 14:56:06 1991
  798. ***************
  799. *** 79,85 ****
  800.                            parsed_object_list = $2;
  801.                         else
  802.                            $1->next = $2;
  803. -                       fill_fields($2);
  804.                         $$ = $2;
  805.                       }
  806.           ;
  807. --- 79,84 ----
  808. ***************
  809. *** 109,131 ****
  810.   phone_attr    :    marked
  811.                       { curr_object->marked = TRUE; }
  812.           |    name
  813. !                     { add_field(&(curr_object->pho_name), $1); }
  814.           |    number
  815. !                     { add_field(&(curr_object->pho_number), $1); }
  816.           |    address
  817. !                     { add_field(&(curr_object->pho_address), $1); }
  818.           |    extra_1
  819. !                     { add_field(&(curr_object->pho_extra_1), $1); }
  820.           |    extra_2
  821. !                     { add_field(&(curr_object->pho_extra_2), $1); }
  822.           |    extra_3
  823. !                     { add_field(&(curr_object->pho_extra_3), $1); }
  824.           |    extra_4
  825. !                     { add_field(&(curr_object->pho_extra_4), $1); }
  826.           |    extra_5
  827. !                     { add_field(&(curr_object->pho_extra_5), $1); }
  828.           |    extra_6
  829. !                     { add_field(&(curr_object->pho_extra_6), $1); }
  830.           ;
  831.   
  832.   schedule_object    :    LBRACE SCHEDULE
  833. --- 108,130 ----
  834.   phone_attr    :    marked
  835.                       { curr_object->marked = TRUE; }
  836.           |    name
  837. !                     { curr_object->pho_name = (byte *) $1; }
  838.           |    number
  839. !                     { curr_object->pho_number = (byte *) $1; }
  840.           |    address
  841. !                     { curr_object->pho_address = (byte *) $1; }
  842.           |    extra_1
  843. !                     { curr_object->pho_extra_1 = (byte *) $1; }
  844.           |    extra_2
  845. !                     { curr_object->pho_extra_2 = (byte *) $1; }
  846.           |    extra_3
  847. !                     { curr_object->pho_extra_3 = (byte *) $1; }
  848.           |    extra_4
  849. !                     { curr_object->pho_extra_4 = (byte *) $1; }
  850.           |    extra_5
  851. !                     { curr_object->pho_extra_5 = (byte *) $1; }
  852.           |    extra_6
  853. !                     { curr_object->pho_extra_6 = (byte *) $1; }
  854.           ;
  855.   
  856.   schedule_object    :    LBRACE SCHEDULE
  857. ***************
  858. *** 158,164 ****
  859.           |    alarm_time
  860.                       { curr_object->sch_alarm_time = *$1; }
  861.           |    memo
  862. !                     { add_field(&(curr_object->sch_memo), $1); }
  863.           ;
  864.   
  865.   memo_object    :    LBRACE MEMO
  866. --- 157,163 ----
  867.           |    alarm_time
  868.                       { curr_object->sch_alarm_time = *$1; }
  869.           |    memo
  870. !                     { curr_object->sch_memo = (byte *) $1; }
  871.           ;
  872.   
  873.   memo_object    :    LBRACE MEMO
  874. ***************
  875. *** 179,185 ****
  876.   memo_attr    :    marked
  877.                       { curr_object->marked = TRUE; }
  878.           |    memo
  879. !                     { add_field(&(curr_object->sch_memo), $1); }
  880.           ;
  881.   
  882.   card_object    :    LBRACE CARD
  883. --- 178,184 ----
  884.   memo_attr    :    marked
  885.                       { curr_object->marked = TRUE; }
  886.           |    memo
  887. !                     { curr_object->sch_memo = (byte *) $1; }
  888.           ;
  889.   
  890.   card_object    :    LBRACE CARD
  891. ***************
  892. *** 202,236 ****
  893.   card_attr    :    marked
  894.                       { curr_object->marked = TRUE; }
  895.           |    employer
  896. !                     { add_field(&(curr_object->car_employer), $1); }
  897.           |    name
  898. !                     { add_field(&(curr_object->car_name), $1); }
  899.           |    number
  900. !                     { add_field(&(curr_object->car_number), $1); }
  901.           |    position
  902. !                     { add_field(&(curr_object->car_position), $1); }
  903.           |    department
  904. !                     { add_field(&(curr_object->car_department), $1); }
  905.           |    pobox
  906. !                     { add_field(&(curr_object->car_pobox), $1); }
  907.           |    address
  908. !                     { add_field(&(curr_object->car_address), $1); }
  909.           |    telex
  910. !                     { add_field(&(curr_object->car_telex), $1); }
  911.           |    fax
  912. !                     { add_field(&(curr_object->car_fax), $1); }
  913.           |    extra_1
  914. !                     { add_field(&(curr_object->car_extra_1), $1); }
  915.           |    extra_2
  916. !                     { add_field(&(curr_object->car_extra_2), $1); }
  917.           |    extra_3
  918. !                     { add_field(&(curr_object->car_extra_3), $1); }
  919.           |    extra_4
  920. !                     { add_field(&(curr_object->car_extra_4), $1); }
  921.           |    extra_5
  922. !                     { add_field(&(curr_object->car_extra_5), $1); }
  923.           |    extra_6
  924. !                     { add_field(&(curr_object->car_extra_6), $1); }
  925.           ;
  926.   
  927.   calendar_object    :    LBRACE CALENDAR
  928. --- 201,235 ----
  929.   card_attr    :    marked
  930.                       { curr_object->marked = TRUE; }
  931.           |    employer
  932. !                     { curr_object->car_employer = (byte *) $1; }
  933.           |    name
  934. !                     { curr_object->car_name = (byte *) $1; }
  935.           |    number
  936. !                     { curr_object->car_number = (byte *) $1; }
  937.           |    position
  938. !                     { curr_object->car_position = (byte *) $1; }
  939.           |    department
  940. !                     { curr_object->car_department = (byte *) $1; }
  941.           |    pobox
  942. !                     { curr_object->car_pobox = (byte *) $1; }
  943.           |    address
  944. !                     { curr_object->car_address = (byte *) $1; }
  945.           |    telex
  946. !                     { curr_object->car_telex = (byte *) $1; }
  947.           |    fax
  948. !                     { curr_object->car_fax = (byte *) $1; }
  949.           |    extra_1
  950. !                     { curr_object->car_extra_1 = (byte *) $1; }
  951.           |    extra_2
  952. !                     { curr_object->car_extra_2 = (byte *) $1; }
  953.           |    extra_3
  954. !                     { curr_object->car_extra_3 = (byte *) $1; }
  955.           |    extra_4
  956. !                     { curr_object->car_extra_4 = (byte *) $1; }
  957.           |    extra_5
  958. !                     { curr_object->car_extra_5 = (byte *) $1; }
  959.           |    extra_6
  960. !                     { curr_object->car_extra_6 = (byte *) $1; }
  961.           ;
  962.   
  963.   calendar_object    :    LBRACE CALENDAR
  964. ***************
  965. *** 400,449 ****
  966.       error(buf1);
  967.       yyclearin;
  968.       parse_errors_occured++;
  969. - }
  970. - /************************************************************************/
  971. - PRIVATE    add_field(field, value)
  972. - byte    **field;
  973. - byte    *value;
  974. - {    byte    *p;
  975. -     if (*field)
  976. -        yyerror("duplicate value for this field");
  977. -     if (value == NULL || *value == '\0')
  978. -        return;
  979. -     if (curr_object->buf == NULL) {
  980. -        curr_object->buf = (byte *) malloc(MAX_OBJECT_DATA);
  981. -        bzero(curr_object->buf, MAX_OBJECT_DATA);
  982. -        }
  983. -     for (p = curr_object->buf + MAX_OBJECT_DATA - 1; p > curr_object->buf && *p == '\0'; p--)
  984. -        ;
  985. -     if (*p)
  986. -        p += 2;
  987. -     if (p + strlen(value) >= curr_object->buf + MAX_OBJECT_DATA) {
  988. -        yyerror("too much data for this object");
  989. -        *field = NULL;
  990. -        }
  991. -     else {
  992. -        strcpy(p, value);
  993. -        *field = p;
  994. -        }
  995. - }
  996. - /************************************************************************/
  997. - PRIVATE    fill_fields(obj)
  998. - object    *obj;
  999. - {    int    i;
  1000. -     for (i = MAX_FIELDS - 1; i >= 0; i--)
  1001. -        if (obj->field[i])
  1002. -           for (i--; i >= 0; i--)
  1003. -              if (obj->field[i] == NULL)
  1004. -                 add_field(&(obj->field[i]), "");
  1005.   }
  1006.   
  1007.   #include "lex.c"
  1008. --- 399,404 ----
  1009. *** patchlevel.h.orig    Wed Jul 24 09:38:50 1991
  1010. --- patchlevel.h    Wed Jul 24 09:34:28 1991
  1011. ***************
  1012. *** 19,33 ****
  1013.   
  1014.   /************************************************************************/
  1015.   /*                                    */
  1016. ! /*    0    15 Oct 90    Initial release                */
  1017. ! /*                comp.sources.x: Volume 10, Issues 3-8    */
  1018.   /*                                    */
  1019. ! /*    1     1 Dec 90    Restructured code for maintainability    */
  1020.   /*                Added "About Boss..."            */
  1021.   /*                Added warning about downloads at 9600    */
  1022.   /*                   baud                    */
  1023.   /*                                    */
  1024. ! /*    2    15 Jan 91    Fixed bug in storing marked records    */
  1025.   /*                Enhanced dialog placement        */
  1026.   /*                                    */
  1027.   /************************************************************************/
  1028. --- 19,40 ----
  1029.   
  1030.   /************************************************************************/
  1031.   /*                                    */
  1032. ! /*    0    15 Oct 90    comp.sources.x: Volume 10, Issues 3-8    */
  1033. ! /*                Initial release                */
  1034.   /*                                    */
  1035. ! /*    1     1 Dec 90    comp.sources.x: Volume 10, Issue 91    */
  1036. ! /*                Restructured code for maintainability    */
  1037.   /*                Added "About Boss..."            */
  1038.   /*                Added warning about downloads at 9600    */
  1039.   /*                   baud                    */
  1040.   /*                                    */
  1041. ! /*    2    15 Jan 91    comp.sources.x: Volume 11, Issue 4    */
  1042. ! /*                Fixed bug in storing marked records    */
  1043.   /*                Enhanced dialog placement        */
  1044. + /*                                    */
  1045. + /*    3    24 Jul 91    comp.sources.x: Volume ??, Issue ??    */
  1046. + /*                Fixed unget_byte bug            */
  1047. + /*                Added transmission delay support    */
  1048. + /*                Fixed bug in object field management    */
  1049.   /*                                    */
  1050.   /************************************************************************/
  1051. *** protocol.h.orig    Wed Jul 24 09:38:53 1991
  1052. --- protocol.h    Wed Jun 19 10:18:46 1991
  1053. ***************
  1054. *** 31,33 ****
  1055. --- 31,34 ----
  1056.   #define        DISABLE_FLOW_CONTROL    5
  1057.   #define        FLUSH_CASIO        6
  1058.   #define        UNGET_BYTE        7
  1059. + #define        WAIT_CASIO        8
  1060.