Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/nsIInputStream.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /src/mozilla-central/xpcom/io/nsIInputStream.idl
3
 */
4
5
#ifndef __gen_nsIInputStream_h__
6
#define __gen_nsIInputStream_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 nsIInputStream; /* forward declaration */
20
21
/**
22
 * The signature of the writer function passed to ReadSegments. This
23
 * is the "consumer" of data that gets read from the stream's buffer.
24
 *
25
 * @param aInStream stream being read
26
 * @param aClosure opaque parameter passed to ReadSegments
27
 * @param aFromSegment pointer to memory owned by the input stream.  This is
28
 *                     where the writer function should start consuming data.
29
 * @param aToOffset amount of data already consumed by this writer during this
30
 *                  ReadSegments call.  This is also the sum of the aWriteCount
31
 *                  returns from this writer over the previous invocations of
32
 *                  the writer by this ReadSegments call.
33
 * @param aCount Number of bytes available to be read starting at aFromSegment
34
 * @param [out] aWriteCount number of bytes read by this writer function call
35
 *
36
 * Implementers should return the following:
37
 *
38
 * @return NS_OK and (*aWriteCount > 0) if consumed some data
39
 * @return <any-error> if not interested in consuming any data
40
 *
41
 * Errors are never passed to the caller of ReadSegments.
42
 *
43
 * NOTE: returning NS_OK and (*aWriteCount = 0) has undefined behavior.
44
 */
45
typedef nsresult (*nsWriteSegmentFun)(nsIInputStream *aInStream,
46
                                      void *aClosure,
47
                                      const char *aFromSegment,
48
                                      uint32_t aToOffset,
49
                                      uint32_t aCount,
50
                                      uint32_t *aWriteCount);
51
52
/* starting interface:    nsIInputStream */
53
#define NS_IINPUTSTREAM_IID_STR "53cdbc97-c2d7-4e30-b2c3-45b2ee79db18"
54
55
#define NS_IINPUTSTREAM_IID \
56
  {0x53cdbc97, 0xc2d7, 0x4e30, \
57
    { 0xb2, 0xc3, 0x45, 0xb2, 0xee, 0x79, 0xdb, 0x18 }}
58
59
class NS_NO_VTABLE nsIInputStream : public nsISupports {
60
 public:
61
62
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAM_IID)
63
64
  /* void close (); */
65
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Close(void) = 0;
66
67
  /* unsigned long long available (); */
68
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD Available(uint64_t *_retval) = 0;
69
70
  /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
71
  NS_IMETHOD Read(char * aBuf, uint32_t aCount, uint32_t *_retval) = 0;
72
73
  /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
74
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, uint32_t aCount, uint32_t *_retval) = 0;
75
76
  /* boolean isNonBlocking (); */
77
  JS_HAZ_CAN_RUN_SCRIPT NS_IMETHOD IsNonBlocking(bool *_retval) = 0;
78
79
};
80
81
  NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStream, NS_IINPUTSTREAM_IID)
82
83
/* Use this macro when declaring classes that implement this interface. */
84
#define NS_DECL_NSIINPUTSTREAM \
85
  NS_IMETHOD Close(void) override; \
86
  NS_IMETHOD Available(uint64_t *_retval) override; \
87
  NS_IMETHOD Read(char * aBuf, uint32_t aCount, uint32_t *_retval) override; \
88
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, uint32_t aCount, uint32_t *_retval) override; \
89
  NS_IMETHOD IsNonBlocking(bool *_retval) override; 
90
91
/* Use this macro when declaring the members of this interface when the
92
   class doesn't implement the interface. This is useful for forwarding. */
93
#define NS_DECL_NON_VIRTUAL_NSIINPUTSTREAM \
94
  nsresult Close(void); \
95
  nsresult Available(uint64_t *_retval); \
96
  nsresult Read(char * aBuf, uint32_t aCount, uint32_t *_retval); \
97
  nsresult ReadSegments(nsWriteSegmentFun aWriter, 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_NSIINPUTSTREAM(_to) \
102
0
  NS_IMETHOD Close(void) override { return _to Close(); } \
Unexecuted instantiation: nsFileStream::Close()
Unexecuted instantiation: mozilla::dom::MemoryBlobImpl::DataOwnerAdapter::Close()
103
0
  NS_IMETHOD Available(uint64_t *_retval) override { return _to Available(_retval); } \
Unexecuted instantiation: nsFileStream::Available(unsigned long*)
Unexecuted instantiation: mozilla::dom::MemoryBlobImpl::DataOwnerAdapter::Available(unsigned long*)
104
0
  NS_IMETHOD Read(char * aBuf, uint32_t aCount, uint32_t *_retval) override { return _to Read(aBuf, aCount, _retval); } \
Unexecuted instantiation: nsFileStream::Read(char*, unsigned int, unsigned int*)
Unexecuted instantiation: mozilla::dom::MemoryBlobImpl::DataOwnerAdapter::Read(char*, unsigned int, unsigned int*)
105
0
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, uint32_t aCount, uint32_t *_retval) override { return _to ReadSegments(aWriter, aClosure, aCount, _retval); } \
Unexecuted instantiation: nsFileStream::ReadSegments(nsresult (*)(nsIInputStream*, void*, char const*, unsigned int, unsigned int, unsigned int*), void*, unsigned int, unsigned int*)
Unexecuted instantiation: mozilla::dom::MemoryBlobImpl::DataOwnerAdapter::ReadSegments(nsresult (*)(nsIInputStream*, void*, char const*, unsigned int, unsigned int, unsigned int*), void*, unsigned int, unsigned int*)
106
0
  NS_IMETHOD IsNonBlocking(bool *_retval) override { return _to IsNonBlocking(_retval); } 
Unexecuted instantiation: nsFileStream::IsNonBlocking(bool*)
Unexecuted instantiation: mozilla::dom::MemoryBlobImpl::DataOwnerAdapter::IsNonBlocking(bool*)
107
108
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
109
#define NS_FORWARD_SAFE_NSIINPUTSTREAM(_to) \
110
0
  NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
111
0
  NS_IMETHOD Available(uint64_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
112
0
  NS_IMETHOD Read(char * aBuf, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aBuf, aCount, _retval); } \
113
0
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void * aClosure, uint32_t aCount, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadSegments(aWriter, aClosure, aCount, _retval); } \
114
0
  NS_IMETHOD IsNonBlocking(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNonBlocking(_retval); } 
115
116
117
#endif /* __gen_nsIInputStream_h__ */