|
|
|
|
|
|
|
||
|
||
|
|
||
May 1999 |
Revision 1.01 |
|
Persistor Instruments Inc. |
© 1998 All rights reserved. |
|
This section contains various useful or legacy routines that don't quite fit anywhere else.
Setup for printf-like runtime logging to a file and/or the console.
|
Prototype: |
void Initflog(char *fname, bool echoToConsole); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
fname is a zero terminated C string contiaining
the file or full path name to log/append future flogf
messages to. |
|
Returns: |
Returns nothing. |
|
Notes: |
Pass zero for fname and true for echoToConsole to just show messages on the console. |
|
Timing: |
TBD |
This function works like printf, except that it sends the formatted data to either, neither, or both an append file and the stdout console. When working to the console, the flogf takes care of checking the current state of the EIA driver and if it's off, turns it on while sending then turns it back off when complete. Console writes also blocks until all characters have been sent. Similarly, when writing to a file, flogf checks the current CF enable state and if it's off, turns it on while writing, then back off. Each flogf targeting a file opens the file for append mode on entry and closes and flushes the file on exit.
|
Prototype: |
short flogf(char *format, ...); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
format is identical to standard printf formats and variable arguments. |
|
Returns: |
Returns the number of characters written. |
|
Notes: |
Notes. |
|
Timing: |
TBD |
This is a general purpose date string parser that accomodates a variety of date specification styles.
typedef enum { YYMMDD // ISO
, MMDDYY // US
, DDMMYY // European
} DateFieldOrder;
|
Prototype: |
short sscandate(const char *str, struct tm *ptm, DateFieldOrder dfo ); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
str is a zero terminated C string containing date in the form: YEAR<delim>MONTH<delim>DAY (specifying enum
YYMMDD) <delim> may be any single comma, space, dash,
period, or slash. ptm is a standard C library tm structure from <time.h> with fields tm_year, tm_mon, and tm_mday filled in from the scan. |
|
Returns: |
Returns the lenght of the scanned string or zero if the string is invalid. |
|
Notes: |
This routine is used by the PicoDOS QRdate and QRdatetime query/reply functions. |
|
Timing: |
TBD |
This is a general purpose time string parser.
|
Prototype: |
short sscantime(const char *str, struct tm *ptm); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
str is a zero terminated C string containing time
in the form: HOURS<delim>MINUTES<delim>SECONDS
and optional AM or PM for 12 hour time. ptm is a standard C library tm structure from <time.h> with fields tm_hour, tm_min, and tm_secs filled in from the scan. |
|
Returns: |
Returns the lenght of the scanned string or zero if the string is invalid. |
|
Notes: |
This routine is used by the PicoDOS QRtime and QRdatetime query/reply functions. |
|
Timing: |
TBD |
Pass a command to the PicoDOS command shell.
|
Prototype: |
short execstr(char *cmdstr); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
cmdstr is a zero terminated C string containing the command and parameters just as would be typed at the PicoDOS command prompt. |
|
Returns: |
Returns enum { execstrNoCmdMatch = -1, execstrNoError = 0, execstrGeneralFailure = 1 }; |
|
Notes: |
Notes. |
|
Timing: |
TBD |
Return PicoDOS version information with a CF8/AT8 compatable function call.
|
Prototype: |
char * picodosver(void); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
Nothing |
|
Returns: |
Returns a C string in the form "nnnnn-v.rs" where nnnnn is the serial number, v is the current version of PicoDOS, r is the release level, and s is the sub-release level. |
|
Notes: |
New programs should use the BIOS global variables for this information:
|
|
Timing: |
TBD |
Return PicoDOS file system information with a CF8/AT8 compatable function call.
|
Prototype: |
short pdcfinfo(char *drive, long *size, long *free)PICO_CALL(pdcfinfo); |
|
Definition: |
#include <cf1pico.h> |
|
Inputs: |
drive is a string pointer in the form of "A:",
"B:", etc. |
|
Returns: |
Returns zero on success, or -1 if the named drive is not available. |
|
Notes: |
New programs should use the PicoDOS DIR functions DIRFreeSpace and DIRTotalSpace. |
|
Timing: |
TBD |
|
|
|
|
|
|
Tel: 508-759-6434 |
|
Fax: 508-759-6436 |
|
|
||