home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / HPFSLS.ZOO / ls.h < prev    next >
C/C++ Source or Header  |  1992-02-17  |  2KB  |  69 lines

  1. /*
  2.  * Header per ls
  3.  * $Log:    ls.h $
  4.  * Revision 1.1  91/05/08  20:24:32  Unknown
  5.  * Initial revision
  6.  * 
  7.  */
  8.  
  9.  
  10. #include <stdio.h>
  11. #include <stdlib.h>
  12. #include <string.h>
  13. #include <malloc.h>
  14. #include <direct.h>
  15. #include <ctype.h>
  16. #include <sys/types.h>
  17. #include <sys/stat.h>
  18. #define INCL_BASE
  19. #include <os2.h>
  20.  
  21.  
  22. #define BLOCK_SIZE   1024
  23. #define BUF_SIZE     128
  24. #define WIDE_LEN     14
  25. #define WIDE_STR     "14"
  26.  
  27. /* attributi normali */
  28. enum { DIR, SYSTEM, HIDDEN, ARCHIVE, READABLE, WRITEABLE, EXECUTABLE };
  29.  
  30. #define NOTIME       0
  31. #define CREATION     1
  32. #define LASTACCESS   2
  33. #define LASTWRITE    3
  34.  
  35. /* tipo per le opzioni */
  36. typedef struct tag_option_type {
  37.    unsigned recursive: 1;
  38.    unsigned attributes: 1;
  39.    unsigned size: 1;
  40.    unsigned effectiveSize: 1;
  41.    unsigned time: 2;
  42.    unsigned all: 1;
  43.    unsigned k: 1;
  44.    unsigned wide: 1;
  45.    unsigned reverse: 1;
  46.    unsigned dirSlash: 1;
  47.    unsigned exeStar: 1;
  48.    unsigned ea : 1;
  49.    unsigned volume: 1;
  50. } option_type;
  51.  
  52. /* funzione di confronto */
  53. #ifdef NOCASE
  54. #define STRCMP stricmp
  55. #else
  56. #define STRCMP strcmp
  57. #endif
  58.  
  59. /* prototypes */
  60. int  main(int  argc,char  * *argv);
  61. long  ls_dir(char  *name,unsigned short  attr,struct  tag_option_type opt,int  level);
  62. void  ls(char  *name,unsigned short  attr,struct  tag_option_type opt);
  63. void  ls_ea(char  *name, int level);
  64. void  ls_volume(void);
  65. int  get_options(int  argc,char  * *argv,unsigned short  *pattrs,struct  tag_option_type *popt);
  66. void  print_help(void);
  67. int  is_executable(char  *name);
  68. long  print_name(struct  _FILEFINDBUF _far *pffbuf,struct  tag_option_type opt,int  level);
  69.