COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) Geoworks 1995 -- All Rights Reserved
	Geoworks Confidential

PROJECT:		
MODULE:		World Time Database Library
FILE:		rwtime.def

AUTHOR:		Andy Chiu, Jan 28, 1995

MACROS:
	Name			Description
	----			-----------

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	ACJ	1/28/95   	Initial revision


DESCRIPTION:
	This is a library written in C.  All paramaters will have
	to be pushed on the stack in order to be called.
		
	$Id: rwtime.def,v 1.1 97/04/04 14:26:36 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef _RWTIME
StartLibrary rwtime

RWTIME_DB_NO_NOTE	equ	-1	; Value when no note field 
RWTIME_RECORD_NOT_FOUND	equ	-1	; Value when a record was not found
RWTIME_WRITE_FAILED	equ	-1	; Value when a write failed

; These constants do not include the null that is needed to
;store the strings as a null terminated.	
RWTIME_DB_CITY_MAX_FIELD_LENGTH			equ	32
RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH		equ	32
RWTIME_DB_AREA_CODE_MAX_FIELD_LENGTH		equ	5
RWTIME_DB_GMT_OFFSET_MAX_FIELD_LENGTH		equ	6
RWTIME_DB_LATITUDE_MAX_FIELD_LENGTH		equ	8
RWTIME_DB_LONGITUDE_MAX_FIELD_LENGTH		equ	8
RWTIME_DB_RECORD_MAX_SIZE  equ	RWTIME_DB_CITY_MAX_FIELD_LENGTH + \
				RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH 	+ \
				RWTIME_DB_AREA_CODE_MAX_FIELD_LENGTH	+ \
				RWTIME_DB_GMT_OFFSET_MAX_FIELD_LENGTH	+ \
				RWTIME_DB_LATITUDE_MAX_FIELD_LENGTH	+ \
				RWTIME_DB_LONGITUDE_MAX_FIELD_LENGTH

RWTIME_DB_MAX_FIELD_LENGTH	equ		64

RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH2		equ	32
RWTIME_DB_CAPITAL_MAX_FIELD_LENGTH		equ	32
RWTIME_DB_NATIONAL_CODE_MAX_FIELD_LENGTH	equ	5
RWTIME_DB_NATIONAL_PREFIX_MAX_FIELD_LENGTH	equ	5
RWTIME_DB_COUNTRY_RECORD_MAX_SIZE equ RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH2 + \
				RWTIME_DB_CAPITAL_MAX_FIELD_LENGTH 	  + \
				RWTIME_DB_NATIONAL_CODE_MAX_FIELD_LENGTH  +\
				RWTIME_DB_NATIONAL_PREFIX_MAX_FIELD_LENGTH 


RWTDatabaseRecord	struct

	RWTDR_city		char	\
		RWTIME_DB_CITY_MAX_FIELD_LENGTH+1 dup (0)
	RWTDR_country		char	\
		RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH+1 dup (0)
	RWTDR_areaCode	char	\
		RWTIME_DB_AREA_CODE_MAX_FIELD_LENGTH+1 dup (0)
	RWTDR_gmtOffset		sword
	RWTDR_latitude		char	\
		RWTIME_DB_LATITUDE_MAX_FIELD_LENGTH+1 dup (0)
	RWTDR_longitude		char	\
		RWTIME_DB_LONGITUDE_MAX_FIELD_LENGTH+1 dup (0)
	
RWTDatabaseRecord	ends

RWT_DATABASE_RECORD_SIZE	equ	size(RWTDatabaseRecord)


RWTDatabaseCountryRecord	struct

	RWTDCR_country		char	\
		RWTIME_DB_COUNTRY_MAX_FIELD_LENGTH2+1 dup (0)
	RWTDCR_capital		char	\
		RWTIME_DB_CAPITAL_MAX_FIELD_LENGTH+1 dup (0)
	RWTDCR_nationalCode	char	\
		RWTIME_DB_NATIONAL_CODE_MAX_FIELD_LENGTH+1 dup (0)
	RWTDCR_nationalPrefix		char	\
		RWTIME_DB_NATIONAL_PREFIX_MAX_FIELD_LENGTH+1 dup (0)
	
