home *** CD-ROM | disk | FTP | other *** search
/ M.u.C.S. Disc 2000 / MUCS2000.iso / anwend / slectric / sample.c < prev    next >
C/C++ Source or Header  |  1996-11-28  |  2KB  |  78 lines

  1. /* ------------------------------------------------------------------------- */
  2. /* ----- sample.c ----- Selectric Example ---------------------------------- */
  3. /* ------------------------------------------------------------------------- */
  4. /* ----------------------------------------- (c) 1992 by Oliver Scheel ----- */
  5. /* ------------------------------------------------------------------------- */
  6.  
  7. #include <stdio.h>
  8. #include <aes.h>
  9.  
  10. #include "fsel_inp.h"
  11.  
  12. #define    DEMO    1
  13.  
  14. /* ------------------------------------------------------------------------- */
  15.  
  16. char    p0[128] = "C:\\ACCS\\*.AC?",
  17.     p1[128] = "C:\\TOOLS\\*.*",
  18.     p2[128] = "",
  19.     p3[128] = "";
  20.  
  21. char    e0[17] = "*.AC[CX]",
  22.     e1[17] = "*.PRG",
  23.     e2[17] = "*.TXT,*.DOC",
  24.     e3[17] = "*.INF";
  25.  
  26. char    *my_paths[4] = { p0, p1, p2, p3 };
  27. char    *my_ext[4] = { e0, e1, e2, e3 };
  28.  
  29. char    more_fnames[5 * 15];    /* entspricht 5 Namen a 15 Zeichen */
  30.  
  31. char    pfname[128] = "",
  32.     pname[128] = "",
  33.     fname[14] = "";
  34.  
  35. /* ------------------------------------------------------------------------- */
  36.  
  37. int main(void)
  38. {
  39.     int    is_slct_da, d;
  40. #if (DEMO==1)
  41.     DTA    mydta;
  42. #endif
  43.  
  44.     appl_init();
  45.  
  46.     slct_extpath(4, &my_ext, 4, &my_paths);    /* eigene Pfade setzen */
  47. #if (DEMO==1)
  48.     is_slct_da = slct_check(0x0102);
  49.     if(is_slct_da)
  50.         slct->comm = CMD_FILES_OUT|CFG_FIRSTNEXT;
  51. #else
  52.     is_slct_da = slct_morenames(1, 5, more_fnames);    /* we want more */
  53. #endif
  54.     wind_update(BEG_MCTRL);        /* Wichtig!! */
  55.     if(file_select(pfname, pname, fname, "*.*", "Selectric\277 Sample"))
  56.     {
  57.         if(is_slct_da)
  58.         {
  59. #if (DEMO==1)
  60.             d = slct_first(&mydta, FA_ARCHIVE);
  61.             while(!d)
  62.             {
  63.                 printf("\n\r%s\t%02x", mydta.d_fname, mydta.d_attrib);
  64.                 d = slct_next(&mydta);
  65.             }
  66.             slct_release();
  67. #else
  68.             /* weggucken ... */
  69.             printf("\r\nYou wanted more ... \r\n\n%s", more_fnames);
  70. #endif
  71.         }
  72.     }
  73.     wind_update(END_MCTRL);        /* Wichtig!! */
  74.  
  75.     appl_exit();
  76.     return(0);
  77. }
  78.