home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume10 / pcmail2 / part01 / main / submit.c < prev    next >
C/C++ Source or Header  |  1990-01-24  |  2KB  |  73 lines

  1. /*++
  2. /* NAME
  3. /*    submit 3
  4. /* SUMMARY
  5. /*    queue a message for transfer over the network
  6. /* PROJECT
  7. /*    pc-mail
  8. /* PACKAGE
  9. /*    mail
  10. /* SYNOPSIS
  11. /*    int submit(file,to)
  12. /*    char *file;
  13. /*    char *to;
  14. /* DESCRIPTION
  15. /*    submit() invokes the smail command to prepare a message for
  16. /*    transmission across the network. file is the name of a file
  17. /*    with a message; to is a string with one or more destinations,
  18. /*    separated by blanks. The to string is modified.
  19. /* FUNCTIONS AND MACROS
  20. /*    invokevp()
  21. /* COMMANDS
  22. /*    smail, alias processing and queueing
  23. /* FILES
  24. /*    d<seqno>    message file
  25. /*    x<seqno>    destination
  26. /* SEE ALSO
  27. /*    path(5)        spool file names
  28. /*    status(5)    error status codes
  29. /* DIAGNOSTICS
  30. /*    A nonzero error status is returned in case of problems.
  31. /* BUGS
  32. /*    On some non-Unix systems the limit on the command-line length
  33. /*    may cause problems.
  34. /* AUTHOR(S)
  35. /*    W.Z. Venema
  36. /*    Eindhoven University of Technology
  37. /*    Department of Mathematics and Computer Science
  38. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  39. /* CREATION DATE
  40. /*    Sat Apr  9 17:48:03 MET 1988
  41. /* LAST MODIFICATION
  42. /*    90/01/22 13:02:44
  43. /* VERSION/RELEASE
  44. /*    2.1
  45. /*--*/
  46.  
  47. #include <stdio.h>
  48.  
  49. #include "defs.h"
  50. #include "path.h"
  51.  
  52. public int submit(file, to)
  53. char   *file;
  54. char   *to;
  55. {
  56. #ifdef    lint
  57.     static
  58. #endif
  59.     char   *arglist[BUFSIZ];
  60.     register char **cpp = arglist;
  61.     static char sep[] = ", \t";
  62.  
  63.     /* Build the argment vector for the smail command */
  64.  
  65.     *cpp++ = SMAIL;
  66.     *cpp++ = file;
  67.  
  68.     for (*cpp = strtok(to, sep); *cpp; *++cpp = strtok((char *) 0, sep))
  69.      /* void */ ;
  70.  
  71.     return (invokevp(arglist));
  72. }
  73.