home *** CD-ROM | disk | FTP | other *** search
Wrap
/* ======================================================================== */ /* = Programmname : ListSVOs V7.1 = */ /* = = */ /* ======================================================================== */ /* = Autor/Copyright : (c) 1993-94 by Andreas R. Kleinert. = */ /* = All rights reserved. = */ /* ======================================================================== */ /* = Funktion : Show available svobjects of superview.library. = */ /* = = */ /* ======================================================================== */ /* = Letztes Update : 15.7.1994 = */ /* = = */ /* ======================================================================== */ /* = Bemerkungen : "superview.library" V3+ needed. = */ /* = = */ /* ======================================================================== */ /* = Compiler : SAS/C V6.51 = */ /* = (smakefile) = */ /* ======================================================================== */ #include <superview/superviewbase.h> #include <svobjects/svobjectbase.h> #include <proto/exec.h> #include <proto/dos.h> #include <proto/superview.h> #include <stdio.h> #include <stdlib.h> #include <string.h> /* Help- and Info- Texts */ char entry1_text [] = "\2331;32;40mListSVOs V7.1 \2330;32;40m\2333;32;40m(FREEWARE)\2330;32;40m\n(c) 1993-94 by Andreas Ralph Kleinert.\nAndreas R. Kleinert, Grube Hohe Grethe 23, D-57074 Siegen, Germany.\n"; char entry2_text [] = "Lists up available \42svobjects\42 of \42superview.library\42.\n"; char entry3_text [] = "USAGE : \2330;33;40mListSVOs\2330;31;40m\n"; char ver_text [] = "\0$VER: ListSVOs V7.1 (15.7.94)"; /* *************************************************** */ /* * * */ /* * Error-Messages for Leave() and KF_Message() * */ /* * * */ /* *************************************************** */ char svlib_text [] = "You need \42superview.library\42 V3+ !"; /* *************************************************** */ /* * * */ /* * Function Declarations * */ /* * * */ /* *************************************************** */ void __regargs Leave(char *endtext, long code); /* Functions from module "ListSVOs_Subs.o" : */ extern void __stdargs K_Printf(char *formatstring, ...); /* *************************************************** */ /* * * */ /* * Additional Base Declarations * */ /* * * */ /* *************************************************** */ extern struct ExecBase *SysBase; struct SuperViewBase *SuperViewBase = N; /* *************************************************** */ /* * * */ /* * MAIN * */ /* * * */ /* *************************************************** */ void main(long argc, char **argv) { struct List *obj_list = N; struct SVO_ObjectNode *svo_node = N; long i; if(!argc) exit(0); /* started from WB ... */ if( argc > 3 || (argv[1][0] =='?')||(argv[2][0] =='?')) { K_Printf("%s%s%s", entry1_text, entry2_text, entry3_text); Leave(N, 0); } SuperViewBase = (struct SuperViewBase *) OpenLibrary("superview.library", 3); if(!SuperViewBase) Leave(svlib_text, 100); K_Printf("\nList of available svobjects :"); obj_list = &SuperViewBase->svb_SVObjectList; for(svo_node=(APTR) obj_list->lh_Head;(svo_node)&&(svo_node!=(APTR) &(obj_list->lh_Tail));) { K_Printf("\n\n"); K_Printf("\nSVObject : \42%s\42", svo_node->svo_FileName); K_Printf("\nsvo-Type : %lx", svo_node->svo_ObjectType); K_Printf("\nPriority : %ld", (long) ((struct Node *)svo_node)->ln_Pri); K_Printf("\nTypeID : \42%s\42", svo_node->svo_TypeID); K_Printf("\nTypeCode : %ld", svo_node->svo_TypeCode); for(i=0; i<svo_node->svo_SubTypeNum; i++) { K_Printf("\n\n%ld. SubType :", i+1); K_Printf("\n SubTypeID : \42%s\42", svo_node->svo_SubTypeID[i]); K_Printf("\n SubTypeCode : %ld", svo_node->svo_SubTypeCode[i]); } if(svo_node->svo_Version > 1) { K_Printf("\n\nFlags :"); if(svo_node->svo_Flags & SVO_FLAG_READS_TO_BUFFER) K_Printf(" file->buffer"); if(svo_node->svo_Flags & SVO_FLAG_READS_TO_SCREEN) K_Printf(" file->screen"); if(svo_node->svo_Flags & SVO_FLAG_WRITES_FROM_BUFFER) K_Printf(" buffer->file"); if(svo_node->svo_Flags & SVO_FLAG_WRITES_FROM_SCREEN) K_Printf(" screen->file"); if(svo_node->svo_Flags & SVO_FLAG_SUPPORTS_SVDRIVER) K_Printf(" svdriver?"); if(svo_node->svo_Flags & SVO_FLAG_NEEDS_SVDRIVER) K_Printf(" svdriver!"); }else K_Printf("\n\nNo flag field found (Version 1 SVObject)"); svo_node = (APTR) ((struct Node *)svo_node)->ln_Succ; } K_Printf("\n\nNo more svobjects available.\n\n"); Leave(N, 0); } /* *************************************************** */ /* * * */ /* * LEAVE : Global Exit Function Replacement * */ /* * * */ /* *************************************************** */ void __regargs Leave(char *endtext, long code) { if(SuperViewBase) CloseLibrary((APTR) SuperViewBase); if(endtext) K_Printf("%s\n", endtext); exit(code); }