Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/nsIOutputStream.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/io/nsIOutputStream.idl
3
 */
4
5
#ifndef __gen_nsIOutputStream_h__
6
#define __gen_nsIOutputStream_h__
7
8
9
#ifndef __gen_nsISupports_h__
10
#include "nsISupports.h"
11
#endif
12
13
#include "js/GCAnnotations.h"
14
15
/* For IDL files that don't want to include root IDL files. */
16
#ifndef NS_NO_VTABLE
17
#define NS_NO_VTABLE
18
#endif
19
class nsIOutputStream; /* forward declaration */
20
21
class nsIInputStream; /* forward declaration */
22
23
/**
24
 * The signature for the reader function passed to WriteSegments. This 
25
 * is the "provider" of data that gets written into the stream's buffer.
26
 *
27
 * @param aOutStream stream being written to
28
 * @param aClosure opaque parameter passed to WriteSegments
29
 * @param aToSegment pointer to memory owned by the output stream
30
 * @param aFromOffset amount already written (since WriteSegments was called)
31
 * @param aCount length of toSegment
32
 * @param aReadCount number of bytes written
33
 *
34
 * Implementers should return the following:
35
 *
36
 * @throws <any-error> if not interested in providing any data
37
 *
38
 * Errors are never passed to the caller of WriteSegments.
39
 */
40
typedef nsresult (*nsReadSegmentFun)(nsIOutputStream *aOutStream,
41
                                     void *aClosure,
42
                                     char *aToSegment,
43
                                     uint32_t aFromOffset,
44
                                     uint32_t aCount,
45
                                     uint32_t *aReadCount);
46
47
/* starting interface:    nsIOutputStream */
48
#define NS_IOUTPUTSTREAM_IID_STR "0d0acd2a-61b4-11d4-9877-00c04fa0cf4a"
49
50
#define NS_IOUTPUTSTREAM_IID \
51
  {0x0d0acd2a, 0x61b4, 0x11d4, \
52
    { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}
53
54
class NS_NO_VTABLE nsIOutputStream : public nsISupports {
55
 public:
56
57
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOUTPUTSTREAM_IID)
58
59
  /* void close (); */
60
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Close(void) = 0;
61
62
  /* void flush (); */
63
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Flush(void) = 0;
64
65
  /* unsigned long write (in string aBuf, in unsigned long aCount); */
66
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Write(const char * aBuf, uint32_t aCount, uint32_t *_retval) = 0;
67
68
  /* unsigned long writeFrom (in nsIInputStream aFromStream, in unsigned long aCount); */
69
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) = 0;
70
71
  /* [noscript] unsigned long writeSegments (in nsReadSegmentFun aReader, in voidPtr aClosure, in unsigned long aCount); */
72
  NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void * aClosure, uint32_t aCount, uint32_t *_retval) = 0;
73
74
  /* boolean isNonBlocking (); */
75
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD IsNonBlocking(bool *_retval) = 0;
76
77
};
78
79
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIOutputStream, NS_IOUTPUTSTREAM_IID)
80
81
/* Use this macro when declaring classes that implement this interface. */
82
#define NS_DECL_NSIOUTPUTSTREAM \
83
  NS_IMETHOD Close(void) override; \
84
  NS_IMETHOD Flush(void) override; \
85
  NS_IMETHOD Write(const char * aBuf, uint32_t aCount, uint32_t *_retval) override; \
86
  NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) override; \
87
  NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void * aClosure, uint32_t aCount, uint32_t *_retval) override; \
88
  NS_IMETHOD IsNonBlocking(bool *_retval) override; 
89
90
/* Use this macro when declaring the members of this interface when the
91
   class doesn't implement the interface. This is useful for forwarding. */
92
#define NS_DECL_NON_VIRTUAL_NSIOUTPUTSTREAM \
93
  nsresult Close(void); \
94
  nsresult Flush(void); \
95
  nsresult Write(const char * aBuf, uint32_t aCount, uint32_t *_retval); \
96
  nsresult WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval); \
97
  nsresult WriteSegments(nsReadSegmentFun aReader, void * aClosure, uint32_t aCount, uint32_t *_retval); \
98
  nsresult IsNonBlocking(bool *_retval); 
99
100
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
101
#define NS_FORWARD_NSIOUTPUTSTREAM(_to) \
102
0
  NS_IMETHOD Close(void) override { return _to Close(); } \
103
0
  NS_IMETHOD Flush(void) override { return _to Flush(); } \
104
0
  NS_IMETHOD Write(const char * aBuf, uint32_t aCount, uint32_t *_retval) override { return _to Write(aBuf, aCount, _retval); } \
105
0
  NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) override { return _to WriteFrom(aFromStream, aCount, _retval); } \
106
0
  NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void * aClosure, uint32_t aCount, uint32_t *_retval) override { return _to WriteSegments(aReader, aClosure, aCount, _retval); } \
107
0
  NS_IMETHOD IsNonBlocking(bool *_retval) override { return _to IsNonBlocking(_retval); } 
108
109
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
110
#define NS_FORWARD_SAFE_NSIOUTPUTSTREAM(_to) \
111
  NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
112
  NS_IMETHOD Flush(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Flush(); } \
113
  NS_IMETHOD Write(const char * aBuf, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Write(aBuf, aCount, _retval); } \
114
  NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteFrom(aFromStream, aCount, _retval); } \
115
  NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void * aClosure, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteSegments(aReader, aClosure, aCount, _retval); } \
116
  NS_IMETHOD IsNonBlocking(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNonBlocking(_retval); } 
117
118
119
#endif /* __gen_nsIOutputStream_h__ */