-
Notifications
You must be signed in to change notification settings - Fork 25
/
BigWigIO_8h.html
325 lines (313 loc) · 17.7 KB
/
BigWigIO_8h.html
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>libBigWig: BigWigIO.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">libBigWig
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle">
<div class="title">BigWigIO.h File Reference</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include <curl/curl.h></code><br />
</div>
<p><a href="BigWigIO_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structURL__t.html">URL_t</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">This structure holds the file pointers and buffers needed for raw access to local and remote files. <a href="structURL__t.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a53551ff2ef7a2c1b938e94ef9592ab66"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#a53551ff2ef7a2c1b938e94ef9592ab66">bigWigFile_type_enum</a> { <b>BWG_FILE</b> = 0,
<b>BWG_HTTP</b> = 1,
<b>BWG_HTTPS</b> = 2,
<b>BWG_FTP</b> = 3
}</td></tr>
<tr class="separator:a53551ff2ef7a2c1b938e94ef9592ab66"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8f6a5aa097c9af9925171dd43d688f26"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#a8f6a5aa097c9af9925171dd43d688f26">urlRead</a> (<a class="el" href="structURL__t.html">URL_t</a> *URL, void *buf, size_t bufSize)</td></tr>
<tr class="memdesc:a8f6a5aa097c9af9925171dd43d688f26"><td class="mdescLeft"> </td><td class="mdescRight">Reads data into the given buffer. <a href="#a8f6a5aa097c9af9925171dd43d688f26">More...</a><br /></td></tr>
<tr class="separator:a8f6a5aa097c9af9925171dd43d688f26"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a55a1fcb43f68a2b3c3a2b66a6459a0a8"><td class="memItemLeft" align="right" valign="top">CURLcode </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#a55a1fcb43f68a2b3c3a2b66a6459a0a8">urlSeek</a> (<a class="el" href="structURL__t.html">URL_t</a> *URL, size_t pos)</td></tr>
<tr class="memdesc:a55a1fcb43f68a2b3c3a2b66a6459a0a8"><td class="mdescLeft"> </td><td class="mdescRight">Seeks to a given position in a local or remote file. <a href="#a55a1fcb43f68a2b3c3a2b66a6459a0a8">More...</a><br /></td></tr>
<tr class="separator:a55a1fcb43f68a2b3c3a2b66a6459a0a8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8583139627ed0a732e6d9b4f80231c87"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structURL__t.html">URL_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#a8583139627ed0a732e6d9b4f80231c87">urlOpen</a> (char *fname, CURLcode(*callBack)(CURL *), const char *mode)</td></tr>
<tr class="memdesc:a8583139627ed0a732e6d9b4f80231c87"><td class="mdescLeft"> </td><td class="mdescRight">Open a local or remote file. <a href="#a8583139627ed0a732e6d9b4f80231c87">More...</a><br /></td></tr>
<tr class="separator:a8583139627ed0a732e6d9b4f80231c87"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:add8705cdab8e6f2193a50bf095f08470"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#add8705cdab8e6f2193a50bf095f08470">urlClose</a> (<a class="el" href="structURL__t.html">URL_t</a> *URL)</td></tr>
<tr class="memdesc:add8705cdab8e6f2193a50bf095f08470"><td class="mdescLeft"> </td><td class="mdescRight">Close a local/remote file. <a href="#add8705cdab8e6f2193a50bf095f08470">More...</a><br /></td></tr>
<tr class="separator:add8705cdab8e6f2193a50bf095f08470"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a2f4038b5ef0a0e7dc45a20fc0bb83925"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="BigWigIO_8h.html#a2f4038b5ef0a0e7dc45a20fc0bb83925">GLOBAL_DEFAULTBUFFERSIZE</a></td></tr>
<tr class="separator:a2f4038b5ef0a0e7dc45a20fc0bb83925"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>These are (typically internal) IO functions, so there's generally no need for you to directly use them! </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="a53551ff2ef7a2c1b938e94ef9592ab66"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="BigWigIO_8h.html#a53551ff2ef7a2c1b938e94ef9592ab66">bigWigFile_type_enum</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The enumerated values that indicate the connection type used to access a file. </p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="add8705cdab8e6f2193a50bf095f08470"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void urlClose </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structURL__t.html">URL_t</a> * </td>
<td class="paramname"><em>URL</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Close a local/remote file. </p>
<p>This will perform the cleanup required on a URL_t*, releasing memory as needed.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">URL</td><td>A <a class="el" href="structURL__t.html" title="This structure holds the file pointers and buffers needed for raw access to local and remote files...">URL_t</a> * pointing to a valid opened file or remote URL.</td></tr>
</table>
</dd>
</dl>
<dl class="section warning"><dt>Warning</dt><dd>URL will no longer point to a valid location in memory! </dd></dl>
</div>
</div>
<a class="anchor" id="a8583139627ed0a732e6d9b4f80231c87"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structURL__t.html">URL_t</a>* urlOpen </td>
<td>(</td>
<td class="paramtype">char * </td>
<td class="paramname"><em>fname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">CURLcode(*)(CURL *) </td>
<td class="paramname"><em>callBack</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>mode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open a local or remote file. </p>
<p>Opens a local or remote file. Currently, http, https, and ftp are the only supported protocols and the URL must then begin with "http://", "https://", or "ftp://" as appropriate.</p>
<p>For remote files, an internal buffer is used to hold file contents, to avoid downloading entire files before starting. The size of this buffer and various variable related to connection timeout are set with <a class="el" href="bigWig_8h.html#a4aa7fa5e6146a2719feb8815c9bccd62" title="Initializes curl and global variables. This MUST be called before other functions (at least if you wa...">bwInit()</a>.</p>
<p>Note that you <b>must</b> run <a class="el" href="BigWigIO_8h.html#add8705cdab8e6f2193a50bf095f08470" title="Close a local/remote file. ">urlClose()</a> on this when finished. However, you would typically just use <a class="el" href="bigWig_8h.html#a55e46bf04f13da31a3971044b85c9243" title="Opens a local or remote bigWig file. This will open a local or remote bigWig file. Writing of local bigWig files is also supported. ">bwOpen()</a> rather than directly calling this function.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">fname</td><td>The file name or URL to open. </td></tr>
<tr><td class="paramname">callBack</td><td>An optional user-supplied function. This is applied to remote connections so users can specify things like proxy and password information. </td></tr>
<tr><td class="paramname">mode</td><td>"r", "w" or NULL. If and only if the mode contains the character "w" will the file be opened for writing.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A <a class="el" href="structURL__t.html" title="This structure holds the file pointers and buffers needed for raw access to local and remote files...">URL_t</a> * or NULL on error. </dd></dl>
</div>
</div>
<a class="anchor" id="a8f6a5aa097c9af9925171dd43d688f26"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t urlRead </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structURL__t.html">URL_t</a> * </td>
<td class="paramname"><em>URL</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>bufSize</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads data into the given buffer. </p>
<p>This function will store bufSize data into buf for both local and remote files. For remote files an internal buffer is used to store a (typically larger) segment of the remote file.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">URL</td><td>A <a class="el" href="structURL__t.html" title="This structure holds the file pointers and buffers needed for raw access to local and remote files...">URL_t</a> * pointing to a valid opened file or remote URL. </td></tr>
<tr><td class="paramname">buf</td><td>The buffer in memory that you would like filled. It must be able to hold bufSize bytes! </td></tr>
<tr><td class="paramname">bufSize</td><td>The number of bytes to transfer to buf.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the number of bytes stored in buf, which should be bufSize on success and something else on error.</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>Note that on error, URL for remote files is left in an unusable state. You can get around this by running <a class="el" href="BigWigIO_8h.html#a55a1fcb43f68a2b3c3a2b66a6459a0a8" title="Seeks to a given position in a local or remote file. ">urlSeek()</a> to a position outside of the range held by the internal buffer. </dd></dl>
</div>
</div>
<a class="anchor" id="a55a1fcb43f68a2b3c3a2b66a6459a0a8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CURLcode urlSeek </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structURL__t.html">URL_t</a> * </td>
<td class="paramname"><em>URL</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>pos</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Seeks to a given position in a local or remote file. </p>
<p>For local files, this will set the file position indicator for the file pointer to the desired position. For remote files, it sets the position to start downloading data for the next <a class="el" href="BigWigIO_8h.html#a8f6a5aa097c9af9925171dd43d688f26" title="Reads data into the given buffer. ">urlRead()</a>. Note that for remote files that running <a class="el" href="BigWigIO_8h.html#a55a1fcb43f68a2b3c3a2b66a6459a0a8" title="Seeks to a given position in a local or remote file. ">urlSeek()</a> with a pos within the current buffer will simply modify the internal offset.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">URL</td><td>A <a class="el" href="structURL__t.html" title="This structure holds the file pointers and buffers needed for raw access to local and remote files...">URL_t</a> * pointing to a valid opened file or remote URL. </td></tr>
<tr><td class="paramname">pos</td><td>The position to seek to.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CURLE_OK on success and a different CURLE_XXX on error. For local files, the error return value is always CURLE_FAILED_INIT </dd></dl>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a class="anchor" id="a2f4038b5ef0a0e7dc45a20fc0bb83925"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t GLOBAL_DEFAULTBUFFERSIZE</td>
</tr>
</table>
</div><div class="memdoc">
<p>The size of the buffer used for remote files. </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jul 15 2017 14:46:21 for libBigWig by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>