home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / pcmail / part05 / path.h < prev    next >
C/C++ Source or Header  |  1989-02-03  |  4KB  |  141 lines

  1. /*++
  2. /* NAME
  3. /*    path
  4. /* SUMMARY
  5. /*    system-dependent file name definitions
  6. /* PROJECT
  7. /*    pc-mail
  8. /* PACKAGE
  9. /*    general
  10. /* SYNOPSIS
  11. /*    #include "path.h"
  12. /* DESCRIPTION
  13. /*    File-system dependent definitions should be changed here.
  14. /* .nf
  15.  
  16. /* /* the minmal number of open files we think we need */
  17.  
  18. #define    MINFILES    10
  19.  
  20. /* /*    system-dependent defaults */
  21.  
  22. #ifdef    unix
  23. #define    THISDIR        "."        /* current directory */
  24. #define    DEFSPOOL    "./spool"    /* default spool directory */
  25. #define    DEFEDIT        "vi"        /* default editor */
  26. #ifdef SIII
  27. #define    DEFPRINT    "lp"        /* printer spooler */
  28. #else
  29. #define    DEFPRINT    "lpr"        /* printer spooler */
  30. #endif
  31. #define    MAILFILE    "mail.msg"    /* temporary message file */
  32. #define    TMPALIAS    "tmp.alias"    /* temp alias file */
  33. #define    NULLDEV        "/dev/null"    /* bit dump */
  34. #endif
  35.  
  36. #ifdef    MSDOS
  37. #define    THISDIR        "."        /* current directory */
  38. #define    DEFSPOOL    "\\spool"    /* spool directory */
  39. #define    DEFEDIT        "edlin"        /* default editor */
  40. #define DEFPRINT    "PRN"        /* default printer */
  41. #define    MAILFILE    "mail.msg"    /* temp message file */
  42. #define    TMPALIAS    "alias.tmp"    /* temp alias file */
  43. #define    NULLDEV        "NUL"        /* bit dump */
  44. #endif
  45.  
  46. /* /* system-dependent function calls for file & printer access */
  47.  
  48. #ifdef unix
  49. #define    propen()    popen(mailprn,"w")    /* open printe stream */
  50. #define    prclose(p)    pclose(p)        /* close print stream */
  51. #define    fspool(file)    strcons("%s/%s",maildir,file)
  52. #endif
  53.  
  54. #ifdef MSDOS
  55. #define    propen()    fopen(mailprn,"a")    /* open print stream */
  56. #define    prclose(p)    (putc('\014',p),fclose(p)) /* close print stream */
  57. #define    fspool(file)    strcons("%s\\%s",maildir,file)
  58. #endif
  59.  
  60. /* /* system-independent file names */
  61.  
  62. #define    SMAIL    "smail"            /* queues a mail message */
  63. #define    CICO    "cico"            /* file transfer program */
  64. #define    RMAIL    "rmail"            /* extract originator address */
  65.  
  66. /* /*
  67. * The spool directory is used for storage of all files manipulated
  68. * by the mail programs. Message files should always have a meta file
  69. * with information about the destination or origin of a message file.
  70. *
  71. * Message/meta file names are of the form <letter><sequence number>.
  72. * Corresponding message/meta files have the same sequene number.
  73. * The following definitions are for the <letter> part of spool files.
  74. */
  75.  
  76. #define    LOGFILE    "LOGFILE"        /* transaction logs */
  77.  
  78. #define    NEWPFX    "n"            /* received message */
  79. #define    HDRPFX    "h"            /* originator of new mail */
  80. #define    OLDPFX    "o"            /* originator of old mail */
  81.  
  82. #define    MSGPFX    "d"            /* message ready to be sent */
  83. #define    XQTPFX    "x"            /* its destination */
  84.  
  85. #define    EDTPFX    "e"            /* message being worked on */
  86. #define    COMPFX    "c"            /* its description */
  87.  
  88. #define    SETPFX    "s"            /* system parameter file */
  89.  
  90. #define    ALIPFX    "a"            /* alias data base */
  91.  
  92. #define    SPLFMT    "%s%05d"        /* spool-file name format */
  93.  
  94. /* /* 
  95. * The following macros provide convenient access of spool files, so we
  96. * don't have to remember the spool file name format and prefix stuff.
  97. */
  98.  
  99. #define    sendmail(file,to)    spoolfil(file,to,MSGPFX,XQTPFX)
  100. #define    workon(fname,meta)    spoolfil(fname,meta,EDTPFX,COMPFX)
  101.  
  102. #define    parm_file()        fspool(strcons(SPLFMT,SETPFX,0))
  103. #define    aliases()        fspool(strcons(SPLFMT,ALIPFX,0))
  104. #define logfile()        fspool(LOGFILE)
  105.  
  106. #define meta_file(type,id)    fspool(strcons(SPLFMT,type,id))
  107. #define mesg_file(type,id)    fspool(strcons(SPLFMT,type,id))
  108.  
  109. #define    work_meta(id)        fspool(strcons(SPLFMT,COMPFX,id))
  110. #define    work_mesg(id)        fspool(strcons(SPLFMT,EDTPFX,id))
  111.  
  112. #define    in_mesg(id)        fspool(strcons(SPLFMT,NEWPFX,id))
  113. #define    in_meta(id)        fspool(strcons(SPLFMT,OLDPFX,id))
  114.  
  115. #define    new_mesg(id)        fspool(strcons(SPLFMT,NEWPFX,id))
  116. #define    new_meta(id)        fspool(strcons(SPLFMT,HDRPFX,id))
  117.  
  118. #define    out_mesg(id)        fspool(strcons(SPLFMT,MSGPFX,id))
  119. #define out_meta(id)        fspool(strcons(SPLFMT,XQTPFX,id))
  120.  
  121. /* /* stuff taken from the environment */
  122.  
  123. extern char *editor;        /* path to editor */
  124. extern char *maildir;        /* spool directory */
  125. extern char *mailprn;        /* how to print */
  126. extern char *mailcmd;        /* do this on exit */
  127.  
  128. extern int pathinit();        /* get path info from environment */
  129. /* AUTHOR(S)
  130. /*    W.Z. Venema
  131. /*    Eindhoven University of Technology
  132. /*    Department of Mathematics and Computer Science
  133. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  134. /* CREATION DATE
  135. /*    Sun Apr  5 13:23:45 GMT+1:00 1987
  136. /* LAST MODIFICATION
  137. /*    Wed Apr  6 00:21:29 MET 1988
  138. /* VERSION/RELEASE
  139. /*    1.4
  140. /*--*/
  141.