ViewT.lha
http://nl.aminet.net/util/cli/ViewT.lhaI am trying to port the ViewT(ooltypes) Cli command above, by Phil Dietz, to OS4.
This command allows you to print an icon's tooltypes, add one or delete one.
This surely is interesting in scripts.
It works now, but
i have some questions
- one about 'residentiable' programs which this program seems to be.
This seems to be the rationale to not use Printf() but the function PRintf() below.
Does this mean that Printf() is not reentrant?
Searching the web i noted this
"AmigaOS was also entirely reentrant,"
http://en.wikipedia.org/wiki/Talk%3AAmigaOSSearching the SDK for 'reentrant' i got 91 hits, the RKRM gave me 4.
I did not find yet a good startin point.
Does anybody knows of a good tutorial?
- To make the command work i had to use Printf() instead of the defined function PRintf() below
Neither the original definition (commented out) nor the one i modified did show the tooltypes, only the count number.
What should it be?
My modified source is at
http://users.online.be/AD/ViewTOS4p.cExtract:
/* Protos */
void PRintf(struct Library *, char *, long , ...);
// void PRintf(struct DOSBase *, char *, long , ...);
int main(void)
{
struct ExecBase *SysBase = (*((struct ExecBase **) 4));
struct IconBase *IconBase;
struct DOSBase *DOSBase;
...
i=0;
while(dob->do_ToolTypes[i] && *dob->do_ToolTypes[i]) {
//PRintf(DOSBase,"%ld. %s\n",i+1,(STRPTR)dob->do_ToolTypes[i]); //Arg 1 incompatible
IDOS->Printf("%ld. %s\n",i+1,(STRPTR)dob->do_ToolTypes[i]);
i++; /* increment pointer pointer */
}
if(i==0) IDOS->PutStr("No tooltypes.\n");
...
}
void PRintf(struct Library *DOSBase, char *string, long arg, ...)
//void PRintf(struct DOSBase *DOSBase, char *string, long arg, ...)
{
/* We're passing DOSBase cuz there are no globals in a RESIDENTIABLE
* with NO cres.o startup code.
*/
IDOS->VPrintf(string, &arg);
}