Changeset 5ebff60 for lib/oauth.h


Ignore:
Timestamp:
2015-02-20T22:50:54Z (5 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/oauth.h

    raf359b4 r5ebff60  
    2828/* Callback function called twice during the access token request process.
    2929   Return FALSE if something broke and the process must be aborted. */
    30 typedef gboolean (*oauth_cb)( struct oauth_info * );
     30typedef gboolean (*oauth_cb)(struct oauth_info *);
    3131
    32 typedef enum
    33 {
     32typedef enum {
    3433        OAUTH_INIT,
    3534        OAUTH_REQUEST_TOKEN,
     
    3736} oauth_stage_t;
    3837
    39 struct oauth_info
    40 {
     38struct oauth_info {
    4139        oauth_stage_t stage;
    4240        const struct oauth_service *sp;
    43        
     41
    4442        oauth_cb func;
    4543        void *data;
    46        
     44
    4745        struct http_request *http;
    48        
     46
    4947        char *auth_url;
    5048        char *request_token;
    51        
     49
    5250        char *token;
    5351        char *token_secret;
     
    5553};
    5654
    57 struct oauth_service
    58 {
     55struct oauth_service {
    5956        char *url_request_token;
    6057        char *url_access_token;
    6158        char *url_authorize;
    62        
     59
    6360        char *consumer_key;
    6461        char *consumer_secret;
    6562};
    6663
    67 /* http://oauth.net/core/1.0a/#auth_step1 (section 6.1) 
     64/* http://oauth.net/core/1.0a/#auth_step1 (section 6.1)
    6865   Request an initial anonymous token which can be used to construct an
    6966   authorization URL for the user. This is passed to the callback function
    7067   in a struct oauth_info. */
    71 struct oauth_info *oauth_request_token( const struct oauth_service *sp, oauth_cb func, void *data );
     68struct oauth_info *oauth_request_token(const struct oauth_service *sp, oauth_cb func, void *data);
    7269
    7370/* http://oauth.net/core/1.0a/#auth_step3 (section 6.3)
     
    7572   token. This is passed to the callback function in the same
    7673   struct oauth_info. */
    77 gboolean oauth_access_token( const char *pin, struct oauth_info *st );
     74gboolean oauth_access_token(const char *pin, struct oauth_info *st);
    7875
    7976/* http://oauth.net/core/1.0a/#anchor12 (section 7)
     
    8279   whatever's going to be in the POST body of the request. GET args will
    8380   automatically be grabbed from url. */
    84 char *oauth_http_header( struct oauth_info *oi, const char *method, const char *url, char *args );
     81char *oauth_http_header(struct oauth_info *oi, const char *method, const char *url, char *args);
    8582
    8683/* Shouldn't normally be required unless the process is aborted by the user. */
    87 void oauth_info_free( struct oauth_info *info );
     84void oauth_info_free(struct oauth_info *info);
    8885
    8986/* Convert to and back from strings, for easier saving. */
    90 char *oauth_to_string( struct oauth_info *oi );
    91 struct oauth_info *oauth_from_string( char *in, const struct oauth_service *sp );
     87char *oauth_to_string(struct oauth_info *oi);
     88struct oauth_info *oauth_from_string(char *in, const struct oauth_service *sp);
    9289
    9390/* For reading misc. data. */
    94 void oauth_params_add( GSList **params, const char *key, const char *value );
    95 void oauth_params_parse( GSList **params, char *in );
    96 void oauth_params_free( GSList **params );
    97 char *oauth_params_string( GSList *params );
    98 void oauth_params_set( GSList **params, const char *key, const char *value );
    99 const char *oauth_params_get( GSList **params, const char *key );
     91void oauth_params_add(GSList **params, const char *key, const char *value);
     92void oauth_params_parse(GSList **params, char *in);
     93void oauth_params_free(GSList **params);
     94char *oauth_params_string(GSList *params);
     95void oauth_params_set(GSList **params, const char *key, const char *value);
     96const char *oauth_params_get(GSList **params, const char *key);
Note: See TracChangeset for help on using the changeset viewer.