~ubuntu-branches/ubuntu/trusty/enigmail/trusty-updates

« back to all changes in this revision

Viewing changes to extensions/enigmail/ipc/public/nsIPipeTransport.idl

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2011-06-07 14:35:53 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110607143553-fbgqhhvh8g8h6j1y
Tags: 2:1.2~a2~cvs20110606t2200-0ubuntu1
* Update to latest trunk snapshot for Thunderbird beta compat

* Remove build/pgo/profileserver.py from debian/clean. The new build
  system has a target depending on this
  - update debian/clean
* Drop debian/patches/autoconf.diff, just generate this at build time
* Refresh debian/patches/build_system_dont_link_libxul.diff
* libipc seems to be renamed to libipc-pipe. Fix genxpi and chrome.manifest
  to fix this 
  - add debian/patches/ipc-pipe_rename.diff
  - update debian/patches/series
* The makefiles in extensions/enigmail/ipc have an incorrect DEPTH
  attribute. Fix this so that they can find the rest of the build system
  - add debian/patches/makefile_depth.diff
  - update debian/patches/series
* Drop debian/patches/makefile-in-empty-xpcom-fix.diff - fixed in the
  current version
* Don't register a class ID multiple times, as this breaks enigmail entirely
  - add debian/patches/dont_register_cids_multiple_times.diff
  - update debian/patches/series
* Look for the Thunderbird 5 SDK
  - update debian/rules
  - update debian/control
* Run autoconf2.13 at build time
  - update debian/rules
  - update debian/control
* Add useless mesa-common-dev build-dep, just to satisfy the build system.
  We should just patch this out entirely really, but that's for another upload
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
 
1
/* ***** BEGIN LICENSE BLOCK *****
 
2
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 
3
 *
2
4
 * The contents of this file are subject to the Mozilla Public
3
5
 * License Version 1.1 (the "MPL"); you may not use this file
4
6
 * except in compliance with the MPL. You may obtain a copy of
18
20
 * Contributor(s):
19
21
 * Patrick Brunschwig <patrick@mozilla-enigmail.org>
20
22
 *
21
 
 * Alternatively, the contents of this file may be used under the
22
 
 * terms of the GNU General Public License (the "GPL"), in which case
23
 
 * the provisions of the GPL are applicable instead of
24
 
 * those above. If you wish to allow use of your version of this
25
 
 * file only under the terms of the GPL and not to allow
26
 
 * others to use your version of this file under the MPL, indicate
27
 
 * your decision by deleting the provisions above and replace them
28
 
 * with the notice and other provisions required by the GPL.
29
 
 * If you do not delete the provisions above, a recipient
30
 
 * may use your version of this file under either the MPL or the
31
 
 * GPL.
32
 
 */
33
 
 
34
 
#include "nsISupports.idl"
35
 
#include "nsIPipe.idl"
36
 
#include "nsIFile.idl"
37
 
#include "nsIRequest.idl"
 
23
 * Alternatively, the contents of this file may be used under the terms of
 
24
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 
25
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 
26
 * in which case the provisions of the GPL or the LGPL are applicable instead
 
27
 * of those above. If you wish to allow use of your version of this file only
 
28
 * under the terms of either the GPL or the LGPL, and not to allow others to
 
29
 * use your version of this file under the terms of the MPL, indicate your
 
30
 * decision by deleting the provisions above and replace them with the notice
 
31
 * and other provisions required by the GPL or the LGPL. If you do not delete
 
32
 * the provisions above, a recipient may use your version of this file under
 
33
 * the terms of any one of the MPL, the GPL or the LGPL.
 
34
 * ***** END LICENSE BLOCK ***** */
 
35
 
 
36
 
38
37
#include "nsIPipeListener.idl"
 
38
#include "nsIProcess.idl"
39
39
 
40
40
interface nsIRequest;
41
41
interface nsIFile;
44
44
interface nsIStreamListener;
45
45
interface nsIPipeTransportHeaders;
46
46
interface nsIPipeTransportListener;
 
47
interface nsIProcess;
47
48
 
48
49
%{C++
49
50
 
50
51
#include "IPCProcess.h"
51
52
 
52
53
#define NS_PIPETRANSPORT_CLASSNAME "Pipe Transport"
53
 
#define NS_PIPETRANSPORT_CONTRACTID "@mozilla.org/process/pipe-transport;1"
 
54
#define NS_PIPETRANSPORT_CONTRACTID "@mozilla.org/ipc/pipe-transport;1"
54
55
 
55
56
#define NS_PIPETRANSPORT_CID                     \
56
 
{ /* 8431e101-7ab1-11d4-8f02-006008948af5 */     \
 
57
{ /* 8431e101-7ab1-11d4-8f02-a06008948af5 */     \
57
58
   0x8431e101, 0x7ab1, 0x11d4,                   \
58
 
{0x8f, 0x02, 0x00, 0x60, 0x08, 0x94, 0x8a, 0xf5} }
 
59
{0x8f, 0x02, 0xa0, 0x60, 0x08, 0x94, 0x8a, 0xf5} }
59
60
 
60
61
%}
61
62
 