RWTDatabaseCountryRecord	ends

RWT_DATABASE_COUNTRY_RECORD_SIZE	equ	size(RWTDatabaseCountryRecord)

RWTimePassInitFlags record
	RPIF_CITY:1
	RPIF_COUNTRY:1
	:6
RWTimePassInitFlags end

RWTimeInitFlags	record
	RIF_COUNTRY_CORRUPTED:1
	RIF_CITY_CORRUPTED:1	
	RIF_COUNTRY_DB_IN_USE:1
	RIF_CITY_DB_IN_USE:1
	:12
RWTimeInitFlags end

global	RWTDATABASEINIT:far
global	RWTDATABASERESTORE:far
global	RWTDATABASECLOSE:far
global	RWTDATABASECREATEDB:far
global	RWTDATABASEGETCITY:far
global	RWTDATABASEGETGMTOFFSET:far
global	RWTDATABASEWRITERECORD:far
global	RWTDATABASEREADRECORD:far
global	RWTDATABASEDELETERECORD:far
global	RWTDATABASEADDRECORD:far
global	RWTDATABASEGETABSOLUTERECORDNUMBER:far
global	RWTDATABASESETALLVIEWPT:far
global	RWTDATABASEGETVIEWPTRECORDCOUNT:far
global	RWTDATABASEFINDRECORD:far
global	RWTDATABASESETDESTINATIONCITY:far
global	RWTDATABASEGETDESTINATIONCITY:far
global	RWTDATABASESETHOMECITY:far
global	RWTDATABASEGETHOMECITY:far

global	RWTDATABASECOUNTRYCREATEDB:far
global	RWTDATABASECOUNTRYWRITERECORD:far
global	RWTDATABASECOUNTRYREADRECORD:far
global	RWTDATABASECOUNTRYDELETERECORD:far
global	RWTDATABASECOUNTRYADDRECORD:far
global	RWTDATABASECOUNTRYGETABSOLUTERECORDNUMBER:far
global	RWTDATABASECOUNTRYSETALLVIEWPT:far
global	RWTDATABASECOUNTRYGETVIEWPTRECORDCOUNT:far
global	RWTDATABASECOUNTRYFINDRECORD:far
global	RWTDATABASECOPYBACKUPFILES:far

global	RWTDatabaseInit:far
global	RWTDatabaseRestore:far
global	RWTDatabaseClose:far
global	RWTDatabaseCreateDB:far
global	RWTDatabaseCountryCreateDB:far
global	RWTDatabaseReadRecord:far
global 	RWTDatabaseWriteRecord:far
global 	RWTDatabaseDeleteRecord:far
global	RWTDatabaseAddRecord:far
global	RWTDatabaseSetDestinationCity:far
global	RWTDatabaseGetDestinationCity:far
global	RWTDatabaseSetHomeCity:far
global	RWTDatabaseGetHomeCity:far
global	RWTDatabaseGetAbsoluteRecordNumber:far
global	RWTDatabaseSetAllViewpt:far
global	RWTDatabaseGetViewptRecordCount:far
global	RWTDatabaseFindRecord:far

global	RWTDatabaseCountryReadRecord:far
global 	RWTDatabaseCountryWriteRecord:far
global 	RWTDatabaseCountryDeleteRecord:far
global	RWTDatabaseCountryAddRecord:far
global	RWTDatabaseCountryGetAbsoluteRecordNumber:far
global 	RWTDatabaseCountrySetAllViewpt:far
global 	RWTDatabaseCountryGetViewptRecordCount:far
global	RWTDatabaseCountryFindRecord:far
global	RWTDatabaseCopyBackupFiles:far
EndLibrary	rwtime


