Back to index

courier  0.68.2
comsubmitclient.h
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2004 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #ifndef       comsubmitclient_h
00007 #define comsubmitclient_h
00008 
00009 #include      "courier.h"
00010 #include      <stdio.h>
00011 
00012 #ifdef __cplusplus
00013 extern "C" {
00014 #endif
00015 
00016 extern FILE *submit_to;
00017 extern FILE *fromsubmit;
00018 
00019 /* Start a submit child process. */
00020 
00021 int submit_fork(
00022        char **,             /* argv */
00023        char **,             /* envp */
00024        void (*)(const char *)); /* Print function */
00025 void submit_print_stdout(const char *);
00026               /* This is suitable for the print function arg */
00027 
00028 /* Write a command to the submit process. */
00029 
00030 void submit_write_message(
00031               const char *);       /* null terminated string, NOT \n terminated */
00032 
00033 /*
00034        Read response from the submit process.
00035 
00036        submit_readrc -- just read it.
00037        submit_readrcprint -- read it and print the response
00038        submit_readrcpritncrlf - read it and print the response, lines 
00039                                 terminated by CRLF
00040 
00041        submit_readrcprinterr -- read it and print only error responses
00042 */
00043 
00044 int submit_readrc();
00045 int submit_readrcprint();
00046 int submit_readrcprinterr();
00047 int submit_readrcprintcrlf();
00048 
00049 /* Log errors, with the following prefix: */
00050 
00051 void submit_log_error_prefix( void (*)(void) );
00052               /* This function will generate the prefix. */
00053 
00054 /* Wait for the submit process to terminate. */
00055 
00056 int submit_wait();
00057 
00058 /* Kills the submit process */
00059 
00060 void submit_cancel();
00061 
00062 void submit_cancel_async(); /* This can be called from a signal handler,
00063               just before we exit on a signal */
00064 
00065 
00066 void submit_set_teergrube(void (*)(void));
00067        /* Set callback function on an error, used to implement teergrube */
00068 
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072 
00073 #endif