~mimose/+junk/hplip-3.16.11

« back to all changes in this revision

Viewing changes to scan/sane/http.h

  • Committer: guoyalong
  • Date: 2017-09-20 10:13:05 UTC
  • Revision ID: guoyalong@kylinos.cn-20170920101305-82zaolzpv1qghz29
Modified debian/control & debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/************************************************************************************\
 
2
 
 
3
  http.h - HTTP/1.1 feeder and consumer
 
4
 
 
5
  (c) 2008 Copyright HP Development Company, LP
 
6
 
 
7
  Permission is hereby granted, free of charge, to any person obtaining a copy 
 
8
  of this software and associated documentation files (the "Software"), to deal 
 
9
  in the Software without restriction, including without limitation the rights 
 
10
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
 
11
  of the Software, and to permit persons to whom the Software is furnished to do 
 
12
  so, subject to the following conditions:
 
13
 
 
14
  The above copyright notice and this permission notice shall be included in all
 
15
  copies or substantial portions of the Software.
 
16
 
 
17
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
 
18
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 
 
19
  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 
 
20
  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 
 
21
  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 
 
22
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
23
 
 
24
  Primary Author: Naga Samrat Chowdary, Narla
 
25
  Contributing Author: Sarbeswar Meher
 
26
\************************************************************************************/
 
27
 
 
28
#ifndef _HTTP_H
 
29
#define _HTTP_H
 
30
 
 
31
enum HTTP_RESULT
 
32
{
 
33
   HTTP_R_OK = 0,
 
34
   HTTP_R_IO_ERROR,
 
35
   HTTP_R_EOF,
 
36
   HTTP_R_IO_TIMEOUT,
 
37
   HTTP_R_MALLOC_ERROR,
 
38
   HTTP_R_INVALID_BUF_SIZE,
 
39
};
 
40
 
 
41
# define ZERO_FOOTER "\r\n0\r\n\r\n"
 
42
 
 
43
typedef void * HTTP_HANDLE;
 
44
 
 
45
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_open(HPMUD_DEVICE dd, const char *hpmud_channel, HTTP_HANDLE *handle);
 
46
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_close(HTTP_HANDLE handle);
 
47
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_read_header(HTTP_HANDLE handle, void *data, int max_size, int sec_timout, int *bytes_read);
 
48
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_read_payload(HTTP_HANDLE handle, void *data, int max_size, int sec_timout, int *bytes_read);
 
49
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_read(HTTP_HANDLE handle, void *data, int max_size, int sec_timout, int *bytes_read);
 
50
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_read_size(HTTP_HANDLE handle, void *data, int max_size, int sec_timout, int *bytes_read);
 
51
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_write(HTTP_HANDLE handle, void *data, int data_size, int sec_timout);
 
52
enum HTTP_RESULT __attribute__ ((visibility ("hidden"))) http_read2(HTTP_HANDLE handle, void *data, int max_size, int tmo, int *bytes_read);
 
53
void __attribute__ ((visibility ("hidden"))) http_unchunk_data(char *buffer);
 
54
int __attribute__ ((visibility ("hidden"))) clear_stream(HTTP_HANDLE handle, void *data, int max_size, int *bytes_read);
 
55
#endif  // _HTTP_H
 
56
 
 
57