home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / gfx / superview-lib-9.12.lha / SuperView-Lib / Programmers / Example_Tools / ListSVPs / ListSVPs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-28  |  4.4 KB  |  135 lines

  1. /* ======================================================================== */
  2. /* = Programmname    : ListSVPs V9.1                      = */
  3. /* =                                      = */
  4. /* ======================================================================== */
  5. /* = Autor/Copyright : (c) 1994 by Andreas R. Kleinert.                   = */
  6. /* =               All rights reserved.                  = */
  7. /* ======================================================================== */
  8. /* = Funktion         : Show available svoperators of                      = */
  9. /* =               superview.library V9+.                             = */
  10. /* ======================================================================== */
  11. /* = Letztes Update  : 24.9.1994                          = */
  12. /* =                                      = */
  13. /* ======================================================================== */
  14. /* = Bemerkungen     : "superview.library" V9+ needed.                    = */
  15. /* =                                      = */
  16. /* ======================================================================== */
  17. /* = Compiler         : SAS/C V6.51                        = */
  18. /* =               (smakefile)                                        = */
  19. /* ======================================================================== */
  20.  
  21. #include <superview/superviewbase.h>
  22. #include <svoperators/svoperatorbase.h>
  23.  
  24. #include <proto/exec.h>
  25. #include <proto/dos.h>
  26. #include <proto/superview.h>
  27. #include <proto/svoperators.h>
  28.  
  29. #include <stdio.h>
  30. #include <stdlib.h>
  31. #include <string.h>
  32.  
  33.  
  34.    /* Help- and Info- Texts */
  35.  
  36. char entry1_text  [] = "\2331;32;40mListSVPs V9.1 \2330;32;40m\2333;32;40m(FREEWARE)\2330;32;40m\n(c) 1993 by Andreas Ralph Kleinert.\nAndreas R. Kleinert, Grube Hohe Grethe 23, D-57074 Siegen, Germany.\n";
  37. char entry2_text  [] = "Lists up available \42svoperators\42 of \42superview.library\42.\n";
  38. char entry3_text  [] = "USAGE : \2330;33;40mListSVPs\2330;31;40m\n";
  39.  
  40. char ver_text [] = "\0$VER: ListSVPs V9.1 (24.9.94)";
  41.  
  42.  
  43. /* *************************************************** */
  44. /* *                             * */
  45. /* * Error-Messages for Leave() and KF_Message()     * */
  46. /* *                             * */
  47. /* *************************************************** */
  48.  
  49. char svlib_text [] = "You need \42superview.library\42 V9+ !";
  50.  
  51.  
  52. /* *************************************************** */
  53. /* *                             * */
  54. /* * Function Declarations                 * */
  55. /* *                             * */
  56. /* *************************************************** */
  57.  
  58. void __regargs Leave(char *endtext, long code);
  59.  
  60.  
  61.    /* Functions from module "ListSVPs_Subs.o" : */
  62.  
  63. extern void __stdargs K_Printf(char *formatstring, ...);
  64.  
  65.  
  66. /* *************************************************** */
  67. /* *                             * */
  68. /* * Additional Base Declarations             * */
  69. /* *                             * */
  70. /* *************************************************** */
  71.  
  72. extern struct ExecBase *SysBase;
  73.  
  74. struct SuperViewBase *SuperViewBase = N;
  75.  
  76.  
  77. /* *************************************************** */
  78. /* *                             * */
  79. /* * MAIN                         * */
  80. /* *                             * */
  81. /* *************************************************** */
  82.  
  83. void main(long argc, char **argv)
  84. {
  85.  struct List             *opr_list = N;
  86.  struct SVP_OperatorNode *svp_node = N;
  87.  
  88.  if(!argc) exit(0); /* started from WB ... */
  89.  
  90.  if( argc > 3 || (argv[1][0] =='?')||(argv[2][0] =='?'))
  91.   {
  92.    K_Printf("%s%s%s", entry1_text, entry2_text, entry3_text);
  93.  
  94.    Leave(N, 0);
  95.   }
  96.  
  97.  SuperViewBase = (struct SuperViewBase *) OpenLibrary("superview.library", 9);
  98.  if(!SuperViewBase) Leave(svlib_text, 100);
  99.  
  100.  K_Printf("\nList of available svoperators :\n");
  101.  
  102.  opr_list = &SuperViewBase->svb_SVOperatorList;
  103.  
  104.  for(svp_node=(APTR) opr_list->lh_Head;(svp_node)&&(svp_node!=(APTR) &(opr_list->lh_Tail));)
  105.   {
  106.    K_Printf("\n  --------------------------------------------------------");
  107.  
  108.    K_Printf("\nSVOperator  : \42%s\42", svp_node->svp_FileName);
  109.    K_Printf("\nPriority    : %ld",      (long) ((struct Node *)svp_node)->ln_Pri);
  110.    K_Printf("\nDescription : \42%s\42", svp_node->svp_Description);
  111.    K_Printf("\nAuthor      : \42%s\42", svp_node->svp_Author);
  112.  
  113.    svp_node = (APTR) ((struct Node *)svp_node)->ln_Succ;
  114.   }
  115.  
  116.  K_Printf("\n  --------------------------------------------------------\n");
  117.  
  118.  Leave(N, 0);
  119. }
  120.  
  121. /* *************************************************** */
  122. /* *                             * */
  123. /* * LEAVE : Global Exit Function Replacement         * */
  124. /* *                             * */
  125. /* *************************************************** */
  126.  
  127. void __regargs Leave(char *endtext, long code)
  128. {
  129.  if(SuperViewBase) CloseLibrary((APTR) SuperViewBase);
  130.  
  131.  if(endtext)       K_Printf("%s\n", endtext);
  132.  
  133.  exit(code);
  134. }
  135.