home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / communic / pcmail / main / submit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  1.8 KB  |  145 lines

  1. /*++
  2.  
  3. /* NAME
  4.  
  5. /*    submit 3
  6.  
  7. /* SUMMARY
  8.  
  9. /*    queue a message for transfer over the network
  10.  
  11. /* PROJECT
  12.  
  13. /*    pc-mail
  14.  
  15. /* PACKAGE
  16.  
  17. /*    mail
  18.  
  19. /* SYNOPSIS
  20.  
  21. /*    int submit(file,to)
  22.  
  23. /*    char *file;
  24.  
  25. /*    char *to;
  26.  
  27. /* DESCRIPTION
  28.  
  29. /*    submit() invokes the smail command to prepare a message for
  30.  
  31. /*    transmission across the network. file is the name of a file
  32.  
  33. /*    with a message; to is a string with one or more destinations,
  34.  
  35. /*    separated by blanks. The to string is modified.
  36.  
  37. /* FUNCTIONS AND MACROS
  38.  
  39. /*    invokevp()
  40.  
  41. /* COMMANDS
  42.  
  43. /*    smail, alias processing and queueing
  44.  
  45. /* FILES
  46.  
  47. /*    d<seqno>    message file
  48.  
  49. /*    x<seqno>    destination
  50.  
  51. /* SEE ALSO
  52.  
  53. /*    path(5)        spool file names
  54.  
  55. /*    status(5)    error status codes
  56.  
  57. /* DIAGNOSTICS
  58.  
  59. /*    A nonzero error status is returned in case of problems.
  60.  
  61. /* BUGS
  62.  
  63. /*    On some non-Unix systems the limit on the command-line length
  64.  
  65. /*    may cause problems.
  66.  
  67. /* AUTHOR(S)
  68.  
  69. /*    W.Z. Venema
  70.  
  71. /*    Eindhoven University of Technology
  72.  
  73. /*    Department of Mathematics and Computer Science
  74.  
  75. /*    Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands
  76.  
  77. /* CREATION DATE
  78.  
  79. /*    Sat Apr  9 17:48:03 MET 1988
  80.  
  81. /* LAST MODIFICATION
  82.  
  83. /*    90/01/22 13:02:44
  84.  
  85. /* VERSION/RELEASE
  86.  
  87. /*    2.1
  88.  
  89. /*--*/
  90.  
  91.  
  92.  
  93. #include <stdio.h>
  94.  
  95.  
  96.  
  97. #include "defs.h"
  98.  
  99. #include "path.h"
  100.  
  101.  
  102.  
  103. public int submit(file, to)
  104.  
  105. char   *file;
  106.  
  107. char   *to;
  108.  
  109. {
  110.  
  111. #ifdef    lint
  112.  
  113.     static
  114.  
  115. #endif
  116.  
  117.     char   *arglist[BUFSIZ];
  118.  
  119.     register char **cpp = arglist;
  120.  
  121.     static char sep[] = ", \t";
  122.  
  123.  
  124.  
  125.     /* Build the argment vector for the smail command */
  126.  
  127.  
  128.  
  129.     *cpp++ = SMAIL;
  130.  
  131.     *cpp++ = file;
  132.  
  133.  
  134.  
  135.     for (*cpp = strtok(to, sep); *cpp; *++cpp = strtok((char *) 0, sep))
  136.  
  137.      /* void */ ;
  138.  
  139.  
  140.  
  141.     return (invokevp(arglist));
  142.  
  143. }
  144.  
  145.