Changeset 5ebff60 for lib/http_client.h


Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/http_client.h

    raf359b4 r5ebff60  
    1   /********************************************************************\
     1/********************************************************************\
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
     
    2828   response to come back. Initially written for MS Passport authentication,
    2929   but used for many other things now like OAuth and Twitter.
    30    
     30
    3131   It's very useful for doing quick requests without blocking the whole
    3232   program. Unfortunately it doesn't support fancy stuff like HTTP keep-
     
    3838struct http_request;
    3939
    40 typedef enum http_client_flags
    41 {
     40typedef enum http_client_flags {
    4241        HTTPC_STREAMING = 1,
    4342        HTTPC_EOF = 2,
    4443        HTTPC_CHUNKED = 4,
    45        
     44
    4645        /* Let's reserve 0x1000000+ for lib users. */
    4746} http_client_flags_t;
    4847
    4948/* Your callback function should look like this: */
    50 typedef void (*http_input_function)( struct http_request * );
     49typedef void (*http_input_function)(struct http_request *);
    5150
    5251/* This structure will be filled in by the http_dorequest* functions, and
    5352   it will be passed to the callback function. Use the data field to add
    5453   your own data. */
    55 struct http_request
    56 {
     54struct http_request {
    5755        char *request;          /* The request to send to the server. */
    5856        int request_length;     /* Its size. */
     
    6563        short redir_ttl;        /* You can set it to 0 if you don't want
    6664                                   http_client to follow them. */
    67        
     65
    6866        http_client_flags_t flags;
    69        
     67
    7068        http_input_function func;
    7169        gpointer data;
    72        
     70
    7371        /* Please don't touch the things down here, you shouldn't need them. */
    7472        void *ssl;
    7573        int fd;
    76        
     74
    7775        int inpa;
    7876        int bytes_written;
    7977        int bytes_read;
    8078        int content_length;     /* "Content-Length:" header or -1 */
    81        
     79
    8280        /* Used in streaming mode. Caller should read from reply_body. */
    8381        char *sbuf;
    8482        size_t sblen;
    85        
     83
    8684        /* Chunked encoding only. Raw chunked stream is decoded from here. */
    8785        char *cbuf;
     
    9391   you want to add some extra headers. As you can see, HTTPS connections
    9492   are also supported (using ssl_client). */
    95 struct http_request *http_dorequest( char *host, int port, int ssl, char *request, http_input_function func, gpointer data );
    96 struct http_request *http_dorequest_url( char *url_string, http_input_function func, gpointer data );
     93struct http_request *http_dorequest(char *host, int port, int ssl, char *request, http_input_function func,
     94                                    gpointer data);
     95struct http_request *http_dorequest_url(char *url_string, http_input_function func, gpointer data);
    9796
    9897/* For streaming connections only; flushes len bytes at the start of the buffer. */
    99 void http_flush_bytes( struct http_request *req, size_t len );
    100 void http_close( struct http_request *req );
     98void http_flush_bytes(struct http_request *req, size_t len);
     99void http_close(struct http_request *req);
Note: See TracChangeset for help on using the changeset viewer.