| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658 |
- .\" WARNING! THIS FILE WAS GENERATED AUTOMATICALLY BY c2man!
- .\" DO NOT EDIT! CHANGES MADE TO THIS FILE WILL BE LOST!
- .TH "http_lib" 3 "25 April 1996" "c2man http_lib.c"
- .SH "NAME"
- http_server,
- http_port,
- http_proxy_server,
- http_proxy_port,
- http_put,
- http_get,
- http_head,
- http_delete,
- http_parse_url \- Http data exchanges mini library.
- .SH "SYNOPSIS"
- .ft B
- #include "http_lib.h"
- .br
- .sp
- extern char *http_server;
- .sp
- extern int http_port;
- .sp
- extern char *http_proxy_server;
- .sp
- extern int http_proxy_port;
- .sp
- http_retcode http_put
- .br
- (
- .br
- char *filename,
- .br
- char *data,
- .br
- int length,
- .br
- int overwrite,
- .br
- char *type
- .br
- );
- .sp
- http_retcode http_get
- .br
- (
- .br
- char *filename,
- .br
- char **pdata,
- .br
- int *plength,
- .br
- char *typebuf
- .br
- );
- .sp
- http_retcode http_head
- .br
- (
- .br
- char *filename,
- .br
- int *plength,
- .br
- char *typebuf
- .br
- );
- .sp
- http_retcode http_delete(char *filename);
- .sp
- http_retcode http_parse_url
- .br
- (
- .br
- char *url,
- .br
- char **pfilename
- .br
- );
- .ft R
- .SH "PARAMETERS"
- .TP
- .BR "char *filename" " (http_put)"
- Name of the ressource to create.
- .TP
- .B "char *data"
- Pointer to the data to send.
- .TP
- .B "int length"
- Length of the data to send.
- .TP
- .B "int overwrite"
- Flag to request to overwrite the ressource if it
- was already existing.
- .TP
- .B "char *type"
- Type of the data, if NULL default type is used.
- .TP
- .BR "char *filename" " (http_get)"
- Name of the ressource to read.
- .TP
- .B "char **pdata"
- Address of a pointer variable which will be set
- to point toward allocated memory containing read data.
- .TP
- .BR "int *plength" " (http_get)"
- Address of integer variable which will be set to
- length of the read data.
- .TP
- .BR "char *typebuf" " (http_get)"
- Allocated buffer where the read data type is returned.
- If NULL, the type is not returned.
- .TP
- .BR "int *plength" " (http_head)"
- Address of integer variable which will be set to
- length of the data.
- .TP
- .BR "char *typebuf" " (http_head)"
- Allocated buffer where the data type is returned.
- If NULL, the type is not returned.
- .TP
- .B "char *url"
- Writeable copy of an url.
- .TP
- .B "char **pfilename"
- Address of a pointer that will be filled with allocated filename
- the pointer must be equal to NULL before calling or it will be
- automatically freed (free(3)).
- .SH "DESCRIPTION"
- .SS "http_server"
- Pointer to a mallocated string containing server name or NULL.
- .SS "http_port"
- Server port number.
- .SS "http_proxy_server"
- Pointer to proxy server name or NULL.
- .SS "http_proxy_port"
- Proxy server port number or 0.
- .SS "http_put"
- Put data on the server
- This function sends data to the http data server.
- The data will be stored under the ressource name filename.
- .SS "http_get"
- Get data from the server
- This function gets data from the http data server.
- The data is read from the ressource named filename.
- Address of new new allocated memory block is filled in pdata
- whose length is returned via plength.
- .SS "http_head"
- Request the header
- This function outputs the header of thehttp data server.
- The header is from the ressource named filename.
- The length and type of data is eventually returned (like for http_get(3)).
- .SS "http_delete"
- Delete data on the server
- This function request a DELETE on the http data server.
- .SS "http_parse_url"
- Parses an url : setting the http_server and http_port global variables
- and returning the filename to pass to http_get/put/...
- .SH "RETURNS"
- .SS "http_put"
- A negative error code or a positive code from the server.
- .sp
- Possible values for a \fBhttp_retcode\fR are as follows:
- .IP
- Client side errors.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERRHOST\fR
- No such host.
- .TP \n(TLu
- \fBERRSOCK\fR
- Can't create socket.
- .TP \n(TLu
- \fBERRCONN\fR
- Can't connect to host.
- .TP \n(TLu
- \fBERRWRHD\fR
- Write error on socket while writing header.
- .TP \n(TLu
- \fBERRWRDT\fR
- Write error on socket while writing data.
- .TP \n(TLu
- \fBERRRDHD\fR
- Read error on socket while reading result.
- .TP \n(TLu
- \fBERRPAHD\fR
- Invalid answer from data server.
- .TP \n(TLu
- \fBERRNULL\fR
- Null data pointer.
- .TP \n(TLu
- \fBERRNOLG\fR
- No/Bad length in header.
- .TP \n(TLu
- \fBERRMEM\fR
- Can't allocate memory.
- .TP \n(TLu
- \fBERRRDDT\fR
- Read error while reading data.
- .TP \n(TLu
- \fBERRURLH\fR
- Invalid url - must start with 'http://'.
- .TP \n(TLu
- \fBERRURLP\fR
- Invalid port in url.
- .RE
- .PD
- .IP
- Return code by the server.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERR400\fR
- Invalid query.
- .TP \n(TLu
- \fBERR403\fR
- Forbidden.
- .TP \n(TLu
- \fBERR408\fR
- Request timeout.
- .TP \n(TLu
- \fBERR500\fR
- Server error.
- .TP \n(TLu
- \fBERR501\fR
- Not implemented.
- .TP \n(TLu
- \fBERR503\fR
- Service overloaded.
- .RE
- .PD
- .IP
- Succesful results.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBOK0\fR
- Successfull parse.
- .TP \n(TLu
- \fBOK201\fR
- Ressource succesfully created.
- .TP \n(TLu
- \fBOK200\fR
- Ressource succesfully read.
- .RE
- .PD
- .SS "http_get"
- A negative error code or a positive code from the server.
- .sp
- Possible values for a \fBhttp_retcode\fR are as follows:
- .IP
- Client side errors.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERRHOST\fR
- No such host.
- .TP \n(TLu
- \fBERRSOCK\fR
- Can't create socket.
- .TP \n(TLu
- \fBERRCONN\fR
- Can't connect to host.
- .TP \n(TLu
- \fBERRWRHD\fR
- Write error on socket while writing header.
- .TP \n(TLu
- \fBERRWRDT\fR
- Write error on socket while writing data.
- .TP \n(TLu
- \fBERRRDHD\fR
- Read error on socket while reading result.
- .TP \n(TLu
- \fBERRPAHD\fR
- Invalid answer from data server.
- .TP \n(TLu
- \fBERRNULL\fR
- Null data pointer.
- .TP \n(TLu
- \fBERRNOLG\fR
- No/Bad length in header.
- .TP \n(TLu
- \fBERRMEM\fR
- Can't allocate memory.
- .TP \n(TLu
- \fBERRRDDT\fR
- Read error while reading data.
- .TP \n(TLu
- \fBERRURLH\fR
- Invalid url - must start with 'http://'.
- .TP \n(TLu
- \fBERRURLP\fR
- Invalid port in url.
- .RE
- .PD
- .IP
- Return code by the server.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERR400\fR
- Invalid query.
- .TP \n(TLu
- \fBERR403\fR
- Forbidden.
- .TP \n(TLu
- \fBERR408\fR
- Request timeout.
- .TP \n(TLu
- \fBERR500\fR
- Server error.
- .TP \n(TLu
- \fBERR501\fR
- Not implemented.
- .TP \n(TLu
- \fBERR503\fR
- Service overloaded.
- .RE
- .PD
- .IP
- Succesful results.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBOK0\fR
- Successfull parse.
- .TP \n(TLu
- \fBOK201\fR
- Ressource succesfully created.
- .TP \n(TLu
- \fBOK200\fR
- Ressource succesfully read.
- .RE
- .PD
- .SS "http_head"
- A negative error code or a positive code from the server.
- .sp
- Possible values for a \fBhttp_retcode\fR are as follows:
- .IP
- Client side errors.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERRHOST\fR
- No such host.
- .TP \n(TLu
- \fBERRSOCK\fR
- Can't create socket.
- .TP \n(TLu
- \fBERRCONN\fR
- Can't connect to host.
- .TP \n(TLu
- \fBERRWRHD\fR
- Write error on socket while writing header.
- .TP \n(TLu
- \fBERRWRDT\fR
- Write error on socket while writing data.
- .TP \n(TLu
- \fBERRRDHD\fR
- Read error on socket while reading result.
- .TP \n(TLu
- \fBERRPAHD\fR
- Invalid answer from data server.
- .TP \n(TLu
- \fBERRNULL\fR
- Null data pointer.
- .TP \n(TLu
- \fBERRNOLG\fR
- No/Bad length in header.
- .TP \n(TLu
- \fBERRMEM\fR
- Can't allocate memory.
- .TP \n(TLu
- \fBERRRDDT\fR
- Read error while reading data.
- .TP \n(TLu
- \fBERRURLH\fR
- Invalid url - must start with 'http://'.
- .TP \n(TLu
- \fBERRURLP\fR
- Invalid port in url.
- .RE
- .PD
- .IP
- Return code by the server.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERR400\fR
- Invalid query.
- .TP \n(TLu
- \fBERR403\fR
- Forbidden.
- .TP \n(TLu
- \fBERR408\fR
- Request timeout.
- .TP \n(TLu
- \fBERR500\fR
- Server error.
- .TP \n(TLu
- \fBERR501\fR
- Not implemented.
- .TP \n(TLu
- \fBERR503\fR
- Service overloaded.
- .RE
- .PD
- .IP
- Succesful results.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBOK0\fR
- Successfull parse.
- .TP \n(TLu
- \fBOK201\fR
- Ressource succesfully created.
- .TP \n(TLu
- \fBOK200\fR
- Ressource succesfully read.
- .RE
- .PD
- .SS "http_delete"
- A negative error code or a positive code from the server.
- .sp
- Possible values for a \fBhttp_retcode\fR are as follows:
- .IP
- Client side errors.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERRHOST\fR
- No such host.
- .TP \n(TLu
- \fBERRSOCK\fR
- Can't create socket.
- .TP \n(TLu
- \fBERRCONN\fR
- Can't connect to host.
- .TP \n(TLu
- \fBERRWRHD\fR
- Write error on socket while writing header.
- .TP \n(TLu
- \fBERRWRDT\fR
- Write error on socket while writing data.
- .TP \n(TLu
- \fBERRRDHD\fR
- Read error on socket while reading result.
- .TP \n(TLu
- \fBERRPAHD\fR
- Invalid answer from data server.
- .TP \n(TLu
- \fBERRNULL\fR
- Null data pointer.
- .TP \n(TLu
- \fBERRNOLG\fR
- No/Bad length in header.
- .TP \n(TLu
- \fBERRMEM\fR
- Can't allocate memory.
- .TP \n(TLu
- \fBERRRDDT\fR
- Read error while reading data.
- .TP \n(TLu
- \fBERRURLH\fR
- Invalid url - must start with 'http://'.
- .TP \n(TLu
- \fBERRURLP\fR
- Invalid port in url.
- .RE
- .PD
- .IP
- Return code by the server.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERR400\fR
- Invalid query.
- .TP \n(TLu
- \fBERR403\fR
- Forbidden.
- .TP \n(TLu
- \fBERR408\fR
- Request timeout.
- .TP \n(TLu
- \fBERR500\fR
- Server error.
- .TP \n(TLu
- \fBERR501\fR
- Not implemented.
- .TP \n(TLu
- \fBERR503\fR
- Service overloaded.
- .RE
- .PD
- .IP
- Succesful results.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBOK0\fR
- Successfull parse.
- .TP \n(TLu
- \fBOK201\fR
- Ressource succesfully created.
- .TP \n(TLu
- \fBOK200\fR
- Ressource succesfully read.
- .RE
- .PD
- .SS "http_parse_url"
- A negative error code or 0 if sucessfully parsed.
- .sp
- Possible values for a \fBhttp_retcode\fR are as follows:
- .IP
- Client side errors.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERRHOST\fR
- No such host.
- .TP \n(TLu
- \fBERRSOCK\fR
- Can't create socket.
- .TP \n(TLu
- \fBERRCONN\fR
- Can't connect to host.
- .TP \n(TLu
- \fBERRWRHD\fR
- Write error on socket while writing header.
- .TP \n(TLu
- \fBERRWRDT\fR
- Write error on socket while writing data.
- .TP \n(TLu
- \fBERRRDHD\fR
- Read error on socket while reading result.
- .TP \n(TLu
- \fBERRPAHD\fR
- Invalid answer from data server.
- .TP \n(TLu
- \fBERRNULL\fR
- Null data pointer.
- .TP \n(TLu
- \fBERRNOLG\fR
- No/Bad length in header.
- .TP \n(TLu
- \fBERRMEM\fR
- Can't allocate memory.
- .TP \n(TLu
- \fBERRRDDT\fR
- Read error while reading data.
- .TP \n(TLu
- \fBERRURLH\fR
- Invalid url - must start with 'http://'.
- .TP \n(TLu
- \fBERRURLP\fR
- Invalid port in url.
- .RE
- .PD
- .IP
- Return code by the server.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBERR400\fR
- Invalid query.
- .TP \n(TLu
- \fBERR403\fR
- Forbidden.
- .TP \n(TLu
- \fBERR408\fR
- Request timeout.
- .TP \n(TLu
- \fBERR500\fR
- Server error.
- .TP \n(TLu
- \fBERR501\fR
- Not implemented.
- .TP \n(TLu
- \fBERR503\fR
- Service overloaded.
- .RE
- .PD
- .IP
- Succesful results.
- .RS 0.75in
- .PD 0
- .ft B
- .nr TL \w'ERRHOST'u+0.2i
- .ft R
- .TP \n(TLu
- \fBOK0\fR
- Successfull parse.
- .TP \n(TLu
- \fBOK201\fR
- Ressource succesfully created.
- .TP \n(TLu
- \fBOK200\fR
- Ressource succesfully read.
- .RE
- .PD
- .SH "LIMITATIONS"
- .SS "http_put"
- Filename is truncated to first 256 characters
- and type to 64.
- .SS "http_get"
- Filename is truncated to first 256 characters.
- .SS "http_head"
- Filename is truncated to first 256 characters.
- .SS "http_delete"
- Filename is truncated to first 256 characters.
|