/* Copyright (C) Magna Carta Software, Inc. 1988-1990. All Rights Reserved C COMMUNICATIONS TOOLKIT COCO.H -- Intel/DCA CAS prototypes and definitions. */ #define CCT_DEVELOPMENT #if !defined(COMM_H_INCLUDED) #include #endif #if !defined(CAS_H_INCLUDED) #define CAS_H_INCLUDED #define MULTIPLEX_INT 0X2F #define MULTIPLEX_NUM 0XCB /* CONTROL FILE FIELD VALUES */ #define CAS_SEND 0 /* VALUES FOR "CAS_EVENT_TYPE" */ #define CAS_RECEIVE 1 #define CAS_LOG 2 #define CAS_POLLED_SEND 2 #define CAS_POLLED_RECEIVE 3 #define CAS_200_DPI 0 /* VALUES FOR "CAS_TRANSFER_TYPE" */ #define CAS_100_DPI 1 #define CAS_FILE 2 /* FILE TRANSFER RECORD FIELD VALUES */ #define CAS_ASCII 0 /* VALUES FOR "CAS_FILE_TYPE" */ #define CAS_PCX 1 #define CAS_DCX 2 #define CAS_80_COL 0 /* VALUES FOR "CAS_TEXT_SIZE" */ #define CAS_132_COL 1 /* EVENT STATUS VALUES (used in cas_findfirst(), offset 2 in control file */ #define CAS_COMPLETED 0 #define CAS_WAITING 1 #define CAS_DIALLED 2 #define CAS_SENDING 3 #define CAS_RECEIVING 4 #define CAS_ABORTED 5 #define CAS_ANY (-1) #if !defined(FHANDLE_DEFINED) #define FHANDLE_DEFINED typedef unsigned long FHANDLE; #endif struct cct_date { WORD year; WORD month; WORD day; WORD hour; WORD minute; WORD second; }; #if (defined(__WATCOMC__) || defined(MSC)) #pragma pack(1) #endif #if defined(_INTELC32_) #pragma noalign(cas_ftr) #endif typedef struct cas_ftr { struct cas_ftr *next; /* next FTR in linked list */ char ftype; /* FAX type */ char text_size; /* text size for ASCII files */ char status; /* what has been done to this file? */ unsigned long bytes_sent; /* bytes_sent so far */ unsigned long file_bytes; /* file size */ WORD pages_sent; /* # of pages sent so far */ WORD file_pages; /* file size (pages) */ char fpath[80]; /* file path */ char increments; /* 1/8 inch. increments to page length */ char pl; /* page length */ char reserved1[31]; /* RESERVED */ } CAS_FILE_TRANSFER_RECORD; #if defined(_INTELC32_) #pragma noalign(cas_control_file) #endif typedef struct cas_control_file { char event_type; /* send, receive, etc. */ char transfer_type; /* 200x200, 100x100 file, etc. */ short event_status; /* waiting, completed, etc. */ WORD event_time; /* DOS file time format */ WORD event_date; /* DOS file time format */ short num_files; /* number of files to transfer */ WORD ftr_offset; /* offset in ctl file of file transfer record */ char phone_num[47]; /* phone number to call (ASCIIZ) */ char app_tag[64]; /* app.-specific tag string */ char reserved1; /* reserved -- initialized to zero */ char connect_secs; /* length of phone connect (secs) */ char connect_mins; /* length of phone connect (mins) */ char connect_hours; /* length of phone connect (hours) */ unsigned long pages; /* # pages in all files */ unsigned long pages_sent; /* # pages sent thus far */ WORD files_sent; /* # files sent thus far */ char cover_flag; /* send cover? */ WORD errors; /* # of TX errors for this ctl. file */ char reserved2[78]; /* reserved -- initialized to zero */ char csid[21]; /* remote CSID (initialized by hardware) */ char dest[32]; /* "To:" field (ASCIIZ) */ char sender[32]; /* "From:" field (ASCIIZ) */ char lpath[80]; /* Name of PCX logo file */ } CAS_CONTROL_FILE; /* #pragma pack() */ typedef struct cas { struct cas_ftr *ftr; /* the records (in a linked list) */ struct cas_control_file *f; /* control file values */ FHANDLE fh; /* the task control file */ } CAS; extern WORD cas_multiplex_num; /* CAS multiplex number */ short FCALL_ cas_abort_current_event(void); short FCALL_ cas_autoreceive_state(WORD func, WORD rings); short FCALL_ cas_deinit(CAS *c); short FCALL_ cas_findfirst(short status, short direction, WORD queue, short *event_handle); short FCALL_ cas_findnext(WORD queue, short *event_handle); short FCALL_ cas_get_ces(char *status); short FCALL_ cas_get_event_date(WORD event_handle, WORD queue, struct cct_date *event_date); short FCALL_ cas_get_event_time(WORD event_handle, WORD queue, struct cct_date *event_date); short FCALL_ cas_get_external_data_block(char *edb); short FCALL_ cas_get_queue_status(WORD queue, WORD *num_ctl, WORD *num_rx); short FCALL_ cas_get_hardware_status(char *status); short FCALL_ cas_move_received_file(WORD event_handle, WORD num, char *new_name); short FCALL_ cas_open(WORD event_handle, WORD file_num, WORD queue, WORD *file_handle); short FCALL_ cas_run_diagnostics(WORD mode); short FCALL_ cas_set_task_date(WORD event_handle, struct cct_date *event_date); short FCALL_ cas_set_task_time(WORD event_handle, struct cct_date *event_date); short FCALL_ cas_submit(char FAR_ *tcf); short FCALL_ cas_submit_file(char *status); short FCALL_ cas_unlink(WORD event_handle, WORD file_num, WORD queue); short FCALL_ cas_unlinkall(WORD queue); /* UTILITY FUNCTIONS */ WORD FCALL_ todosdate(WORD year, WORD month, WORD day); WORD FCALL_ todostime(WORD hour, WORD minute, WORD sec); /* HIGH-LEVEL FUNCTIONS */ CAS * FCALL_ cas_create_task(WORD etype, char *from, char *to, char *num, WORD date, WORD time); short FCALL_ cas_queue_file(CAS *c, WORD ftype, WORD text_size, char *fpath, WORD increments, WORD pl); short FCALL_ cas_send_one_file(CAS *c, char *filename, char *to, char *phone_num); short FCALL_ cas_submit_task(CAS *c, char *fname, short mode, char *lpath, char *cover); short FCALL_ isacas(void); #endif