API of ruptoollibmanu(c)
getUsWdot ... Calculation of width of proportional font
***** Syntax *****
int getUsWdot(int font, char* str){}
Function Value : Other than -1 : Normal The number of width dots to display a string str.
-1 : Abnormal Font code(other than 5,6,7)
Invalid character code(other than 0x20~0xFF)
Parameters :
int font Specify a font code 5,6,7.
(lcdbios Refer to Library Explanation Document gv,pv_kput.)
char *str String
***** Function *****
Return the number of width dot required to display a string shown with str in a proportional font specified by argument.
Example x = getUsWdot(6,"Hello,World!!");
Obtained result x=56
Lib-Index API-Index
getGvPos ... To obtain an LCD display position in graphics mode.
***** Syntax *****
void getGvPos(int *x,int *y){}
Function value : None
Parameters :
int *x GVRAM Display start x pointer to store coordinates
int *y GVRAM Display start x pointer to store display start y coordinate
***** Function *****
To obtain from which position LCD is displayed (102 x 64) within a display area of GVRAM 320x240.
Example
int x,y;
:
gv_place(100,50); /* LCD display from GVRAM x=100,y=50 */
:
getGvPos(&x,&y);
Obtained result x=100,y=50
Lib-Index API-Index
getLcdfreezeVal ... To obtain a frozen status of LCD screen.
***** Syntax *****
int getLcdfreezeVal(void){}
Function Value : 0 : non freeze
1 : freeze
***** Function *****
To obtain whether LCD screen is frozen or not.
Refer to lcdbios function lcdfreeze() for freezing of LCD screen.
--------------------------------------------------------------------------------
2.Character Manipulation Functions
Lib-Index API-Index
StrCpy ... To copy a character string. (Converting alphabet lower case -> upper case)
***** Syntax *****
void StrCpy(char *s1,const char *s2){}
Function value : None
Parameter :
char *s1 A character string to copy to
const char *s2 A character string to be copied
***** Function *****
To copy character string s2 to character string s1.
At this time, an alphabet lower case is converted into upper case.
Lib-Index API-Index
StrnCmpI ... To compare strings (alphabets not case sensitive)
***** Syntax *****
int StrnCmpI(char *s1,char *s2,int n){}
Function value : None
Parameter :
char *s1 Comparison string1
char *s2 Comparison string 2
int n Number of comparison character bytes from the head
***** Function *****
To compare strings s1 and s2 for n bytes from the head. However, alphabets are not case sensitive.
Lib-Index API-Index
strcpy1 ... To copy a string (a return value in standard library strcpy() is omitted)
***** Syntax *****
void strcpy1(char *s1,const char *s2){}
Function value : None
Parameter :
char *s1 A character string to copy to
const char *s2 A character string to be copied
***** Function *****
To copy string s2 to string s1. However, as in the standard library, a return value of "char *strcpy()" is not set.
Lib-Index API-Index
strcpy2 ... To copy and concatenate strings.strcpy(s1,s2)+strcat(s1,s3)
***** Syntax *****
void strcpy2(char *s1,const char *s2,const char *s3){}
Funciton value : None
Parameter :
char *s1 A character string to copy to
const char *s2 A character string to be copied
const char *s3 A character string to be added
***** Function *****
To copy string s2 to string s1. In addition, to add string s3 to the end of string s1 and store in s1. No return value is set.
Lib-Index API-Index
strcpy3 ... To copy and concatenate strings strcpy(s1,s2)+strcat(s1,s3)+strcat(s1,s4)
***** Syntax *****
void strcpy3(char *s1,const char *s2,
const char *s3,const char *s4){}
Function value : None
Parameer :
char *s1 A string to copy to
const char *s2 A string to be copied
const char *s3 A string to be added 1
const char *s4 A string to be added 2
***** Function *****
To copy string s2 to string s1. In addition, to add strings s3 and s4 to the end of string s1 and store in s1. No return value is set.
Lib-Index API-Index
wstrcpy ... To copy a character strcpy(s1,s2), strcpy(s3,s4)
***** Syntax *****
void wstrcpy(char *s1,const char *s2,char *s3,const char *s4){}
Function value : None
Parameters :
char *s1 A character string to copy to 1
const char *s2 A character string to be copied 1
char *s3 A character string to be copy to 2
const char *s4 A character string to be copied 2
***** Function *****
To copy string s2 to stroing s1, and string s4 to string s3. No return value is set.
Lib-Index API-Index
strcpyadd0 ... To copy a character & to add end NULL.
***** Syntax *****
void strcpyadd0(char *s1,const char *s2,int n){}
Function value : None
Parameters :
char *s1 A character string to copy to
const char *s2 A character to be copied
int n Number of copied character bytes from the head
***** Function *****
To copy n bytes from the head of string s2 to string s1. In addition, add NULL at the end of string s1. No return value is set.
Lib-Index API-Index
strcat1 ... Concatenation of strings (a return value in standard library strcat() is omitted.)
***** Syntax *****
void strcat1(char *s1,const char *s2){}
Function value : None
Parameters :
char *s1 Non-concatenated string
const char *s2 Added strings
***** Function *****
To add string s2 to the end of string s1, and store in s1. However, as in the standard library, a return value of "char *strcat()" is not set.
Lib-Index API-Index
strcat2 ... Concatenation of strings strcat(s1,s2)+strcat(s1,s3)
***** Syntax *****
void strcat2(char *s1,const char *s2,const char *s3){}
Function value : None
Parameters :
char *s1 Non-concatenated string
const char *s2 Added string 1
const char *s3 Added string 2
***** Function *****
To addstrings s2 and s3 to the end of string s1 and store in s1. No return value is set.
Lib-Index API-Index
strlength ... Returned number of string bytes (Return value int)
***** Syntax *****
int strlength(const char *s1){}
Function value : Number of string bytes
Parameter :
const char *s1 String
***** Function *****
To obtain number of bytes of string s1. However, return value is int.
--------------------------------------------------------------------------------
3.COMMON Functions
Lib-Index API-Index
CheckLeapYear ... To judge leap year
***** Syntax *****
int CheckLeapYear( int year ){}
Function value : Leap year : 1, others : 0
Parameters :
int year Year to be judged as a leap year
***** Function *****
To judge from year data whether that year is a leap year.
Lib-Index API-Index
CheckAmPm ... To judge morning or afernoon.
***** Syntax *****
int CheckAmPm( int *hour ){}
Function Value : PM : 1, AM : 0
Paameter :
int *hour Pointer to time digit to judge morning or afernoon.
***** Function *****
To judge morning or afternoon of a year of that time?? from time digit data. Hour contains 12-hour time?.
***** Remarks *****
As a region of parameter hour is reiwritten to a 12-hour value after this function is passed?, be careful not to hand time data of the time you do not wish to change.
Examples
WatchDT Time;
int hour;
int AmPm;
Time= *pSystemCtl->CPUram; /* Time data on RAMis read*/
hour = Time.NOW_Hour;
AmPm = CheckAmPm( &hour );
Lib-Index API-Index
CheckToday ... To obtain a data on a memory.
***** Syntax *****
void CheckToday( TypeDate *date ){}
Function Value : None
Parameters :
TypeDate *date Pointer to an area where a date is stored
***** Function *****
To obtain a date on memory being counted by the filer?.
Lib-Index API-Index
CheckWeek ... To calculate day of the week.
***** Syntax *****
int CheckWeek( int year,int month,int day ){}
Function value : 0 : Sunday 1 : Monday 2 : Tuesday 3 : Wednesday
4 : Thursday 5 : Friday 6 : Saturday
Parameters :
int year Year data to obtain a day of the week.
int month Month date to obtain a day of the week.
int day Day data to obtain a day of the week.
***** Function *****
To calculate a day of the week from date data.
Lib-Index API-Index
GetNWeek ... To calculate nth day of the week of a month.
***** Syntax *****
int GetNWeek( int year, int month, int N, int week ){}
Function Value : Date of nth day of the week of a month(1~31)
Parameters :
int year Year data to obtain a date.
int month Month data to obtain a date.
int N Nth data to obtain a date.
1 : 1st 2 : 2nd 3 : 3rd
4 : 4th 5 : 5th 7 : last
int week Day of the week data to obtain a date.
0 : Sunday 1 : Monday 2 : Tuesday 3 : Wednesday
4 : Thursday 5 : Friday 6 : Saturday
***** Function *****
To calculate a date of nth day of the week from date data.
Lib-Index API-Index
GetExtFileName ... To obtain a file name with an extention specified.
***** Syntax *****
int GetExtFileName( char *path, char extbuf[][9], int nmax ){}
Function value : Number of obtained files
Parameters :
char *path Path to search and an extention you wish to obtain.
char extbuf[][9] Buffer to store obtained file name.
int nmax Maximum number of files to be obtained.
***** Function *****
To obtain a file name including a specified extension in a specified directory.
***** Remarks *****
Need to secure buffer for the maximum number of files to be obtained.
Examples
char sbuf[32][9];
GetSndFileName( "B : \\SYSTEM\\SOUND\\*.snd",sbuf,32 );
Lib-Index API-Index
SoundDEMO ... Ringing of a sound file
***** Syntax *****
void SoundDEMO( char *filepath ){}
Function value : None
Parameters :
char *filepath Path to sound file
***** Function *****
To ring a specified sound file.
***** Remarks *****
To reproduce up to 512bytes.
Example SoundDEMO( "B : \\SYSTEM\\SOUND\\SAMPLE.SND" );
Lib-Index API-Index
GetNdaysafter ... To obtain a data n days after a specified date.
***** Syntax *****
void GetNdaysafter( TypeDate *date, long Ndays, int lastyear ){}
Function value : None
Parameter :
TypeDate *date Pointer to an area where a date is stored.
long Ndays Specified data after N days.
int lastyear Last year of a corresponding date.
***** Function *****
To obtain a date N days after a specified date.
***** Remarks *****
To store date obtained by adding N day to date data stored in date area. Parameter date area will be rewritten when this function is passed?, be careful not to hand date data that you do not wish to change. If a date after N days exceeds last year of a corresponding date, ?? will be December 31 of last year.
Example If you obtain a date 100 days after today's date :
WatchDT Time;
TypeDate date;
Time = *pSystemCtl->CPUram; /* Reading date data on RAM*/
date.yy = Time.NOW_Year;
date.mm = Time.NOW_Month;
date.dd = TIme.NOW_Day;
GetNdaysafter( &date, 100, 2100 );
Lib-Index API-Index
YearDayCount ... Total number od days of a specified year.
***** Syntax *****
int YearDayCount( int year ){}
Function Value : Total number of days in a year
Parameters :
int year Data of specified year you wish to obtain.
***** Function *****
To judge whether it is a leap year and calculate total number of days of a year.
Lib-Index API-Index
CheckDayCountSet ... To obtain the number of days that have passed since January 1.
***** Syntax *****
int CheckDayCountSet( TypeDate *date ){}
Function Value : Information on some days after January 1.
Parameters :
TypeDate *date Data of a specified date you wish to obtain.
***** Function *****
To consider a leap year and obtain some day after January 1.
Lib-Index API-Index
GetSubDays ... To obtain a difference number of days between a date and a date.
***** Syntax *****
long GetSubDays( TypeDate *date1, TypeDate *date2 ){}
Function Value : Number of days being different between a date and date(date2-date1)
Parameter :
TypeDate *date1 Pointer to an area where specified date 1 is stored.
TypeDate *date2 Pointer to an area where specified date 2 is stored.
***** Function *****
TO obain a difference number of days between a date and a date.
Lib-Index API-Index
GetSubTime ... To obtain a difference between time and time (in terms of minute).
***** Syntax *****
int GetSubTime( TypeTime *time1, TypeTime *time2 ){}
Function Value : Minute date of difference between time and time (time2-time1).
Parameters :
TypeTime *time1 Pointer to an area where specified time 1 is stored
TypeTime *time2 Pointer to an area where specified time 2 is stored
***** Function *****
To obtain as minute data difference between time and time.
Lib-Index API-Index
GetNhourafter ... To obtain time N minutes after specified time.
***** Syntax *****
int GetNhourafter( TypeTime *time, int N ){}
Function Value : Return + some days.
Parameter :
TypeTime *time Pointer to an area where specified time is stored.
int N Specified data after N minutes.
***** Function *****
To obtain time N minutes after specified time.
***** Remarks *****
To store time obtained by adding N minutes to time data stored in time area. As parameter time area is rewritten when this function is passed, be careful not to hand time data you do not wish to change.
Example If you wish to obtain time 100 minutes after current time
WatchDT Time;
TypeTime time;
Time = *pSystemCtl->CPUram; /* reading time data on RAM*/
time.hour = Time.NOW_Hour;
time.min = Time.NOW_Min;
GetNhourafter( &time, 100 );
Lib-Index API-Index
CheckTimeTable ... To judge whether a specified date is within a range.
***** Syntax *****
int CheckTimeTable(TypeDate *date1,TypeDate *date2,TypeDate *date3){}
Function Value : 1 : If it is within a range(date2 Make sure that memory maps of main application and sub-application do not overlap.
Example If you specify 0x10F300~0x10FFFFas a memory map for main application,
A memory map of a sub-appliation must be within 0x110100~stack.
Lib-Index API-Index
SetExtensionInfo ... To register data area to be commonly used.
***** Syntax *****
void SetExtensionInfo(unsigned long pInfo) {}
Function Value : None
Parameters :
unsigned long pInfo A head address of common memory
***** Function *****
Register a head address of common data area reserved by main application.
Obtain this address by GetExtensionInfo function (to be described later) when starting a sub-application.
Execute ClearExtensionInfo function (to be described later) when terminating main application.
***** Remarks *****
You should register within a main application. Create common data area to b reserved as Static data. You can register only one memory address.
Example Reserve and register an area with main application.
/**** Main application ****/
typedef struct {
int subexe; /* sample 0 : Main 1 : Sub1 2 : Sub2 -2 : Forced end */
char Iam[10]; /* sample Data identification */
int mode; /* sample one case sent 1,one case received 2 */
int index; /* sample Index */
char name[57]; /* sample Name */
} SHAREINFO;
static SHAREINFO Info; /* Reserve as static memory */
int main(void)
{
/* Set an address of common memory */
SetExtensionInfo((unsigned long)&Info);
:
Lib-Index API-Index
ExtensionAppsExecute ... Execute a child process(Succeed data area information to be commonly used.)
***** Syntax *****
int ExtensionAppsExecute(char *path) {}
Function Value : 0 : Normal end, -1 : Abnormal end
Parameters :
char *path A full path name of child process to be executed
***** Function *****
Start a child process that succeeded to information of data area commonly used from main application.
***** Remarks *****
You should invoke SetExtensionInfo function before calling ExtensionAppsExecute function.
Example Sub-application control by main application
/**** Main application ****/
:
#define SUB1 "\\Sub1.exf"
#define SUB2 "\\Sub2.exf"
int main(void)
{
int ret;
/* Setting of addresses of a common memory */
SetExtensionInfo((unsigned long)&Info);
/* sample various initialization */
Info.subexe = 0;
strcpy(Info.Iam,IAM_ADR);
Info.mode = 0;
while (Info.subexe==0) {
if (Info.subexe==0) {
Info.subexe = -2;
/* Execute Sub1 function */
ret = ExtensionAppsExecute( SUB1 );
/* Select a sub-application to be started next */
/* Read a value set by Sub1 function */
if (Info.subexe==1) {
Info.subexe = 0;
/* Execute Sub2 function */
ret = ExtensionAppsExecute( SUB2 );
}
}
}
ClearExtensionInfo();
:
Lib-Index API-Index
GetExtensionInfo ... Obtain data area commonly used.
***** Syntax *****
long GetExtensionInfo(void) {}
Function Value : -1 : Abnormal
Other than -1 : head address of common memory
Parameter : None
***** Function *****
Obtain a head address of common data area reserved and registered by main application. Revoke it when starting a sub-application.
***** Remarks *****
When a return value is -1, it is an error possibly caused by any of the following reasons :
.Common memory has not been reserved by a parent application.
.This child application was started directly.
Example Obtain area by sub-application.
/**** Sub-application ****/
static SHAREINFO *Info; /* Obtained address */
int main(void)
{
/* Obtain common information address */
info = (SHAREINFO*)GetExtensionInfo();
if (info==(SHAREINFO*)-1) {
/* Failed to obtain */
dos_exit(0);
}
else {
/* Succeeded in obtaining. */
if (Info->mode==...
}
:
Lib-Index API-Index
ClearExtensionInfo ... Clear commonly used data area.
***** Syntax *****
void ClearExtensionInfo(void) {}
Function Value : None
Paraemeter : None
***** Function *****
Clear working storage area of SetExtensionInfo function.
Execute this when terminating main application.
======================================================================
Copyright (c) Seiko Instruments Inc. 1999. All rights reserved.
======================================================================
Lib-Index API-Index