home *** CD-ROM | disk | FTP | other *** search
/ vsiftp.vmssoftware.com / VSIPUBLIC@vsiftp.vmssoftware.com.tar / FREEWARE / FREEWARE40.ZIP / flistfrontend / src / dircmd2.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-27  |  2.6 KB  |  74 lines

  1. /* $Id: dircmd2.h,v 1.7 1995/10/27 11:37:32 tom Exp $
  2.  *
  3.  * Define command constraints for DCL-commands known to FLIST.
  4.  */
  5.  
  6. #ifndef    DIRCMD2_H
  7. #define    DIRCMD2_H
  8.  
  9. #include "dclarg.h"
  10.  
  11. #define    tDIRCMD(func) \
  12.     void    func (int *curfile_, char *xcmd_, DCLARG *xdcl_, int fix, int history)
  13.  
  14. #define    v_1_IN        0001    /* Exactly one input filespec needed    */
  15. #define    v_M_IN        0002    /* Multiple input filespecs permitted    */
  16. #define    v_W_IN        0004    /* Wildcard permitted in input specs    */
  17.  
  18. #define    v_1_OUT        0010    /* Exactly one output filespec needed    */
  19. #define    v_M_OUT        0020    /* Multiple output filespecs permitted    */
  20. #define    v_W_OUT        0040    /* Wildcard permitted in output specs    */
  21.  
  22. #define    v_OPTS        0100    /* Options permitted in command        */
  23. #define    v_OMIT        0200    /* Omit implicit use of current entry    */
  24. #define    v_FREE        0400    /* Permit in/out filespecs to be omitted*/
  25.  
  26. #define    v_COPY        01000    /* Don't propagate path-name to output    */
  27. #define    v_SET        02000    /* Permit 'SET' before this keyword    */
  28.  
  29. #define    v_nonDCL    04000    /* non-DCL (e.g., leading '?')        */
  30. #define    v_ARGS        010000    /* ...permit arguments if non-DCL    */
  31. #define    v_NAME        020000    /* Command explicitly for current entry    */
  32.  
  33. /*
  34.  * The flags 'v_1_IN', 'v_M_IN' are exclusive, as are 'v_1_OUT', 'v_M_OUT'.
  35.  * The following combinations are used in 'dircmd' to drive 'dirarg' and
  36.  * 'dirchk' in simple parameter tests.  A typical command is noted beside:
  37.  */
  38. #define    v_1    (v_1_IN + v_OPTS)            /* (browse)    */
  39. #define    v_1_1    (v_1_IN + v_W_IN  + v_1_OUT + v_W_OUT)    /* (rename)    */
  40. #define    v_M_1    (v_M_IN + v_W_IN  + v_1_OUT + v_OPTS + v_COPY)
  41. #define    v_M    (v_M_IN + v_W_IN  + v_OPTS)        /* (print)    */
  42. #define    v_M0    (v_M_IN + v_W_IN)            /* (delete)    */
  43.  
  44. #define    v_1a    (v_1_IN + v_W_IN  + v_OMIT)        /* (find)    */
  45. #define    v_1b    (v_1_IN + v_W_IN  + v_OPTS + v_FREE)    /* (protect)    */
  46. #define    v_1c    (v_M_IN + v_W_IN  + v_OMIT + v_FREE)    /* (read)    */
  47. #define    v_1d    (v_1_IN + v_OMIT)            /* (create)    */
  48.  
  49. /*
  50.  * Structure for 'dircmd' commands which require arguments, or permit a
  51.  * filespec other than the current entry to be used:
  52.  */
  53. typedef    struct    {
  54.     char    *v_full;    /* full text of command            */
  55.     int    v_len;        /* abbreviation length            */
  56.     tDIRCMD((*v_func));    /* No passback, special            */
  57.     int    v_mode;        /* file count bits (e.g., v_1_IN)    */
  58.     char    *v_dfts;    /* default string            */
  59.     } VCMD2;
  60.  
  61. /*
  62.  * Define tests on 'cmdnum' (the index into VCMD/VCMD2 tables) to permit
  63.  * program to know about third-type (non-FLIST commands).
  64.  */
  65. #define    NOARG_CMD    (-1)
  66. #define    EXTRN_CMD    (-2)
  67. #define    ERROR_CMD    (-3)
  68.  
  69. #define    isDIRED_CMD(x)    ((x) >= 0)
  70. #define    isNOARG_CMD(x)    ((x) == NOARG_CMD)
  71. #define    isEXTRN_CMD(x)    ((x) == EXTRN_CMD)
  72.  
  73. #endif /* DIRCMD2_H */
  74.