about summary refs log tree commit diff
path: root/lib/pm_system.h
blob: a7560f48e0006327ea94a246eff22eedc10c4d2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef PM_SYSTEM_H_INCLUDED
#define PM_SYSTEM_H_INCLUDED

#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* to fake out automatic code indenters */
#endif


void
pm_system_vp(const char *    const progName,
             const char **   const argArray,
             void stdinFeeder(int, void *),
             void *          const feederParm,
             void stdoutAccepter(int, void *),
             void *          const accepterParm);

void
pm_system_lp(const char *    const progName,
             void stdinFeeder(int, void *),
             void *          const feederParm,
             void stdoutAccepter(int, void *),
             void *          const accepterParm,
             ...);

void
pm_system(void                  stdinFeeder(int, void *),
          void *          const feederParm,
          void                  stdoutAccepter(int, void *),
          void *          const accepterParm,
          const char *    const shellCommand);

struct bufferDesc {
    /* This is just a parameter for the routines below */
    unsigned int    size;
    unsigned char * buffer;
    unsigned int *  bytesTransferredP;
};


/* The following are a Standard Input feeder and a Standard Output accepter
   for pm_system().  
*/
void
pm_feed_from_memory(int    const pipeToFeedFd,
                    void * const feederParm);

void
pm_accept_to_memory(int    const pipetosuckFd,
                    void * const accepterParm);

#ifdef __cplusplus
}
#endif

#endif