1: /* config.c - master MH configuration file */
   2: 
   3: /* @(MHWARNING) */
   4: 
   5: /* LINTLIBRARY */
   6: 
   7: #include "../h/mh.h"
   8: #ifdef  MHRC
   9: #include <pwd.h>
  10: #endif	MHRC
  11: #include <stdio.h>
  12: 
  13: 
  14: #define binpath(file) "@(MHBINPATH)/file"
  15: #define etcpath(file) "@(MHETCPATH)/file"
  16: 
  17: 
  18: @(MHCONFIG)
  19: 
  20: 
  21: #ifdef  MHRC
  22: #ifdef  SYS5
  23: struct passwd *getpwnam ();
  24: #endif	SYS5
  25: #endif	MHRC
  26: 
  27: /*  */
  28: 
  29: static    char lpath[BUFSIZ];
  30: 
  31: char   *libpath (file)
  32: char   *file;
  33: {
  34:     char   *cp;
  35: #ifdef  MHRC
  36:     char   *pp;
  37:     struct passwd  *pw;
  38: #endif	MHRC
  39: 
  40: #ifdef  MHRC
  41:     m_getdefs ();
  42: #endif	MHRC
  43: 
  44:     switch (*file) {
  45:     case '/':
  46:         return file;
  47: 
  48: #ifdef  MHRC
  49:     case '~':
  50:         if (cp = index (pp = file + 1, '/'))
  51:         *cp++ = NULL;
  52:         if (*pp == NULL)
  53:         pp = mypath;
  54:         else
  55:         if (pw = getpwnam (pp))
  56:             pp = pw -> pw_dir;
  57:         else {
  58:             if (cp)
  59:             *--cp = '/';
  60:             goto try_it;
  61:         }
  62: 
  63:         (void) sprintf (lpath, "%s/%s", pp, cp ? cp : "");
  64:         if (cp)
  65:         *--cp = '/';
  66: 
  67:         if (access (lpath, 04) != NOTOK)
  68:         return lpath;   /* else fall */
  69:     try_it: ;
  70: #endif	MHRC
  71: 
  72:     default:
  73:         if (access ((cp = m_maildir (file)), 04) != NOTOK)
  74:         return cp;
  75:     }
  76: 
  77:     (void) sprintf (lpath, etcpath (%s), file);
  78:     return (access (lpath, 04) != NOTOK ? lpath : file);
  79: }
  80: 
  81: /*  */
  82: 
  83: /*
  84:  * Standard yes/no switches structure
  85:  */
  86: 
  87: struct swit anoyes[] = {
  88:     "no", 0,
  89:     "yes", 0,
  90:     NULL, NULL
  91: };
  92: 
  93: /*  */
  94: 
  95: /*
  96:  * MH constants
  97:  */
  98: 
  99: char   *components = "components";
 100: char   *current = "cur";
 101: char   *defalt = "inbox";
 102: char   *digestcomps = "digestcomps";
 103: char   *distcomps = "distcomps";
 104: char   *draft = "draft";
 105: char   *forwcomps = "forwcomps";
 106: char   *mh_defaults = etcpath (mh.profile);
 107: char   *mh_profile = ".mh_profile";
 108: char   *mhlformat = "mhl.format";
 109: char   *mhlforward = "mhl.forward";
 110: char   *nsequence = "Sequence-Negation";
 111: char   *pfolder = "Current-Folder";
 112: char   *psequence = "Previous-Sequence";
 113: char   *rcvdistcomps = "rcvdistcomps";
 114: char   *replcomps = "replcomps";
 115: char   *usequence = "Unseen-Sequence";
 116: 
 117: 
 118: /*
 119:  * MH not-so constants
 120:  */
 121: 
 122: char   *context = "context";
 123: #ifndef NOMHSEQ
 124: char   *mh_seq = ".mh_sequences";
 125: #else   NOMHSEQ
 126: char   *mh_seq = NULL;
 127: #endif	NOMHSEQ
 128: 
 129: 
 130: /*
 131:  * MH globals
 132:  */
 133: 
 134: char    ctxflags;       /* status of user's context */
 135: 
 136: char   *invo_name;      /* pgm invocation name */
 137: char   *mypath;         /* user's $HOME */
 138: char   *defpath;        /* pathname of user's profile */
 139: char   *ctxpath;        /* pathname of user's context */
 140: 
 141: struct node *m_defs;        /* profile/context structure */
 142: 
 143: /*  */
 144: 
 145: /*
 146:  * MH processes
 147:  */
 148: 
 149: 
 150: /*
 151:  * This program is usually called directly by users, but it is
 152:  * also invoked by the post program to process an "fcc".
 153:  */
 154: 
 155: char   *fileproc = binpath (refile);
 156: 
 157: 
 158: /*
 159:  * This program is called to incorporate messages into a folder.
 160:  */
 161: 
 162: char   *incproc = binpath (inc);
 163: 
 164: 
 165: /*
 166:  * When a user runs an MH program for the first time, this program
 167:  * is called to create his MH profile, and mail directory.
 168:  */
 169: 
 170: char   *installproc = etcpath (install-mh);
 171: 
 172: 
 173: /*
 174:  * This is the program invoked by a "list" response to "What now?"
 175:  *  whereas, showproc is the program invoked by show, next, prev.
 176:  */
 177: 
 178: #ifndef MORE
 179: char   *lproc = "/usr/ucb/more";
 180: #else   MORE
 181: char   *lproc = MORE;
 182: #endif	MORE
 183: 
 184: 
 185: /*
 186:  * This is the path for the Bell equivalent mail program.
 187:  */
 188: 
 189: char   *mailproc = binpath (mhmail);
 190: 
 191: 
 192: /*
 193:  * mhl runs this program as a front-end.
 194:  */
 195: 
 196: #ifndef MORE
 197: char   *moreproc = "/usr/ucb/more";
 198: #else   MORE
 199: char   *moreproc = MORE;
 200: #endif	MORE
 201: 
 202: 
 203: /*
 204:  * This program is mhl - the nifty message lister
 205:  */
 206: 
 207: char    *mhlproc = etcpath (mhl);
 208: 
 209: 
 210: /*
 211:  * This is the super handy BBoard reading program, which is really just the MH
 212:  * shell program
 213:  */
 214: 
 215: char    *mshproc = binpath (msh);
 216: 
 217: 
 218: /*
 219:  * This program is called to pack a folder.
 220:  */
 221: 
 222: char   *packproc = binpath (packf);
 223: 
 224: 
 225: /*
 226:  * This is the delivery program called through send to
 227:  * actually deliver mail to users.  This is the interface to
 228:  * the MTS.
 229:  */
 230: 
 231: #if BERK && SENDMTS
 232: char   *postproc = etcpath (spost);
 233: #else
 234: char   *postproc = etcpath (post);
 235: #endif BERK
 236: 
 237: 
 238: /*
 239:  * This program is called to remove a folder.
 240:  */
 241: 
 242: char   *rmfproc = binpath (rmf);
 243: 
 244: 
 245: /*
 246:  * This program is called to remove a message by rmm or refile -nolink.
 247:  * It's usually empty, which means to rename the file to a backup name.
 248:  */
 249: 
 250: char   *rmmproc = NULL;
 251: 
 252: 
 253: /*
 254:  * This program is usually called by the user's whatnowproc, but it
 255:  * may also be called directly to send a message previously composed.
 256:  */
 257: 
 258: char   *sendproc = binpath (send);
 259: 
 260: 
 261: /*
 262:  * This program is called to list messages by the show program.
 263:  * By setting showproc to mhl, the user can run mhl instead.
 264:  */
 265: 
 266: #ifndef MORE
 267: char   *showproc = "/usr/ucb/more";
 268: #else   MORE
 269: char   *showproc = MORE;
 270: #endif	MORE
 271: 
 272: 
 273: /*
 274:  * This program is called under stand-alone MH to deliver a message to
 275:  * a local user.  Under other MTS's it can be used to emulate a
 276:  * MMDF-II .maildelivery mechanism.
 277:  */
 278: 
 279: char   *slocalproc = etcpath (slocal);
 280: 
 281: 
 282: /*
 283:  * This program is called by vmh as the back-end to the window management
 284:  * protocol
 285:  */
 286: 
 287: char    *vmhproc = binpath (msh);
 288: 
 289: 
 290: /*
 291:  * This program is called after comp, et. al., have built a draft
 292:  */
 293: 
 294: char    *whatnowproc = binpath (whatnow);
 295: 
 296: 
 297: /*
 298:  * This program is called to list/validate the addresses in a message.
 299:  */
 300: 
 301: char    *whomproc = binpath (whom);
 302: 
 303: /*  */
 304: 
 305: /*
 306:  * This is the editor invoked by the various message composition
 307:  * programs.  It SHOULD be a 2-D scope editor, such as Rand's ned
 308:  * or Berkeley's ex, but any editor will work.  We use prompter as
 309:  * the default, since with -prepend it works just fine with forw.
 310:  */
 311: 
 312: char   *sysed = "@(MHEDITOR)";
 313: 
 314: 
 315: /*
 316:  * This is the MH alias file.
 317:  */
 318: 
 319: char   *AliasFile = etcpath (MailAliases);
 320: 
 321: /*  */
 322: 
 323: /*
 324:  * File protections
 325:  */
 326: 
 327: 
 328: /*
 329:  * Folders (directories) are created with this protection (mode)
 330:  */
 331: 
 332: #ifndef FOLDPROT
 333: #define FOLDPROT    "0711"
 334: #endif	not FOLDPROT
 335: 
 336: char   *foldprot = FOLDPROT;
 337: 
 338: 
 339: /*
 340:  * Every NEW message will be created with this protection.  When a
 341:  * message is filed it retains its protection, so this only applies
 342:  * to messages coming in through inc.
 343:  */
 344: 
 345: #ifndef MSGPROT
 346: #define MSGPROT     "0644"
 347: #endif	not MSGPROT
 348: 
 349: char   *msgprot = MSGPROT;

