home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume14
/
boss
/
patch3
/
patch
Wrap
Text File
|
1991-08-26
|
32KB
|
1,091 lines
*** Makefile.orig Wed Jul 24 09:38:23 1991
--- Makefile Fri May 17 09:10:01 1991
***************
*** 22,28 ****
OFILES = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
! expand.o filename_completion.o list_misc.o misc.o object.o packet.o \
parse.o pinned_menu_notify.o place_dialog.o print.o \
record.o send_mail.o window_misc.o
--- 22,28 ----
OFILES = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
! expand.o filename_completion.o getopt.o list_misc.o misc.o object.o packet.o \
parse.o pinned_menu_notify.o place_dialog.o print.o \
record.o send_mail.o window_misc.o
*** README.orig Wed Jul 24 09:38:25 1991
--- README Wed Jul 24 09:36:03 1991
***************
*** 17,23 ****
/* without prior permission from Harris Corporation. */
/************************************************************************/
! Boss Version 1.0
Boss lets Casio BOSS users transfer data between their BOSS and
a workstation. Users can also convert BOSS schedule items to formats useful
--- 17,23 ----
/* without prior permission from Harris Corporation. */
/************************************************************************/
! Boss Version 1.0c
Boss lets Casio BOSS users transfer data between their BOSS and
a workstation. Users can also convert BOSS schedule items to formats useful
*** Imakefile.orig Wed Jul 24 09:38:25 1991
--- Imakefile Fri May 17 09:10:01 1991
***************
*** 12,24 ****
SRCS = about.c boss.c boss_ui.c busy.c calentool.c casio_master.c casio_slave.c \
database.c do_clear.c do_load.c do_port.c do_schedule.c do_store.c \
! expand.c filename_completion.c list_misc.c misc.c object.c packet.c \
parse.y pinned_menu_notify.c place_dialog.c print.c \
record.c send_mail.c window_misc.c
OBJS = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
! expand.o filename_completion.o list_misc.o misc.o object.o packet.o \
parse.o pinned_menu_notify.o place_dialog.o print.o \
record.o send_mail.o window_misc.o
--- 12,24 ----
SRCS = about.c boss.c boss_ui.c busy.c calentool.c casio_master.c casio_slave.c \
database.c do_clear.c do_load.c do_port.c do_schedule.c do_store.c \
! expand.c filename_completion.c getopt.c list_misc.c misc.c object.c packet.c \
parse.y pinned_menu_notify.c place_dialog.c print.c \
record.c send_mail.c window_misc.c
OBJS = about.o boss.o boss_ui.o busy.o calentool.o casio_master.o casio_slave.o \
database.o do_clear.o do_load.o do_port.o do_schedule.o do_store.o \
! expand.o filename_completion.o getopt.o list_misc.o misc.o object.o packet.o \
parse.o pinned_menu_notify.o place_dialog.o print.o \
record.o send_mail.o window_misc.o
*** boss.man.orig Wed Jul 24 09:38:26 1991
--- boss.man Wed Mar 27 07:27:30 1991
***************
*** 75,82 ****
The text fields associated with \*(lqCasio-format file\*(rq and \*(lqASCII text file\*(rq
provide file name completion, like \f2csh\fP(1), by typing
a space or carriage return.
! .IP "\fBFile: Save Data...\fP"
! brings up the \fBSave Data\fP dialog box. This dialog contains a non-exclusive
setting labeled \*(lqStore items\*(rq that lets you choose which items are to
be stored. Only those items selected in this setting will be written to the
destination selected.
--- 75,82 ----
The text fields associated with \*(lqCasio-format file\*(rq and \*(lqASCII text file\*(rq
provide file name completion, like \f2csh\fP(1), by typing
a space or carriage return.
! .IP "\fBFile: Store Data...\fP"
! brings up the \fBStore Data\fP dialog box. This dialog contains a non-exclusive
setting labeled \*(lqStore items\*(rq that lets you choose which items are to
be stored. Only those items selected in this setting will be written to the
destination selected.
*** boss_ui.c.orig Wed Jul 24 09:38:29 1991
--- boss_ui.c Wed Jul 24 09:38:17 1991
***************
*** 103,109 ****
XV_KEY_DATA, INSTANCE, ip,
MENU_ITEM,
XV_KEY_DATA, INSTANCE, ip,
! MENU_STRING, "Port properties...",
MENU_GEN_PROC, port_dialog,
NULL,
MENU_DEFAULT, 2,
--- 103,109 ----
XV_KEY_DATA, INSTANCE, ip,
MENU_ITEM,
XV_KEY_DATA, INSTANCE, ip,
! MENU_STRING, "Port Properties...",
MENU_GEN_PROC, port_dialog,
NULL,
MENU_DEFAULT, 2,
***************
*** 192,198 ****
XV_KEY_DATA, INSTANCE, ip,
XV_WIDTH, 256,
XV_HEIGHT, 88,
! XV_LABEL, "Boss 1.0b",
FRAME_CLOSED, FALSE,
FRAME_SHOW_FOOTER, FALSE,
FRAME_SHOW_RESIZE_CORNER, FALSE,
--- 192,198 ----
XV_KEY_DATA, INSTANCE, ip,
XV_WIDTH, 256,
XV_HEIGHT, 88,
! XV_LABEL, "Boss 1.0c",
FRAME_CLOSED, FALSE,
FRAME_SHOW_FOOTER, FALSE,
FRAME_SHOW_RESIZE_CORNER, FALSE,
***************
*** 1658,1666 ****
XV_HELP_DATA, "boss:msg_1",
XV_X, 222,
XV_Y, 14,
! XV_WIDTH, 66,
XV_HEIGHT, 13,
! PANEL_LABEL_STRING, "Boss 1.0b",
PANEL_LABEL_BOLD, TRUE,
NULL);
return obj;
--- 1658,1666 ----
XV_HELP_DATA, "boss:msg_1",
XV_X, 222,
XV_Y, 14,
! XV_WIDTH, 64,
XV_HEIGHT, 13,
! PANEL_LABEL_STRING, "Boss 1.0c",
PANEL_LABEL_BOLD, TRUE,
NULL);
return obj;
***************
*** 2063,2073 ****
obj = xv_create(owner, PANEL_BUTTON,
XV_KEY_DATA, INSTANCE, ip,
XV_HELP_DATA, "boss:send_mail",
! XV_X, 215,
XV_Y, 352,
! XV_WIDTH, 78,
XV_HEIGHT, 20,
! PANEL_LABEL_STRING, "Send Mail",
PANEL_NOTIFY_PROC, popup_send_mail,
NULL);
return obj;
--- 2063,2073 ----
obj = xv_create(owner, PANEL_BUTTON,
XV_KEY_DATA, INSTANCE, ip,
XV_HELP_DATA, "boss:send_mail",
! XV_X, 210,
XV_Y, 352,
! XV_WIDTH, 87,
XV_HEIGHT, 20,
! PANEL_LABEL_STRING, "Send Mail...",
PANEL_NOTIFY_PROC, popup_send_mail,
NULL);
return obj;
*** casio.h.orig Wed Jul 24 09:38:34 1991
--- casio.h Wed Jul 17 08:26:00 1991
***************
*** 24,33 ****
/************************************************************************/
#define PACKET_START ':'
! #define XMIT_TERMINATE '!'
! #define RCV_ERROR '"'
! #define PACKET_ACK '#'
! #define MODE_ERROR '$'
PUBLIC int open_casio();
PUBLIC int read_casio();
--- 24,34 ----
/************************************************************************/
#define PACKET_START ':'
! #define XMIT_TERMINATE 0x21
! #define RCV_ERROR 0x22
! #define PACKET_ACK 0x23
! #define MODE_ERROR 0x24
! #define XMIT_ERROR 0x3f
PUBLIC int open_casio();
PUBLIC int read_casio();
*** casio_master.c.orig Wed Jul 24 09:38:35 1991
--- casio_master.c Wed Jun 19 10:18:45 1991
***************
*** 220,227 ****
byte b;
{
! buf[0] = FLUSH_CASIO;
buf[1] = b;
if (do_write(buf, 2))
read_reply();
}
--- 220,239 ----
byte b;
{
! buf[0] = UNGET_BYTE;
buf[1] = b;
if (do_write(buf, 2))
+ read_reply();
+ }
+
+ /************************************************************************/
+ EXPORT wait_casio(delay)
+
+ int delay;
+
+ {
+ buf[0] = WAIT_CASIO;
+ bcopy(&delay, buf + 1, sizeof(int));
+ if (do_write(buf, 5))
read_reply();
}
*** casio_slave.c.orig Wed Jul 24 09:38:36 1991
--- casio_slave.c Wed Jun 19 10:18:44 1991
***************
*** 292,297 ****
--- 292,304 ----
case UNGET_BYTE : if ((b = getc(commands_in)) != EOF)
unget_byte(b);
break;
+ case WAIT_CASIO : if (fread(&timeout, 1, sizeof(int), commands_in) == sizeof(int)) {
+ usleep(timeout * 1000);
+ return_result(NULL);
+ }
+ else
+ return_result("Error reading WAIT_CASIO parameters in Casio slave");
+ break;
default : return_result("Unknown protocol command: %d", cmd);
break;
}
*** do_load.c.orig Wed Jul 24 09:38:38 1991
--- do_load.c Wed Jul 17 15:42:24 1991
***************
*** 55,66 ****
xv_set(dialog->casio_source,
PANEL_VALUE, casio_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->ascii_source,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->source, PANEL_VALUE, 0, NULL);
--- 55,66 ----
xv_set(dialog->casio_source,
PANEL_VALUE, casio_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r\t ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->ascii_source,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r\t ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->source, PANEL_VALUE, 0, NULL);
*** do_schedule.c.orig Wed Jul 24 09:38:40 1991
--- do_schedule.c Wed Jul 17 15:42:23 1991
***************
*** 188,194 ****
xv_set(dialog->appt_file,
PANEL_VALUE, appts_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r ",
PANEL_INACTIVE, FALSE,
NULL);
xv_set(dialog->schedule_format, PANEL_VALUE, 0, NULL);
--- 188,194 ----
xv_set(dialog->appt_file,
PANEL_VALUE, appts_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r\t ",
PANEL_INACTIVE, FALSE,
NULL);
xv_set(dialog->schedule_format, PANEL_VALUE, 0, NULL);
*** do_store.c.orig Wed Jul 24 09:38:41 1991
--- do_store.c Wed Jul 17 15:42:23 1991
***************
*** 57,68 ****
xv_set(dialog->casio_dest,
PANEL_VALUE, casio_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->ascii_dest,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->store_data, PANEL_VALUE, (1 << MAX_OBJECT_KINDS) - 1, NULL);
--- 57,68 ----
xv_set(dialog->casio_dest,
PANEL_VALUE, casio_file,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r\t ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->ascii_dest,
PANEL_NOTIFY_LEVEL, PANEL_SPECIFIED,
! PANEL_NOTIFY_STRING, "\n\r\t ",
PANEL_INACTIVE, TRUE,
NULL);
xv_set(dialog->store_data, PANEL_VALUE, (1 << MAX_OBJECT_KINDS) - 1, NULL);
*** filename_completion.c.orig Wed Jul 24 09:38:42 1991
--- filename_completion.c Wed Jul 17 15:42:21 1991
***************
*** 41,47 ****
switch (event_action(event)) {
case '\n' :
! case '\r' :
case ' ' : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
window_bell(xv_get(item, XV_OWNER));
else
--- 41,47 ----
switch (event_action(event)) {
case '\n' :
! case '\r' :
case ' ' : if ((p = expand_filename((char *) xv_get(item, PANEL_VALUE))) == NULL)
window_bell(xv_get(item, XV_OWNER));
else
*** getopt.c.orig Wed Jul 24 09:38:43 1991
--- getopt.c Fri May 17 09:10:22 1991
***************
*** 0 ****
--- 1,64 ----
+ /************************************************************************/
+ /* Copyright 1987-1991 by Chuck Musciano and Harris Corporation */
+ /* */
+ /* Full ownership of this software, and all rights pertaining to */
+ /* the for-profit distribution of this software, are retained by */
+ /* Chuck Musciano and Harris Corporation. You are permitted to */
+ /* use this software without fee. This software is provided "as */
+ /* is" without express or implied warranty. You may redistribute */
+ /* this software, provided that this copyright notice is retained, */
+ /* and that the software is not distributed for profit. If you */
+ /* wish to use this software in a profit-making venture, you must */
+ /* first license this code and its underlying technology from */
+ /* Harris Corporation. */
+ /* */
+ /* Bottom line: you can have this software, you can use it, you */
+ /* can give it away. You just can't sell any or all parts of it */
+ /* without prior permission from Harris Corporation. */
+ /************************************************************************/
+
+ #include <stdio.h>
+
+ #include "manifest.h"
+
+ /************************************************************************/
+ PRIVATE delarg(argc, argv)
+
+ int *argc;
+ char **argv;
+
+ { char *p;
+
+ while (*argv = *(argv+1))
+ argv++;
+ (*argc)--;
+ }
+
+ /************************************************************************/
+ EXPORT char getopt(argc, argv, opts, parm)
+
+ int *argc;
+ char **argv;
+ char *opts;
+ char **parm;
+
+ { char c, *p, *strcpy(), *index();
+ int killed;
+
+ *parm = NULL;
+ while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
+ argv++;
+ if (*argv == NULL)
+ return(EOF);
+ c = *(*argv+1);
+ *++(*argv) = '-';
+ if (killed = (*(*argv+1) == '\0'))
+ delarg(argc, argv);
+ if ((p = index(opts, c)) == NULL)
+ c = '\0';
+ else if (*(p+1) == ':') {
+ *parm = killed ? *argv : *argv+1;
+ delarg(argc, argv);
+ }
+ return(c);
+ }
*** misc.c.orig Wed Jul 24 09:38:46 1991
--- misc.c Fri May 17 09:10:00 1991
***************
*** 117,164 ****
}
/************************************************************************/
- PRIVATE delarg(argc, argv)
-
- int *argc;
- char **argv;
-
- { char *p;
-
- while (*argv = *(argv+1))
- argv++;
- (*argc)--;
- }
-
- /************************************************************************/
- EXPORT char getopt(argc, argv, opts, parm)
-
- int *argc;
- char **argv;
- char *opts;
- char **parm;
-
- { char c, *p, *index();
- int killed;
-
- *parm = NULL;
- while (*argv && ((**argv != '-') || (*(*argv+1) == '\0')))
- argv++;
- if (*argv == NULL)
- return(EOF);
- c = *(*argv+1);
- *++(*argv) = '-';
- if (killed = (*(*argv+1) == '\0'))
- delarg(argc, argv);
- if ((p = index(opts, c)) == NULL)
- c = '\0';
- else if (*(p+1) == ':') {
- *parm = killed ? *argv : *argv+1;
- delarg(argc, argv);
- }
- return(c);
- }
-
- /************************************************************************/
EXPORT int is_empty(s)
char *s;
--- 117,122 ----
*** object.c.orig Wed Jul 24 09:38:46 1991
--- object.c Wed Jul 17 15:18:34 1991
***************
*** 24,29 ****
--- 24,30 ----
/************************************************************************/
#include "manifest.h"
+ #include "packet.h"
#include "record.h"
#include "object.h"
***************
*** 44,52 ****
object *obj;
! {
! if (obj->buf)
! free(obj->buf);
free(obj);
}
--- 45,55 ----
object *obj;
! { int i;
!
! for (i = 0; i < MAX_FIELDS + 1; i++)
! if (obj->field[i])
! free(obj->field[i]);
free(obj);
}
***************
*** 73,84 ****
obj = create_object();
obj->kind = OBJ_MEMO;
! obj->buf = (byte *) malloc(sizeof(byte) * MAX_OBJECT_DATA);
! strcpy(obj->buf, buf);
! for (buf = obj->buf; *buf; buf++)
if (*buf == '\n')
*buf = '\r';
- obj->mem_memo = obj->buf;
return(obj);
}
--- 76,87 ----
obj = create_object();
obj->kind = OBJ_MEMO;
! obj->mem_memo = (byte *) strsave(buf);
! if (strlen(buf) >= MAX_OBJECT_DATA)
! obj->mem_memo[MAX_OBJECT_DATA] = '\0';
! for (buf = obj->mem_memo; *buf; buf++)
if (*buf == '\n')
*buf = '\r';
return(obj);
}
***************
*** 88,94 ****
record *rec;
{ object *obj;
! byte *p;
int i;
if (rec->type != REC_MODE)
--- 91,97 ----
record *rec;
{ object *obj;
! byte *p, buf[MAX_OBJECT_DATA];
int i;
if (rec->type != REC_MODE)
***************
*** 95,109 ****
return(NULL);
obj = create_object();
obj->from_casio = TRUE;
for ( ; rec; rec = rec->next)
switch(rec->type) {
! case REC_DATA : if (address_kind(rec->address) == REC_DATA_DATA) {
! if (obj->buf == NULL) {
! obj->buf = (byte *) malloc(sizeof(byte) * MAX_OBJECT_DATA);
! bzero(obj->buf, sizeof(byte) * MAX_OBJECT_DATA);
! }
! bcopy(rec->data, obj->buf + address_start(rec->address), rec->length);
! }
else if (address_kind(rec->address) == REC_DATA_ALARM) {
if (obj->kind == OBJ_SCHEDULE)
ascii_to_time(rec->data, &obj->sch_alarm_time, NULL);
--- 98,108 ----
return(NULL);
obj = create_object();
obj->from_casio = TRUE;
+ bzero(buf, sizeof(buf));
for ( ; rec; rec = rec->next)
switch(rec->type) {
! case REC_DATA : if (address_kind(rec->address) == REC_DATA_DATA)
! bcopy(rec->data, buf + address_start(rec->address), rec->length);
else if (address_kind(rec->address) == REC_DATA_ALARM) {
if (obj->kind == OBJ_SCHEDULE)
ascii_to_time(rec->data, &obj->sch_alarm_time, NULL);
***************
*** 177,188 ****
free_object(obj);
return(NULL);
}
! if (obj->buf) {
! obj->field[0] = obj->buf;
! for (p = obj->buf, i = 1; *p; p++)
if (*p == CASIO_END_ENTRY) {
*p = '\0';
! obj->field[i++] = p + 1;
}
for ( ; i < MAX_FIELDS; i++)
obj->field[i] = NULL;
--- 176,188 ----
free_object(obj);
return(NULL);
}
! if (*buf) {
! obj->field[0] = buf;
! for (p = buf, i = 0; *p; p++)
if (*p == CASIO_END_ENTRY) {
*p = '\0';
! obj->field[i] = (byte *) strsave(obj->field[i]);
! obj->field[++i] = p + 1;
}
for ( ; i < MAX_FIELDS; i++)
obj->field[i] = NULL;
***************
*** 199,205 ****
object *obj;
{ record *head, *rec;
! int i;
byte *p, *q;
head = rec = make_mode_record(0); /* use a dummy mode value */
--- 199,205 ----
object *obj;
{ record *head, *rec;
! int i, last, offset;
byte *p, *q;
head = rec = make_mode_record(0); /* use a dummy mode value */
***************
*** 238,268 ****
free_record(head);
return(NULL);
}
! for (i = 0; i < MAX_FIELDS; i++)
! if (p = obj->field[i])
! do {
! rec->next = create_record();
! rec = rec->next;
! rec->type = REC_DATA;
! if (q = (byte *) index(p, CASIO_END_LINE))
! rec->length = q - p + 1;
! else
! rec->length = strlen(p) + 1;
! rec->address = REC_DATA_DATA + p - obj->buf;
! bcopy(p, rec->data, rec->length - 1);
! if (q) {
! rec->data[rec->length - 1] = CASIO_END_LINE;
! p = q + 1;
! }
! else if (obj->field[i + 1]) {
! rec->data[rec->length - 1] = CASIO_END_ENTRY;
! p += rec->length - 1;
! }
! else {
! rec->length--;
! p += rec->length;
! }
! } while (*p);
rec->next = create_record();
rec = rec->next;
rec->length = 0;
--- 238,269 ----
free_record(head);
return(NULL);
}
! for (last = MAX_FIELDS; last >= 0 && obj->field[last] == NULL; last--)
! ;
! for (i = offset = 0; i <= last; i++) {
! p = obj->field[i];
! do {
! rec->next = create_record();
! rec = rec->next;
! rec->type = REC_DATA;
! rec->address = REC_DATA_DATA + offset;
! if (p == NULL)
! rec->length = 0;
! else if (q = (byte *) index(p, CASIO_END_LINE))
! rec->length = q - p + 1;
! else
! rec->length = strlen(p);
! if (rec->length > 127)
! rec->length = 127;
! if (p) {
! bcopy(p, rec->data, rec->length);
! p += rec->length;
! }
! if ((p == NULL || *p == '\0') && i < last)
! rec->data[rec->length++] = CASIO_END_ENTRY;
! offset += rec->length;
! } while (p && *p);
! }
rec->next = create_record();
rec = rec->next;
rec->length = 0;
***************
*** 277,296 ****
object *obj;
{ record *rec, *r;
! rec = object_to_record(obj);
! if (!send_record(rec))
! return(FALSE);
! while (rec) {
! r = rec;
! rec = rec->next;
! free_record(r);
}
! if (!wait_for_acknowledgement()) {
! error("BOSS did not acknowledge receipt of object");
! return(FALSE);
! }
! return(TRUE);
}
/************************************************************************/
--- 278,305 ----
object *obj;
{ record *rec, *r;
+ int result, retries;
! for (retries = 4; retries > 0; retries--) {
! rec = object_to_record(obj);
! if (!send_record(rec))
! return(FALSE);
! while (rec) {
! r = rec;
! rec = rec->next;
! free_record(r);
! }
! if ((result = wait_for_acknowledgement()) == OBJECT_RECEIVED)
! return(TRUE);
! else if (result == OBJECT_RESEND)
! wait_casio(3000); /* let's all catch our breath */
! else {
! error("BOSS did not acknowledge receipt of object");
! return(FALSE);
! }
}
! error("Transmission aborted due to repeated failures reported by BOSS");
! return(FALSE);
}
/************************************************************************/
*** object.h.orig Wed Jul 24 09:38:47 1991
--- object.h Wed Jul 17 10:02:34 1991
***************
*** 67,73 ****
struct o_rec {int kind;
int from_casio;
- byte *buf;
byte *field[MAX_FIELDS + 1];
byte marked;
date sch_date;
--- 67,72 ----
*** packet.c.orig Wed Jul 24 09:38:48 1991
--- packet.c Wed Jul 17 08:25:59 1991
***************
*** 25,30 ****
--- 25,31 ----
#include "manifest.h"
#include "casio.h"
+ #include "packet.h"
PRIVATE int session_open = FALSE;
PRIVATE char hex[] = "0123456789ABCDEF";
***************
*** 130,136 ****
error("error awaiting packet ACK from BOSS");
return(FALSE);
}
! else if (b == '?') {
disable_flow_control();
usleep(20000);
i = read_casio(&b, 1, 1000);
--- 131,137 ----
error("error awaiting packet ACK from BOSS");
return(FALSE);
}
! else if (b == RCV_ERROR) {
disable_flow_control();
usleep(20000);
i = read_casio(&b, 1, 1000);
***************
*** 217,226 ****
if (read_casio(&b, 1, 60000) == 1)
if (b == PACKET_ACK)
! return(TRUE);
else
error("invalid object acknowledgement: %c (%02x)", b, b);
else
error("no acknowledgement received from BOSS");
! return(FALSE);
}
--- 218,229 ----
if (read_casio(&b, 1, 60000) == 1)
if (b == PACKET_ACK)
! return(OBJECT_RECEIVED);
! else if (b == XMIT_ERROR)
! return(OBJECT_RESEND);
else
error("invalid object acknowledgement: %c (%02x)", b, b);
else
error("no acknowledgement received from BOSS");
! return(OBJECT_ERROR);
}
*** packet.h.orig Wed Jul 24 09:38:49 1991
--- packet.h Wed Jul 17 08:26:01 1991
***************
*** 35,40 ****
--- 35,44 ----
#define PORT_TTYA 0
#define PORT_TTYB 1
+ #define OBJECT_RECEIVED 0
+ #define OBJECT_RESEND 1
+ #define OBJECT_ERROR 2
+
PUBLIC int start_session();
PUBLIC int send_packet();
PUBLIC int receive_packet();
*** parse.y.orig Wed Jul 24 09:38:49 1991
--- parse.y Wed Jul 17 14:56:06 1991
***************
*** 79,85 ****
parsed_object_list = $2;
else
$1->next = $2;
- fill_fields($2);
$$ = $2;
}
;
--- 79,84 ----
***************
*** 109,131 ****
phone_attr : marked
{ curr_object->marked = TRUE; }
| name
! { add_field(&(curr_object->pho_name), $1); }
| number
! { add_field(&(curr_object->pho_number), $1); }
| address
! { add_field(&(curr_object->pho_address), $1); }
| extra_1
! { add_field(&(curr_object->pho_extra_1), $1); }
| extra_2
! { add_field(&(curr_object->pho_extra_2), $1); }
| extra_3
! { add_field(&(curr_object->pho_extra_3), $1); }
| extra_4
! { add_field(&(curr_object->pho_extra_4), $1); }
| extra_5
! { add_field(&(curr_object->pho_extra_5), $1); }
| extra_6
! { add_field(&(curr_object->pho_extra_6), $1); }
;
schedule_object : LBRACE SCHEDULE
--- 108,130 ----
phone_attr : marked
{ curr_object->marked = TRUE; }
| name
! { curr_object->pho_name = (byte *) $1; }
| number
! { curr_object->pho_number = (byte *) $1; }
| address
! { curr_object->pho_address = (byte *) $1; }
| extra_1
! { curr_object->pho_extra_1 = (byte *) $1; }
| extra_2
! { curr_object->pho_extra_2 = (byte *) $1; }
| extra_3
! { curr_object->pho_extra_3 = (byte *) $1; }
| extra_4
! { curr_object->pho_extra_4 = (byte *) $1; }
| extra_5
! { curr_object->pho_extra_5 = (byte *) $1; }
| extra_6
! { curr_object->pho_extra_6 = (byte *) $1; }
;
schedule_object : LBRACE SCHEDULE
***************
*** 158,164 ****
| alarm_time
{ curr_object->sch_alarm_time = *$1; }
| memo
! { add_field(&(curr_object->sch_memo), $1); }
;
memo_object : LBRACE MEMO
--- 157,163 ----
| alarm_time
{ curr_object->sch_alarm_time = *$1; }
| memo
! { curr_object->sch_memo = (byte *) $1; }
;
memo_object : LBRACE MEMO
***************
*** 179,185 ****
memo_attr : marked
{ curr_object->marked = TRUE; }
| memo
! { add_field(&(curr_object->sch_memo), $1); }
;
card_object : LBRACE CARD
--- 178,184 ----
memo_attr : marked
{ curr_object->marked = TRUE; }
| memo
! { curr_object->sch_memo = (byte *) $1; }
;
card_object : LBRACE CARD
***************
*** 202,236 ****
card_attr : marked
{ curr_object->marked = TRUE; }
| employer
! { add_field(&(curr_object->car_employer), $1); }
| name
! { add_field(&(curr_object->car_name), $1); }
| number
! { add_field(&(curr_object->car_number), $1); }
| position
! { add_field(&(curr_object->car_position), $1); }
| department
! { add_field(&(curr_object->car_department), $1); }
| pobox
! { add_field(&(curr_object->car_pobox), $1); }
| address
! { add_field(&(curr_object->car_address), $1); }
| telex
! { add_field(&(curr_object->car_telex), $1); }
| fax
! { add_field(&(curr_object->car_fax), $1); }
| extra_1
! { add_field(&(curr_object->car_extra_1), $1); }
| extra_2
! { add_field(&(curr_object->car_extra_2), $1); }
| extra_3
! { add_field(&(curr_object->car_extra_3), $1); }
| extra_4
! { add_field(&(curr_object->car_extra_4), $1); }
| extra_5
! { add_field(&(curr_object->car_extra_5), $1); }
| extra_6
! { add_field(&(curr_object->car_extra_6), $1); }
;
calendar_object : LBRACE CALENDAR
--- 201,235 ----
card_attr : marked
{ curr_object->marked = TRUE; }
| employer
! { curr_object->car_employer = (byte *) $1; }
| name
! { curr_object->car_name = (byte *) $1; }
| number
! { curr_object->car_number = (byte *) $1; }
| position
! { curr_object->car_position = (byte *) $1; }
| department
! { curr_object->car_department = (byte *) $1; }
| pobox
! { curr_object->car_pobox = (byte *) $1; }
| address
! { curr_object->car_address = (byte *) $1; }
| telex
! { curr_object->car_telex = (byte *) $1; }
| fax
! { curr_object->car_fax = (byte *) $1; }
| extra_1
! { curr_object->car_extra_1 = (byte *) $1; }
| extra_2
! { curr_object->car_extra_2 = (byte *) $1; }
| extra_3
! { curr_object->car_extra_3 = (byte *) $1; }
| extra_4
! { curr_object->car_extra_4 = (byte *) $1; }
| extra_5
! { curr_object->car_extra_5 = (byte *) $1; }
| extra_6
! { curr_object->car_extra_6 = (byte *) $1; }
;
calendar_object : LBRACE CALENDAR
***************
*** 400,449 ****
error(buf1);
yyclearin;
parse_errors_occured++;
- }
-
- /************************************************************************/
- PRIVATE add_field(field, value)
-
- byte **field;
- byte *value;
-
- { byte *p;
-
- if (*field)
- yyerror("duplicate value for this field");
- if (value == NULL || *value == '\0')
- return;
- if (curr_object->buf == NULL) {
- curr_object->buf = (byte *) malloc(MAX_OBJECT_DATA);
- bzero(curr_object->buf, MAX_OBJECT_DATA);
- }
- for (p = curr_object->buf + MAX_OBJECT_DATA - 1; p > curr_object->buf && *p == '\0'; p--)
- ;
- if (*p)
- p += 2;
- if (p + strlen(value) >= curr_object->buf + MAX_OBJECT_DATA) {
- yyerror("too much data for this object");
- *field = NULL;
- }
- else {
- strcpy(p, value);
- *field = p;
- }
- }
-
- /************************************************************************/
- PRIVATE fill_fields(obj)
-
- object *obj;
-
- { int i;
-
- for (i = MAX_FIELDS - 1; i >= 0; i--)
- if (obj->field[i])
- for (i--; i >= 0; i--)
- if (obj->field[i] == NULL)
- add_field(&(obj->field[i]), "");
}
#include "lex.c"
--- 399,404 ----
*** patchlevel.h.orig Wed Jul 24 09:38:50 1991
--- patchlevel.h Wed Jul 24 09:34:28 1991
***************
*** 19,33 ****
/************************************************************************/
/* */
! /* 0 15 Oct 90 Initial release */
! /* comp.sources.x: Volume 10, Issues 3-8 */
/* */
! /* 1 1 Dec 90 Restructured code for maintainability */
/* Added "About Boss..." */
/* Added warning about downloads at 9600 */
/* baud */
/* */
! /* 2 15 Jan 91 Fixed bug in storing marked records */
/* Enhanced dialog placement */
/* */
/************************************************************************/
--- 19,40 ----
/************************************************************************/
/* */
! /* 0 15 Oct 90 comp.sources.x: Volume 10, Issues 3-8 */
! /* Initial release */
/* */
! /* 1 1 Dec 90 comp.sources.x: Volume 10, Issue 91 */
! /* Restructured code for maintainability */
/* Added "About Boss..." */
/* Added warning about downloads at 9600 */
/* baud */
/* */
! /* 2 15 Jan 91 comp.sources.x: Volume 11, Issue 4 */
! /* Fixed bug in storing marked records */
/* Enhanced dialog placement */
+ /* */
+ /* 3 24 Jul 91 comp.sources.x: Volume ??, Issue ?? */
+ /* Fixed unget_byte bug */
+ /* Added transmission delay support */
+ /* Fixed bug in object field management */
/* */
/************************************************************************/
*** protocol.h.orig Wed Jul 24 09:38:53 1991
--- protocol.h Wed Jun 19 10:18:46 1991
***************
*** 31,33 ****
--- 31,34 ----
#define DISABLE_FLOW_CONTROL 5
#define FLUSH_CASIO 6
#define UNGET_BYTE 7
+ #define WAIT_CASIO 8