home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / S12266.ZIP / FNDFILE2.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  1KB  |  48 lines

  1. /*  Source code for FNDFILE2.C */
  2.  
  3.  
  4. #define    INCL_BASE
  5. #define    INCL_ERRORS
  6. #define    INCL_DOS
  7. #define    INCL_DOSMISC
  8. #define    INCL_DOSMODULEMGR
  9.  
  10. #include    <stdio.h>
  11. #include    <stdlib.h>
  12. #include    <os2.h>
  13. #include    <dos.h>
  14. #include    <string.h>
  15.  
  16. void show(PFILEFINDBUF f_ptr, USHORT cnt);
  17.  
  18. USHORT far _loadds pascal do_list(PSZ name_ptr, PHDIR
  19.                             hptr, USHORT attrb,
  20.                             PFILEFINDBUF
  21.                             buf_ptr,
  22.                             USHORT buf_len,
  23.                             PUSHORT num_ptr,
  24.                             ULONG reserved)
  25. {
  26. USHORT    stat;
  27. HDIR        save_handle = *hptr;
  28. USHORT    save_num = *num_ptr;
  29.  
  30.     printf("File name: %s\n", name_ptr);
  31.     printf("Buffer address is %lx\n", buf_ptr);
  32.     printf("Buffer length: %d\n", buf_len);
  33.     printf("File count: %d, address: %ld\n",
  34.             *num_ptr, num_ptr);
  35.     printf("Handle is: %d\n", *hptr);
  36.     printf("Attribute: %d\n", attrb);
  37.  
  38.     stat = DosFindFirst(name_ptr, hptr, attrb, buf_ptr,
  39.                     buf_len, num_ptr, reserved);
  40.     printf("Return status was:%d, cnt was:%d\n", stat,
  41.              *num_ptr);
  42.     *hptr = save_handle;
  43.     *num_ptr = save_num;
  44.     return(stat);
  45. }
  46.  
  47.  
  48.