home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / c / REQUESTLib.lha / REQUESTLib / Developer / source / main.c next >
Encoding:
C/C++ Source or Header  |  1999-08-08  |  4.5 KB  |  118 lines

  1. /*
  2.  * Test REQUESTLib.Lib
  3.  *
  4.  * (c) 1999 by Michaela Prüß
  5.  *
  6.  */
  7.  
  8. #include "main.h"
  9.  
  10. int main(int argc, char *argv[])
  11. {
  12.     int        rv;
  13.  
  14.     rv=rtEZReq(  "rtEZReq",                                    /* title          */
  15.                  "A simple requester\\nTwo buttons",        /* body           */
  16.                  "_Yes|_No",                                /* buttontext     */
  17.                  0,                                         /* default return */
  18.                  TRUE,                                      /* center text    */
  19.                  FALSE,                                     /* noreturnkey    */
  20.                  3,                                         /* position       */
  21.                  0,                                         /* top offset     */
  22.                  0,                                         /* left offset    */
  23.                  "");                                       /* pub screen     */
  24.  
  25.     printf("\n");
  26.     if (rv==-1) fprintf(stderr,"Unable to allocate requester structure\n");
  27.     else if (rv==-2) fprintf(stderr,"Error opening reqtools.library\n");
  28.     else printf("rtEZReq (1) returning %d\n",rv);
  29.  
  30.  
  31.  
  32.     rv=rtEZReq(  "rtEZReq",                                    /* title          */
  33.                  "An other simple requester\\nOne button",  /* body           */
  34.                  "Kick here",                               /* buttontext     */
  35.                  0,                                         /* default return */
  36.                  TRUE,                                      /* center text    */
  37.                  TRUE,                                      /* noreturnkey    */
  38.                  1,                                         /* position       */
  39.                  0,                                         /* top offset     */
  40.                  0,                                         /* left offset    */
  41.                  "");                                       /* pub screen     */
  42.  
  43.     printf("\n");
  44.     if (rv==-1) fprintf(stderr,"Unable to allocate requester structure\n");
  45.     else if (rv==-2) fprintf(stderr,"Error opening reqtools.library\n");
  46.     else printf("rtEZReq (2) returning %d\n",rv);
  47.  
  48.  
  49.  
  50.     rv=rtFileReq("rtFileReq",       /* title            */
  51.                  "Sys:",            /* drawer           */
  52.                  "Disk.info",       /* file name        */
  53.                  "#?",              /* pattern          */
  54.                  FALSE,             /* no buffer        */
  55.                  TRUE,              /* multi select     */
  56.                  TRUE,              /* select dirs      */
  57.                  FALSE,             /* save             */
  58.                  FALSE,             /* no files         */
  59.                  TRUE,              /* pattern gadget   */
  60.                  15,                /* height           */
  61.                  "YEAH",            /* OK button text   */
  62.                  FALSE,             /* volume requester */
  63.                  FALSE,             /* no assigns       */
  64.                  FALSE,             /* no disks         */
  65.                  TRUE,              /* all disks        */
  66.                  TRUE,              /* empty allowed    */
  67.                  2,                 /* position         */
  68.                  0,                 /* top offset       */
  69.                  0,                 /* left offset      */
  70.                  "Ram:Output_File", /* output file name */
  71.                  "");               /* pub screen       */
  72.  
  73.     printf("\n");
  74.     if (rv==-1) fprintf (stderr, "Unable to open output file\n");
  75.     else if (rv==-2) fprintf(stderr,"Unable to allocate requester structure\n");
  76.     else if (rv==-3) fprintf(stderr,"Error opening reqtools.library\n");
  77.     else printf("rtFileReq (1) returning %d\n",rv);
  78.  
  79.     printf("Type Ram:OutPut_File:\n");
  80.     system("Type Ram:OutPut_File");
  81.  
  82.  
  83.  
  84.     rv=rtFileReq("rtFileReq / Vol", /* title            */
  85.                  "",                /* drawer           */
  86.                  "",                 /* file name        */
  87.                  "",                /* pattern          */
  88.                  FALSE,             /* no buffer        */
  89.                  FALSE,             /* multi select     */
  90.                  FALSE,             /* select dirs      */
  91.                  FALSE,             /* save             */
  92.                  FALSE,             /* no files         */
  93.                  FALSE,             /* pattern gadget   */
  94.                  15,                /* height           */
  95.                  "OK!",             /* OK button text   */
  96.                  TRUE,              /* volume requester */
  97.                  FALSE,             /* no assigns       */
  98.                  FALSE,             /* no disks         */
  99.                  TRUE,              /* all disks        */
  100.                  TRUE,              /* empty allowed    */
  101.                  4,                 /* position         */
  102.                  0,                 /* top offset       */
  103.                  0,                 /* left offset      */
  104.                  "",                /* output file name */
  105.                  "");               /* pub screen       */
  106.  
  107.     printf("\n");
  108.     if (rv==-1) fprintf (stderr, "Unable to open output file\n");
  109.     else if (rv==-2) fprintf(stderr,"Unable to allocate requester structure\n");
  110.     else if (rv==-3) fprintf(stderr,"Error opening reqtools.library\n");
  111.     else printf("rtFileReq (2) returning %d\n",rv);
  112.  
  113.     printf("\n");
  114.  
  115.     exit(0);
  116. }
  117.  
  118.