Defined functions

libpath defined in line 31; never used

Defined variables

AliasFile defined in line 319; never used
anoyes defined in line 87; never used
components defined in line 99; never used
context defined in line 122; never used
ctxflags defined in line 134; never used
ctxpath defined in line 139; never used
current defined in line 100; never used
defalt defined in line 101; never used
defpath defined in line 138; never used
digestcomps defined in line 102; never used
distcomps defined in line 103; never used
draft defined in line 104; never used
fileproc defined in line 155; never used
foldprot defined in line 336; never used
forwcomps defined in line 105; never used
incproc defined in line 162; never used
installproc defined in line 170; never used
invo_name defined in line 136; never used
lpath defined in line 29; used 6 times
lproc defined in line 181; never used
m_defs defined in line 141; never used
mailproc defined in line 189; never used
mh_defaults defined in line 106; never used
mh_profile defined in line 107; never used
mh_seq defined in line 126; never used
mhlformat defined in line 108; never used
mhlforward defined in line 109; never used
mhlproc defined in line 207; never used
moreproc defined in line 199; never used
msgprot defined in line 349; never used
mshproc defined in line 215; never used
mypath defined in line 137; used 1 times
  • in line 53
nsequence defined in line 110; never used
packproc defined in line 222; never used
pfolder defined in line 111; never used
postproc defined in line 234; never used
psequence defined in line 112; never used
rcvdistcomps defined in line 113; never used
replcomps defined in line 114; never used
rmfproc defined in line 242; never used
rmmproc defined in line 250; never used
sendproc defined in line 258; never used
showproc defined in line 269; never used
slocalproc defined in line 279; never used
sysed defined in line 312; never used
usequence defined in line 115; never used
vmhproc defined in line 287; never used
whatnowproc defined in line 294; never used
whomproc defined in line 301; never used

Defined macros

FOLDPROT defined in line 333; used 2 times
MSGPROT defined in line 346; used 2 times
binpath defined in line 14; used 10 times
etcpath defined in line 15; used 8 times
Last modified: 1986-04-21
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1766
Valid CSS Valid XHTML 1.0 Strict