88
89
 *  that the listener/owner is already aware of the shutdown.)
89
90
 *
90
91
 */
91
 
[scriptable, uuid(8431e100-7ab1-11d4-8f02-006008948af5)]
92
 
interface nsIPipeTransport : nsIRequest
 
92
[scriptable, uuid(8431e100-7ab1-11d4-8f02-a06008948af5)]
 
93
interface nsIPipeTransport : nsIProcess
93
94
{
94
 
    /**
95
 
     * Old, oboslete version of init, kept for compatibility reasons
96
 
     * For parameters please refer to init above and open
97
 
     */
98
 
    void init(in nsIFile executable,
99
 
              [array, size_is(argCount)] in string args,
100
 
              in unsigned long argCount,
101
 
              [array, size_is(envCount)] in string env,
102
 
              in unsigned long envCount,
103
 
              in unsigned long timeoutMS,
104
 
              in string killString,
105
 
              in boolean noProxy,
106
 
              in boolean mergeStderr,
107
 
              in nsIPipeListener console);
108
95
 
109
96
    /**
110
97
     * Initializes PipeTransport by executing the specified file using the
118
105
     * @param startupFlags flags defining how the process should be created
119
106
     */
120
107
 
121
 
    void initialize(in nsIFile executable,
122
 
              in nsIFile cwd,
123
 
              in unsigned long startupFlags);
 
108
    void initWithWorkDir(in nsIFile executable,
 
109
                         in nsIFile cwd,
 
110
                         in unsigned long startupFlags);
124
111
 
125
112
    /**
126
113
     * Opens a PipeTransport by executing the specified file using the
129
116
     * full-featured channel, which will also act as an async stream
130
117
     * observer/listener and forward calls to the actual observer/listener.
131
118
     *
132
 
     * @param args        arguments string array
133
 
     *                    (excluding the executable path itself)
134
 
     * @param env         environment (variable=value) string array
135
 
     * @param timeoutMS   timeout (in milliseconds) after which the process
136
 
     *                    at the other end of the pipe can be assumed to be
137
 
     *                    dead
138
 
     *                    (if == 0, a default value, usually an hour, is used)
139
 
     * @param killString  string to be transmitted to process before it is
140
 
     *                    killed (specify null string, if none)
141
 
     * @param noProxy     do not use proxy for async callback
142
 
     *                    (must use join to terminate process, in this case)
143
 
     * @param mergeStderr merge STDERR with STDOUT
144
 
     * @param console     nsIPipeListener object to capture STDERR
 
119
     * @param args          arguments string array
 
120
     *                      (excluding the executable path itself)
 
121
     * @param env           environment (variable=value) string array
 
122
     * @param timeoutMS     timeout (in milliseconds) after which the process
 
123
     *                      at the other end of the pipe can be assumed to be
 
124
     *                      dead
 
125
     *                      (if == 0, a default value, usually an hour, is used)
 
126
     * @param killString    string to be transmitted to process before it is
 
127
     *                      killed (specify null string, if none)
 
128
     * @param noProxy       do not use proxy for async callback
 
129
     *                      (must use join to terminate process, in this case)
 
130
     * @param mergeStderr   merge STDERR with STDOUT
 
131
     * @param stderrConsole nsIPipeListener object to capture STDERR (required
 
132
     *                      if mergeStderr is false)
145
133
     */
146
 
    void open([array, size_is(argCount)] in string args,
147
 
              in unsigned long argCount,
148
 
              [array, size_is(envCount)] in string env,
149
 
              in unsigned long envCount,
150
 
              in unsigned long timeoutMS,
151
 
              in string killString,
152
 
              in boolean noProxy,
153
 
              in boolean mergeStderr,
154
 
              in nsIPipeListener console);
 
134
    void openPipe([array, size_is(argCount)] in wstring args,
 
135
                  in unsigned long argCount,
 
136
                  [array, size_is(envCount)] in wstring env,
 
137
                  in unsigned long envCount,
 
138
                  in unsigned long timeoutMS,
 
139
                  in string killString,
 
140
                  in boolean noProxy,
 
141
                  in boolean mergeStderr,
 
142
                  in nsIPipeListener stderrConsole);
155
143
 
156
144
    /**
157
145
     * detach process after start
160
148
    const long INHERIT_PROC_ATTRIBS   = 0x02;
161
149
 
162
150
    /**
163
 
     * Returns console object used to capture STDERR by default
 
151
     * Returns stderrConsole object used to capture STDERR by default
164
152
     */
165
 
    readonly attribute nsIPipeListener console;
 
153
    readonly attribute nsIPipeListener stderrConsole;
166
154
 
167
155
    /**
168
156
     * Returns listener object to feed data to STDIN
195
183
     * Open an output stream on this transport.
196
184
     *
197
185
     * @param offset - write starting at this offset
198
 
     * @param count  - write no more than this many bytes (pass PRUint32(-1) if unlimited)
 
186
     * @param count  - write no more than this many bytes (pass PRUint32(-1) if
 
187
     *                 unlimited)
199
188
     * @param flags  - optional transport specific flags
200
189
     */
201
190
    nsIOutputStream openOutputStream(in unsigned long offset,
218
207
                         in unsigned long flags);
219
208
 
220
209
    /**
221
 
     * Checks if process is still actively piping I/O
222
 
     */
223
 
    boolean isAttached();
224
 
 
225
 
    /**
226
210
     * Joins STDOUT handling thread (blocking until STDOUT is closed),
227
211
     * (Necessary and only works if noProxy is true)
228
212
     * The process still needs to be terminated to free resources.
230
214
    void join();
231
215
 
232
216
    /**
233
 
     * Terminates process, if active.
 
217
     * Terminates process, if active, by closing stdin/stdout/stderr.
234
218
     */
235
219
    void terminate();
236
220
 
237
221
    /**
238
 
     * Returns exit code of process which has exited;
239
 
     *  fails with an exception if process is still attached.
240
 
     */
241
 
    long exitCode();
242
 
 
243
 
    /**
244
222
     * Writes string to process STDIN (synchronously)
245
223
     * (Note: child process may exit for valid reasons even before
246
224
     *  the first call to writeSync, causing an an exception to be
262
240
                    in boolean closeAfterWrite);
263
241
 
264
242
    /**
265
 
     * Transmits command string to process, blocks for output and returns the
266
 
     * STDOUT response as a string up to maxChars (=-1 for unlimited) long,
267
 
     * delimited by an optional prompt.
268
 
     * If prompt begins with newline, that newline character is returned,
269
 
     * but the rest of the prompt string is not returned.
270
 
     * If clear is true, any prior data in STDOUT is cleared.
271
 
     */
272
 
 
273
 
    string execPrompt(in string command, in string prompt,
274
 
                      in long maxOutputLen, in boolean clearPrev);
275
 
 
276
 
 
277
 
    /**
278
243
     * Blocks for output and returns the first line from STDOUT
279
244
     * as a string, up to maxChars (=-1 for unlimited) long.
280
245
     * NOTE: This method is intended for short output; for longer
286
251
    attribute unsigned long bufferSegmentSize;
287
252
    attribute unsigned long bufferMaxSize;
288
253
    attribute unsigned long headersMaxSize;
289
 
 
290
254
};
291
255
 
292
256
 
 
257
/**
 
258
  * nsIPipeTransportHeaders is a helper interface to parse MIME headers as
 
259
  * specified by RFC 822.
 
260
  */
 
261
 
293
262
[scriptable, uuid(8431e110-7ab1-11d4-8f02-006008948af5)]
294
263
interface nsIPipeTransportHeaders : nsISupports
295
264
{
302
271
};
303
272
 
304
273
 
 
274
/**
 
275
  * nsIPipeTransportListener is a helper interface for nsIPipeTransport.
 
276
  * It is used to start and stop the listener stream of nsIPipeTransport.
 
277
  */
305
278
[scriptable, uuid(8431e120-7ab1-11d4-8f02-006008948af5)]
306
279
interface nsIPipeTransportListener : nsIPipeTransportHeaders
307
280
{
318
291
};
319
292
 
320
293
 
321
 
[noscript, uuid(8431e130-7ab1-11d4-8f02-006008948af5)]
322
 
interface nsIPipeTransportPoller : nsISupports
323
 
{
324
 
  /**
325
 
   * Starts polling of STDOUT
326
 
   */
327
 
  void asyncStart(in nsIOutputStream aOutputStream,
328
 
                  in nsIPipeTransportListener aProxyPipeObserver,
329
 
                  in boolean joinable,
330
 
                  in unsigned long aMimeHeadersMaxSize);
331
 
 
332
 
  /**
333
 
   * Interrupts polling thread.
334
 
   */
335
 
  boolean interrupt();
336
 
 
337
 
  /**
338
 
   * Returns true if polling thread has been interrupted/
339
 
   */
340
 
  boolean isInterrupted();
341
 
 
342
 
  /**
343
 
   * Joins polling thread, if joinable (blocking until it terminates)
344
 
   */
345
 
  void join();
346
 
 
347
 
  /**
348
 
   * Controls console logging of STDOUT from process
349
 
   */
350
 
  attribute boolean loggingEnabled;
351
 
};
352
 
 
353
 
 
354
 
[noscript, uuid(8431e190-7ab1-11d4-8f02-006008948af5)]
355
 
interface nsIPipeTransportWriter : nsISupports
356
 
{
357
 
  /**
358
 
   * writes count bytes from input stream to STDIN pipe (asynchronously) and
359
 
   * then closes the STDIN pipe
360
 
   */
361
 
  void writeFromStream(in nsIInputStream aFromStream,
362
 
                       in unsigned long aCount,
363
 
                       in IPCFileDescStar pipe,
364
 
                       in boolean closeAfterWrite);
365
 
                       
366
 
  /**
367
 
   * Joins writer thread, if joinable (blocking until it terminates)
368
 
   */
369
 
  void join();
370
 
};
371
 
 
372
 
 
373
294
///////////////////////////////////////////////////////////////////////////////