McAfee MEJCAE-AM-DA Product Guide - Page 83

PGPeBiz, Syntax, Parameters, Notes

Page 83 highlights

Using the E-Business Server API E-Business Server API functions PGPeBiz Specifies an E-Business Server command. Output buffers for stdout and stderr may be optionally specified. Syntax PGPInt32 PGPeBiz( PGPeBizContextRef context, const char *args, const PGPByte *stdIn, PGPUInt32 stdInLen, PGPByte **stdOut, PGPUInt32 *stdOutLen, PGPByte **stdErr, PGPUInt32 *stdErrLen); Parameters context The context value from PGPeBizInit(). args A null-terminated string containing the command-line arguments for the operation you want to perform. The string contains the arguments exactly as they would be entered on the command line, except for shell extensions, which should not be included since they will not be processed. For example, piping or redirecting input or output should not be included. stdIn stdInLen stdOut The data for the E-Business Server API to use as stdin. This input parameter is optional. Since the data might be binary, the value is not null-terminated. If NULL (0) is specified, then no stdin data will be used. Input parameter that specifies the number of bytes passed in via the parameter. A buffer, internally allocated by the program, that receives the data normally written to stdout (displayed on the screen). This output parameter is optional. If NULL is passed in, then the stdout data is not returned. If NULL is not passed in, then this buffer must be freed by calling PGPeBizFree(). stdOutLen stdErr stdErrLen Output parameter that specifies the length of data, in bytes, placed in the stdOut buffer. A buffer, allocated internally by the program, that receives the data normally written to stderr (displayed on the screen). This output parameter is optional. If NULL is passed in, then the stderr data is not returned. If NULL is not passed in, then this buffer must be freed by calling . Output parameter that specifies the length of data, in bytes, placed in the buffer. Notes The return code for this API is the exit code that is normally set by the E-Business Server executable. Additionally, a few API-specific return codes may be returned that indicate input parameter errors. The output buffers may be useful in diagnosing these errors. A return code of zero indicates success. A non-zero return code indicates an error of some kind. Note that even if the return code is non-zero, the stdOut and stdErr parameters may contain data. The contents of these buffers will usually assist in diagnosing the problem. Unlike the command-line interface, the API does not provide a way to prompt the user for more data. If E-Business Server does not have all the information it needs to complete the call (that is, if it gets to a point where the executable would prompt for user input), then the call will fail and return a useful error code. A possible use for the stdIn parameter would be to pass encrypted data to an API encrypt command without first storing it to disk. 81 E-Business Server™ 8.6 Product Guide

  • 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
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188

81
E-Business Server
8.6
Product Guide
Using the E-Business Server API
E-Business Server API functions
PGPeBiz
Specifies an E-Business Server command. Output buffers for stdout and stderr may be optionally specified.
Syntax
PGPInt32 PGPeBiz(
PGPeBizContextRef context,
const char *args,
const PGPByte *stdIn,
PGPUInt32 stdInLen,
PGPByte **stdOut,
PGPUInt32 *stdOutLen,
PGPByte **stdErr,
PGPUInt32 *stdErrLen);
Parameters
Notes
The return code for this API is the exit code that is normally set by the E-Business Server executable.
Additionally, a few API-specific return codes may be returned that indicate input parameter errors. The
output buffers may be useful in diagnosing these errors.
A return code of zero indicates success. A non-zero return code indicates an error of some kind. Note that
even if the return code is non-zero, the
stdOut
and
stdErr
parameters may contain data. The contents of
these buffers will usually assist in diagnosing the problem.
Unlike the command-line interface, the API does not provide a way to prompt the user for more data. If
E-Business Server does not have all the information it needs to complete the call (that is, if it gets to a point
where the executable would prompt for user input), then the call will fail and return a useful error code.
A possible use for the
stdIn
parameter would be to pass encrypted data to an API encrypt command without
first storing it to disk.
context
The context value from
PGPeBizInit()
.
args
A null-terminated string containing the command-line arguments for the operation you want
to perform. The string contains the arguments exactly as they would be entered on the
command line, except for shell extensions, which should not be included since they will not
be processed. For example, piping or redirecting input or output should not be included.
stdIn
The data for the E-Business Server API to use as stdin. This input parameter is optional. Since
the data might be binary, the value is not null-terminated. If NULL (0) is specified, then no
stdin data will be used
.
stdInLen
Input parameter that specifies the number of bytes passed in via the
parameter
.
stdOut
A buffer, internally allocated by the program, that receives the data normally written to
stdout (displayed on the screen). This output parameter is optional. If NULL is passed in, then
the stdout data is not returned. If NULL is not passed in, then this buffer must be freed by
calling
PGPeBizFree()
.
stdOutLen
Output parameter that specifies the length of data, in bytes, placed in the
stdOut
buffer.
stdErr
A buffer, allocated internally by the program, that receives the data normally written to
stderr (displayed on the screen). This output parameter is optional. If NULL is passed in, then
the stderr data is not returned. If NULL is not passed in, then this buffer must be freed by
calling
.
stdErrLen
Output parameter that specifies the length of data, in bytes, placed in the
buffer
.