build: add the SIBO SDK

This commit is contained in:
2026-07-06 18:01:36 +01:00
parent d76326729c
commit 64e484448c
757 changed files with 97167 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
@echo off
call checkvid
tscx %1.c /fpunnamed /%jpivid%
+2
View File
@@ -0,0 +1,2 @@
@if not "%jpivid%"=="v2" set jpivid=v0
+31
View File
@@ -0,0 +1,31 @@
/*
DIRLIST
*/
#include <plib.h>
#include <prndir.g>
#pragma METHOD_CALL
METHOD INT dirlist_va_test(PR_DIRLIST *self,RC_VAXVAR *prec1,RC_VAXVAR *prec2)
/*
Firstly perform a 2 way test on file or dir name records.
Order dir names before file names.
Otherwise order names alphabetically.
Return 0 if equal, <0 if *prec1 is before *prec2, >0 if after.
*/
{
FAST DIRLIST_ITEM *p1,*p2;
FAST INT ret;
ret=0;
p1=(DIRLIST_ITEM *)prec1->buf;
p2=(DIRLIST_ITEM *)prec2->buf;
if ((p1->info.status&P_FADIR)^(p2->info.status&P_FADIR))
ret=(p1->info.status&P_FADIR)?-1:+1;
else /* both records either dir or file names */
ret=p_scmp(&p1->name[0],&p2->name[0]);
if (self->varoot.key.desc)
ret=(-ret); /* reverse result if required */
return(ret);
}
+105
View File
@@ -0,0 +1,105 @@
/*
DIRLIST
*/
#include <plib.h>
#include <prndir.g>
LOCAL_D VOID *dcb=NULL;
LOCAL_D VOID *hand;
LOCAL_C VOID error(TEXT *msg, INT errno)
{
TEXT bb[E_MAX_ERROR_TEXT_SIZE];
p_close(dcb);
dcb=NULL;
p_errs(&bb[0],errno);
p_printf("%s: %s",msg,&bb[0]);
}
LOCAL_C VOID panic(TEXT *msg, INT errno)
{
error(msg,errno);
p_leave(0);
}
LOCAL_C VOID PrintDirLine(TEXT *name, P_INFO *pinfo)
{
P_DAYSEC ds;
P_DATE dt;
TEXT *p,b[40];
p=&b[0];
if (pinfo->status&P_FAVOLUME)
p=p_scpy(p,"Vol,");
if (pinfo->status&P_FADIR)
p=p_scpy(p,"Dir,");
if (pinfo->status&P_FAMOD)
p=p_scpy(p,"Mod,");
if (!(pinfo->status&P_FAWRITE))
p=p_scpy(p,"Read,");
if (pinfo->status&P_FASYSTEM)
p=p_scpy(p,"Sys,");
if (pinfo->status&P_FAHIDDEN)
p=p_scpy(p,"Hid,");
if (*(p-1)==',')
*--p=0;
p_sttods(&pinfo->modst,&ds);
p_dstodt(&ds,&dt);
p_printf("%- 12s %7lu %02u-%02u-%02u %02u:%02u %s",
name,pinfo->size,dt.day+1,dt.month+1,dt.year,dt.hour,dt.minute,&b[0]);
}
LOCAL_C VOID CDECL PrintDirList(TEXT *dir)
{
INT ret;
UWORD i,count;
DIRLIST_ITEM *pd,d;
RC_VAXVAR rec;
p_send2(hand,O_VA_RESET);
if ((ret=p_open(&dcb,dir,P_FDIR))!=0)
panic("Failed to open directory file",ret);
while (!(ret=p_iow(dcb,P_FREAD,&d.name[0],&d.info)))
{
rec.buf=(UBYTE *)&d;
rec.len=sizeof(d.info)+p_slen(&d.name[0])+1;
p_send4(hand,O_VA_INSERTISQ,&rec,&i);
}
p_close(dcb);
dcb=NULL;
if (ret!=E_FILE_EOF)
panic("Failed to read directory",ret);
if (!(count=p_send2(hand,O_VA_COUNT)))
p_printf("No files found");
else
{
for (i=0;i<count;i++)
{
pd=(DIRLIST_ITEM *)p_send3(hand,O_VA_PBUF,i);
PrintDirLine(&pd->name[0],&pd->info);
}
}
}
GLDEF_C INT CDECL DoDirLists(VOID)
{
TEXT name[P_FNAMESIZE];
hand=f_newsend(CAT_PRNDIR_PRNDIR,C_DIRLIST,O_VA_INIT,16);
while (p_getl(">",&name[0],P_FNAMESIZE))
PrintDirList(&name[0]);
p_send2(hand,O_DESTROY);
return(0);
}
GLDEF_C INT main(VOID)
{
INT err;
p_linklib(0);
if ((err=p_enter((VOID *)DoDirLists))!=0)
error("Called p_leave",err);
return(0);
}
+51
View File
@@ -0,0 +1,51 @@
/*
DYLSORT.C
*/
#include <plib.h>
#include <sort.g>
GLREF_D VOID *DatCommandPtr;
GLDEF_D P_RECT _DefScreenRect;
LOCAL_D INT array[] = {10,1,5,7,9,3,6,8,4,2};
#pragma save,ENTER_CALL
LOCAL_C INT RunSort(HANDLE dyl)
{
VOID *sort;
sort=f_newlibh(dyl,C_ISORT);
p_send4(sort,O_SORT,&array[0],10);
p_send2(sort,O_DESTROY);
return(0);
}
#pragma restore
GLDEF_C INT main(VOID)
{
INT err,i;
HANDLE dyl;
VOID *dcb;
p_openlib(&dcb,DatCommandPtr);
err=p_loadfilelib(dcb,0,&dyl,TRUE);
if (!err)
{
_DefScreenRect.tl.x=0;
_DefScreenRect.tl.y=0;
_DefScreenRect.br.x=40;
_DefScreenRect.br.y=8;
p_printf("Sorting...");
err=p_enter2(RunSort,dyl);
p_unloadlib(dyl);
for (i=0;i<10;i+=2)
p_printf("%4d %4d",array[i],array[i+1]);
p_getch();
}
return(err);
}
+1
View File
@@ -0,0 +1 @@
sort.dyl
+7
View File
@@ -0,0 +1,7 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#pragma link(olib.lib)
#pragma link(dylsort)
#link dylsort
+3
View File
@@ -0,0 +1,3 @@
hello.pic
hello.rzc
hello.shd
+19
View File
@@ -0,0 +1,19 @@
IMAGE hello
EXTERNAL olib
EXTERNAL hwim
INCLUDE hwimman.g
CLASS hellows wserv
window server active object
{
REPLACE ws_dyn_init
}
CLASS hellobw bwin
bordered window
{
REPLACE wn_init
REPLACE wn_draw
}
+3
View File
@@ -0,0 +1,3 @@
Hello
0
Binary file not shown.
+41
View File
@@ -0,0 +1,41 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#abort on
#set version=0x100F
#set priority=0x80
#set heapsize=0x80
#compile %main.cat
#if %remake #or (%main.rg #older %main.re) #or (%main.rg #older %main.g) #then
#run "re %main" no_window no_abort
#endif
#if (%main.rsg #older %main.rss) #or (%main.rsg #older %main.rg) #then
#file delete %main.rsg
#run "rs %main" no_window no_abort
#endif
#if %main.rzc #older %main.rsg #then
#run "rch %main" no_window no_abort
#endif
#compile o_hello.c
#if %main.shd #older %main.ms #then
#run "makeshd %main" no_window no_abort
#file delete %main.img
#endif
#if (%main.img #older %main.afl) #or (%main.img #older %main.pic) #then
#file delete %main.img
#endif
#pragma link(olib.lib)
#pragma link(hwim.lib)
#link %main
+3
View File
@@ -0,0 +1,3 @@
#include <hwimman.g>
_O_COM_EXIT
+40
View File
@@ -0,0 +1,40 @@
/*
HELLO.RSS
English resource file for Hello World application
*/
#include <hwim.rh>
#include <hello.rg>
RESOURCE WSERV_INFO hello_accs
{
menbar_id=hello_menbar;
first_com=O_COM_EXIT;
accel={'x'}; /* Exit */
}
RESOURCE MENU_BAR hello_menbar
{
items=
{
MENU_BAR_ITEM
{
menu_id=special_menu;
mb_item="Special";
}
};
}
RESOURCE MENU special_menu
{
items =
{
MENU_ITEM
{
com_id=O_COM_EXIT;
mn_item="Exit";
}
};
}
+3
View File
@@ -0,0 +1,3 @@
hello.pic
hello2.rzc
hello2.shd
+31
View File
@@ -0,0 +1,31 @@
IMAGE hello2
EXTERNAL olib
EXTERNAL hwim
INCLUDE hwimman.g
CLASS hellows wserv
window server active object
{
REPLACE ws_dyn_init
}
CLASS hellobw bwin
bordered window
{
REPLACE wn_init
REPLACE wn_draw
REPLACE wn_set
PROPERTY
{
UWORD isbye;
}
}
CLASS hellocm comman
command manager
{
ADD com_hello
ADD com_bye
}
+3
View File
@@ -0,0 +1,3 @@
Hello2
0
+41
View File
@@ -0,0 +1,41 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#abort on
#set version=0x100F
#set priority=0x80
#set heapsize=0x80
#compile %main.cat
#if %remake #or (%main.rg #older %main.re) #or (%main.rg #older %main.g) #then
#run "re %main" no_window no_abort
#endif
#if (%main.rsg #older %main.rss) #or (%main.rsg #older %main.rg) #then
#file delete %main.rsg
#run "rs %main" no_window no_abort
#endif
#if (%main.rzc #older %main.rsg) #or (%main.rsg #older %main.rss) #then
#run "rch %main" no_window no_abort
#endif
#compile o_hello2.c
#if %main.shd #older %main.ms #then
#run "makeshd %main" no_window no_abort
#file delete %main.img
#endif
#if (%main.img #older %main.afl) #or (%main.img #older %main.pic) #then
#file delete %main.img
#endif
#pragma link(olib.lib)
#pragma link(hwim.lib)
#link %main
+6
View File
@@ -0,0 +1,6 @@
#include <hwimman.g>
#include <hello2.g>
_O_COM_EXIT
_O_COM_HELLO
_O_COM_BYE
+68
View File
@@ -0,0 +1,68 @@
/*
HELLO.RSS
English resource file for Hello World application
*/
#include <hwim.rh>
#include <hello2.rg>
RESOURCE WSERV_INFO hello_accs
{
menbar_id=hello_menbar;
first_com=O_COM_EXIT;
accel={'x', /* Exit */
'h', /* Hello */
'b'}; /* Bye */
}
RESOURCE MENU_BAR hello_menbar
{
items=
{
MENU_BAR_ITEM
{
menu_id=message_menu;
mb_item="Message";
},
MENU_BAR_ITEM
{
menu_id=special_menu;
mb_item="Special";
}
};
}
RESOURCE MENU message_menu
{
items =
{
MENU_ITEM
{
com_id=O_COM_HELLO;
mn_item="Say hello";
},
MENU_ITEM
{
com_id=O_COM_BYE;
mn_item="Say goodbye";
}
};
}
RESOURCE MENU special_menu
{
items =
{
MENU_ITEM
{
com_id=O_COM_EXIT;
mn_item="Exit";
}
};
}
RESOURCE STRING hello_message {str="Hello World";}
RESOURCE STRING bye_message {str="Goodbye Cruel World";}
+35
View File
@@ -0,0 +1,35 @@
/*
ISORT.C
*/
#include <sort.g>
#define IdataBuf ((INT *)DataBuf)
LOCAL_C INT OrdFunc(INT i,INT j,VOID *DataBuf)
/*
order function used in qsort
*/
{
return(IdataBuf[i]-IdataBuf[j]);
}
LOCAL_C VOID ExchFunc(INT i,INT j,VOID *DataBuf)
/*
exchange function used in qsort
*/
{
INT k;
k=IdataBuf[i];
IdataBuf[i]=IdataBuf[j];
IdataBuf[j]=k;
}
#pragma METHOD_CALL
METHOD VOID isort_sort(PR_ROOT *self,INT *start,INT num)
{
p_qsort(num,OrdFunc,ExchFunc,start);
}
+3
View File
@@ -0,0 +1,3 @@
@echo off
call checkvid
tscx %1.pr /l /%jpivid%
+3
View File
@@ -0,0 +1,3 @@
@echo off
if exist %1.dyl del %1.dyl
tscx %1.pr /l /v0
+9
View File
@@ -0,0 +1,9 @@
@echo off
call checkvid
if not exist %1.pr goto error
tscx /m %1 /%jpivid%
tscx /m %1 /%jpivid%
goto end
:error
echo Project file %1.pr does not exist
:end
+52
View File
@@ -0,0 +1,52 @@
/*
O_HELLO
*/
#include <hwimman.g>
#include <hello.g>
#include <hello.rsg>
GLREF_D WSERV_SPEC *wserv_channel;
GLREF_D VOID *w_am;
GLDEF_C VOID main(VOID)
{
IN_HWIMMAN app;
IN_WSERV ws;
p_linklib(0);
app.flags=/*FLG_APPMAN_FULLSCREEN|*/FLG_APPMAN_RSCFILE|FLG_APPMAN_CLEAN|
FLG_APPMAN_SRSCFILE/*|FLG_APPMAN_IPCS|FLG_APPMAN_LINKING*/;
app.wserv_cat=p_getlibh(CAT_HELLO_HELLO);
ws.com_cat=p_getlibh(CAT_HELLO_HWIM);
app.wserv_class=C_HELLOWS;
ws.com_class=C_COMMAN;
p_send4(p_new(CAT_HELLO_HWIM,C_HWIMMAN),O_AM_INIT,&app,&ws);
}
#pragma METHOD_CALL
METHOD VOID hellows_ws_dyn_init(PR_HELLOWS *self)
{
self->wserv.cli=f_new(CAT_HELLO_HELLO,C_HELLOBW);
p_send2(self->wserv.cli,O_WN_INIT);
}
METHOD VOID hellobw_wn_init(PR_HELLOBW *self)
{
W_WINDATA wd;
wd.extent.tl.x=0;
wd.extent.tl.y=0;
wd.extent.width=wserv_channel->conn.info.pixels.x;
wd.extent.height=wserv_channel->conn.info.pixels.y;
p_send5(self,O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
p_send3(self,O_WN_VISIBLE,WV_INITVIS);
p_send3(self,O_WN_EMPHASISE,TRUE);
}
METHOD VOID hellobw_wn_draw(PR_HELLOBW *self)
{
p_supersend2(self,O_WN_DRAW);
gPrintText(50,50,"Hello World",11);
}
+75
View File
@@ -0,0 +1,75 @@
/*
O_HELLO
*/
#include <hwimman.g>
#include <hello2.g>
#include <hello2.rsg>
GLREF_D WSERV_SPEC *wserv_channel;
GLREF_D PR_HWIMMAN *w_am;
GLREF_D PR_WSERV *w_ws;
GLDEF_C VOID main(VOID)
{
IN_HWIMMAN app;
IN_WSERV ws;
p_linklib(0);
app.flags=/*FLG_APPMAN_FULLSCREEN|*/FLG_APPMAN_RSCFILE|FLG_APPMAN_CLEAN|
FLG_APPMAN_SRSCFILE/*|FLG_APPMAN_IPCS|FLG_APPMAN_LINKING*/;
app.wserv_cat=p_getlibh(CAT_HELLO2_HELLO2);
ws.com_cat=p_getlibh(CAT_HELLO2_HELLO2);
app.wserv_class=C_HELLOWS;
ws.com_class=C_HELLOCM;
p_send4(p_new(CAT_HELLO2_HWIM,C_HWIMMAN),O_AM_INIT,&app,&ws);
}
#pragma METHOD_CALL
METHOD VOID hellows_ws_dyn_init(PR_HELLOWS *self)
{
self->wserv.cli=f_new(CAT_HELLO2_HELLO2,C_HELLOBW);
p_send2(self->wserv.cli,O_WN_INIT);
}
METHOD VOID hellobw_wn_init(PR_HELLOBW *self)
{
W_WINDATA wd;
wd.extent.tl.x=0;
wd.extent.tl.y=0;
wd.extent.width=wserv_channel->conn.info.pixels.x;
wd.extent.height=wserv_channel->conn.info.pixels.y;
p_send5(self,O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
p_send3(self,O_WN_VISIBLE,WV_INITVIS);
/* hInitVis(self); */
p_send3(self,O_WN_EMPHASISE,TRUE);
}
METHOD VOID hellobw_wn_draw(PR_HELLOBW *self)
{
UINT resid;
TEXT buf[40];
resid=self->hellobw.isbye ? BYE_MESSAGE:HELLO_MESSAGE;
p_send(w_am,O_AM_LOAD_RES_BUF,resid,&buf[0]);
p_supersend2(self,O_WN_DRAW);
gPrintText(50,50,&buf[0],p_slen(&buf[0]));
}
METHOD VOID hellobw_wn_set(PR_HELLOBW *self,UINT isbye)
{
self->hellobw.isbye=isbye;
p_send2(self,O_WN_DODRAW);
}
METHOD VOID hellocm_com_hello(PR_HELLOCM *self)
{
p_send3(w_ws->wserv.cli,O_WN_SET,FALSE);
}
METHOD VOID hellocm_com_bye(PR_HELLOCM *self)
{
p_send3(w_ws->wserv.cli,O_WN_SET,TRUE);
}
+72
View File
@@ -0,0 +1,72 @@
/*
O_TIMER
*/
#include <hwimman.g>
#include <timer.g>
#include <timer.rsg>
#include <hwim.h>
GLREF_D WSERV_SPEC *wserv_channel;
GLREF_D VOID *w_am;
GLDEF_C VOID main(VOID)
{
IN_HWIMMAN app;
IN_WSERV ws;
p_linklib(0);
app.flags=FLG_APPMAN_RSCFILE|FLG_APPMAN_CLEAN|FLG_APPMAN_SRSCFILE;
app.wserv_cat=p_getlibh(CAT_TIMER_TIMER);
ws.com_cat=p_getlibh(CAT_TIMER_HWIM);
app.wserv_class=C_TIMERWS;
ws.com_class=C_COMMAN;
p_send4(p_new(CAT_TIMER_HWIM,C_HWIMMAN),O_AM_INIT,&app,&ws);
}
#pragma METHOD_CALL
METHOD VOID timerws_ws_dyn_init(PR_TIMERWS *self)
{
self->wserv.cli=f_new(CAT_TIMER_TIMER,C_TIMERBW);
p_send2(self->wserv.cli,O_WN_INIT);
f_newsend(CAT_TIMER_TIMER,C_MYTIMER,O_AO_INIT,"TIM:",-1);
}
METHOD VOID timerbw_wn_init(PR_TIMERBW *self)
{
W_WINDATA wd;
wd.extent.tl.x=0;
wd.extent.tl.y=0;
wd.extent.width=wserv_channel->conn.info.pixels.x;
wd.extent.height=wserv_channel->conn.info.pixels.y;
p_send5(self,O_WN_CONNECT,NULL,W_WIN_EXTENT,&wd);
p_send3(self,O_WN_VISIBLE,WV_INITVIS);
p_send3(self,O_WN_EMPHASISE,TRUE);
}
METHOD VOID mytimer_ao_init(PR_MYTIMER *self,TEXT *devname,INT mode)
{
p_supersend4(self,O_AO_INIT,devname,mode);
self->active.priority=PRIORITY_ACTIVE_REPEATER;
p_send3(w_am,O_AM_ADD_TASK,self);
p_send2(self,O_AO_QUEUE);
}
METHOD VOID mytimer_ao_queue(PR_MYTIMER *self)
{
LONG delay;
delay=20;
p_ioc4(self->active.pcb,P_FREAD,&self->active.stat,&delay);
self->active.isactive=TRUE;
}
METHOD INT mytimer_ao_run(PR_MYTIMER *self)
{
self->mytimer.count+=1;
hInfoPrint(TIMER_INFO,self->mytimer.count);
p_send2(self,O_AO_QUEUE);
return(RUN_ACTIVE_USED);
}
+56
View File
@@ -0,0 +1,56 @@
OOPDEMO.PRJ ! This list file
!
PRNDIR.CAT ! Directory print category file
DIRLIST.C ! Directory print DIRLIST methods
DIRMAIN.C ! Directory print main()
PRNDIR.PR ! Directory print project link file
!
SORT.CAT ! Sort DYL category file
ISORT.C ! Sort method function
SORT.PR ! Sort project link file
!
RSORT.CAT ! Root sort DYL category file
ROOT.C ! Root sort method function
RSORT.PR ! Root sort project link file
!
RUNSORT.C ! Use the sort DYL
RUNSORT.PR ! Link file for above
!
DYLSORT.C ! Sort, using a built-in DYL
DYLSORT.PR ! Link file for above
DYLSORT.DFL ! DYL file list for above
!
HELLO.PIC ! Icon used for the following 3 demonstration programs
!
HELLO.CAT ! Hello World category file
HELLO.RE ! Hello World resource externals file
HELLO.RSS ! Hello World application resource file
O_HELLO.C ! Hello World method source file
HELLO.MS ! Hello World shell data source file
HELLO.AFL ! Hello World add-file list
HELLO.PR ! Hello World project file
!
HELLO2.CAT ! Hello World (2) category file
HELLO2.RE ! Hello World (2) resource externals file
HELLO2.RSS ! Hello World (2) application resource file
O_HELLO2.C ! Hello World (2) method source file
HELLO2.MS ! Hello World (2) shell data source file
HELLO2.AFL ! Hello World (2) add-file list
HELLO2.PR ! Hello World (2) project file
!
TIMER.CAT ! Timer category file
TIMER.RE ! Timer resource externals file
TIMER.RSS ! Timer application resource file
O_TIMER.C ! Timer method source file
TIMER.MS ! Timer shell data source file
TIMER.AFL ! Timer add-file list
TIMER.PR ! Timer project file
!
UNNAMED.PR ! General project file for cc.bat
!
VID.BAT ! Set/clear JPI VID pragma
CHECKVID.BAT ! Check JPI VID pragma
CC.BAT ! cc batch file
LF.BAT ! IMG link batch file
LFC.BAT ! DYL link batch file
MAKE.BAT ! Project make batch file
+21
View File
@@ -0,0 +1,21 @@
IMAGE prndir
EXTERNAL olib
INCLUDE varray.g
INCLUDE p_file.h
CLASS dirlist vaxvar
Directory list
{
REPLACE va_test sort by various criteria
TYPES
{
typedef struct
{
P_INFO info;
TEXT name[P_FNAMESIZE];
} DIRLIST_ITEM;
}
}
+10
View File
@@ -0,0 +1,10 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#pragma link(olib.lib)
#pragma link(prndir)
#pragma link(dirlist)
#pragma link(dirmain)
#link prndir
+35
View File
@@ -0,0 +1,35 @@
/*
ROOT.C
*/
#include <rsort.g>
#define IdataBuf ((INT *)DataBuf)
LOCAL_C INT OrdFunc(INT i,INT j,VOID *DataBuf)
/*
order function used in qsort
*/
{
return(IdataBuf[i]-IdataBuf[j]);
}
LOCAL_C VOID ExchFunc(INT i,INT j,VOID *DataBuf)
/*
exchange function used in qsort
*/
{
INT k;
k=IdataBuf[i];
IdataBuf[i]=IdataBuf[j];
IdataBuf[j]=k;
}
#pragma METHOD_CALL
METHOD VOID root_sort(PR_ROOT *self,INT *start,INT num)
{
p_qsort(num,OrdFunc,ExchFunc,start);
}
+15
View File
@@ -0,0 +1,15 @@
LIBRARY rsort
INCLUDE p_std.h
INCLUDE p_object.h
CLASS root
{
ADD destroy
ADD sort Sort a given list of integers
PROPERTY
{
P_OBJECT pc; Class link
}
}
+8
View File
@@ -0,0 +1,8 @@
#system epoc dyl
#set epocinit=iplib
#model small jpi
#pragma link(olib.lib)
#pragma link(rsort)
#pragma link(root)
#link rsort
+51
View File
@@ -0,0 +1,51 @@
/*
RUNSORT.C
*/
#include <plib.h>
#include <sort.g>
GLREF_D VOID *DatCommandPtr;
GLDEF_D P_RECT _DefScreenRect;
LOCAL_D INT array[] = {10,1,5,7,9,3,6,8,4,2};
#pragma save,ENTER_CALL
LOCAL_C INT RunSort(HANDLE dyl)
{
VOID *sort;
sort=f_newlibh(dyl,C_ISORT);
p_send4(sort,O_SORT,&array[0],10);
p_send2(sort,O_DESTROY);
return(0);
}
#pragma restore
GLDEF_C INT main(VOID)
{
INT err,i;
HANDLE dyl;
TEXT buf[P_FNAMESIZE];
p_fparse("sort.dyl",DatCommandPtr,&buf[0],NULL);
err=p_loadlib(&buf[0],&dyl,TRUE);
if (!err)
{
_DefScreenRect.tl.x=0;
_DefScreenRect.tl.y=0;
_DefScreenRect.br.x=40;
_DefScreenRect.br.y=8;
p_printf("Sorting...");
err=p_enter2(RunSort,dyl);
p_unloadlib(dyl);
for (i=0;i<10;i+=2)
p_printf("%4d %4d",array[i],array[i+1]);
p_getch();
}
return(err);
}
+7
View File
@@ -0,0 +1,7 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#pragma link(olib.lib)
#pragma link(runsort)
#link runsort
+11
View File
@@ -0,0 +1,11 @@
LIBRARY sort
EXTERNAL olib
INCLUDE olib.g
CLASS isort root
{
ADD sort Sort a given list of integers
}
+8
View File
@@ -0,0 +1,8 @@
#system epoc dyl
#set epocinit=iplib
#model small jpi
#pragma link(olib.lib)
#pragma link(sort)
#pragma link(isort)
#link sort
+3
View File
@@ -0,0 +1,3 @@
hello.pic
timer.rzc
timer.shd
+30
View File
@@ -0,0 +1,30 @@
IMAGE timer
EXTERNAL olib
EXTERNAL hwim
INCLUDE hwimman.g
CLASS timerws wserv
window server active object
{
REPLACE ws_dyn_init
}
CLASS timerbw bwin
bordered window
{
REPLACE wn_init
}
CLASS mytimer active
timer active object
{
REPLACE ao_init
REPLACE ao_queue
REPLACE ao_run
PROPERTY
{
UWORD count;
}
}
+3
View File
@@ -0,0 +1,3 @@
Timer
0
+38
View File
@@ -0,0 +1,38 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#abort on
#set version=0x100F
#set priority=0x80
#set heapsize=0x80
#compile %main.cat
#if %remake #or (%main.rg #older %main.re) #or (%main.rg #older %main.g) #then
#run "re %main" no_window no_abort
#endif
#if (%main.rsg #older %main.rss) #or (%main.rsg #older %main.rg) #then
#file delete %main.rsg
#run "rs %main" no_window no_abort
#run "rch %main" no_window no_abort
#endif
#compile o_timer.c
#if %main.shd #older %main.ms #then
#run "makeshd %main" no_window no_abort
#file delete %main.img
#endif
#if (%main.img #older %main.afl) #or (%main.img #older %main.pic) #then
#file delete %main.img
#endif
#pragma link(olib.lib)
#pragma link(hwim.lib)
#link %main
+3
View File
@@ -0,0 +1,3 @@
#include <hwimman.g>
_O_COM_EXIT
+42
View File
@@ -0,0 +1,42 @@
/*
HELLO.RSS
English resource file for Hello World application
*/
#include <hwim.rh>
#include <timer.rg>
RESOURCE WSERV_INFO timer_accs
{
menbar_id=timer_menbar;
first_com=O_COM_EXIT;
accel={'x'}; /* Exit */
}
RESOURCE MENU_BAR timer_menbar
{
items=
{
MENU_BAR_ITEM
{
menu_id=special_menu;
mb_item="Special";
}
};
}
RESOURCE MENU special_menu
{
items =
{
MENU_ITEM
{
com_id=O_COM_EXIT;
mn_item="Exit";
}
};
}
RESOURCE STRING timer_info {str="Counted to %u";}
+6
View File
@@ -0,0 +1,6 @@
#system epoc img
#set epocinit=iplib
#model small jpi
#compile %main
#link %main
+22
View File
@@ -0,0 +1,22 @@
@echo off
goto X%1X
:Xv0X
:XoffX
set jpivid=v0
echo VID is now OFF
goto :end
:Xv2X
:XonX
set jpivid=v2
echo VID is now ON
goto :end
:XX
call checkvid
goto %jpivid%
:v0
echo VID is OFF
goto end
:v2
echo VID is ON
:end