diff options
author | Indent <please@skip.me> | 2015-02-19 02:47:20 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-02-20 19:50:54 -0300 |
commit | 5ebff60479fc7a9f7f50ac03b124c91d4e6ebe11 (patch) | |
tree | 9fc0d50cb1f4bc9768d9f00de94eafd876bb55b0 /lib/oauth.h | |
parent | af359b4316f9d392c6b752495a1b2ed631576ed8 (diff) |
Reindent everything to K&R style with tabs
Used uncrustify, with the configuration file in ./doc/uncrustify.cfg
Commit author set to "Indent <please@skip.me>" so that it's easier to
skip while doing git blame.
Diffstat (limited to 'lib/oauth.h')
-rw-r--r-- | lib/oauth.h | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/lib/oauth.h b/lib/oauth.h index 50adc95c..c9115d57 100644 --- a/lib/oauth.h +++ b/lib/oauth.h @@ -27,73 +27,70 @@ struct oauth_info; /* Callback function called twice during the access token request process. Return FALSE if something broke and the process must be aborted. */ -typedef gboolean (*oauth_cb)( struct oauth_info * ); +typedef gboolean (*oauth_cb)(struct oauth_info *); -typedef enum -{ +typedef enum { OAUTH_INIT, OAUTH_REQUEST_TOKEN, OAUTH_ACCESS_TOKEN, } oauth_stage_t; -struct oauth_info -{ +struct oauth_info { oauth_stage_t stage; const struct oauth_service *sp; - + oauth_cb func; void *data; - + struct http_request *http; - + char *auth_url; char *request_token; - + char *token; char *token_secret; GSList *params; }; -struct oauth_service -{ +struct oauth_service { char *url_request_token; char *url_access_token; char *url_authorize; - + char *consumer_key; char *consumer_secret; }; -/* http://oauth.net/core/1.0a/#auth_step1 (section 6.1) +/* http://oauth.net/core/1.0a/#auth_step1 (section 6.1) Request an initial anonymous token which can be used to construct an authorization URL for the user. This is passed to the callback function in a struct oauth_info. */ -struct oauth_info *oauth_request_token( const struct oauth_service *sp, oauth_cb func, void *data ); +struct oauth_info *oauth_request_token(const struct oauth_service *sp, oauth_cb func, void *data); /* http://oauth.net/core/1.0a/#auth_step3 (section 6.3) The user gets a PIN or so which we now exchange for the final access token. This is passed to the callback function in the same struct oauth_info. */ -gboolean oauth_access_token( const char *pin, struct oauth_info *st ); +gboolean oauth_access_token(const char *pin, struct oauth_info *st); /* http://oauth.net/core/1.0a/#anchor12 (section 7) Generate an OAuth Authorization: HTTP header. access_token should be saved/fetched using the functions above. args can be a string with whatever's going to be in the POST body of the request. GET args will automatically be grabbed from url. */ -char *oauth_http_header( struct oauth_info *oi, const char *method, const char *url, char *args ); +char *oauth_http_header(struct oauth_info *oi, const char *method, const char *url, char *args); /* Shouldn't normally be required unless the process is aborted by the user. */ -void oauth_info_free( struct oauth_info *info ); +void oauth_info_free(struct oauth_info *info); /* Convert to and back from strings, for easier saving. */ -char *oauth_to_string( struct oauth_info *oi ); -struct oauth_info *oauth_from_string( char *in, const struct oauth_service *sp ); +char *oauth_to_string(struct oauth_info *oi); +struct oauth_info *oauth_from_string(char *in, const struct oauth_service *sp); /* For reading misc. data. */ -void oauth_params_add( GSList **params, const char *key, const char *value ); -void oauth_params_parse( GSList **params, char *in ); -void oauth_params_free( GSList **params ); -char *oauth_params_string( GSList *params ); -void oauth_params_set( GSList **params, const char *key, const char *value ); -const char *oauth_params_get( GSList **params, const char *key ); +void oauth_params_add(GSList **params, const char *key, const char *value); +void oauth_params_parse(GSList **params, char *in); +void oauth_params_free(GSList **params); +char *oauth_params_string(GSList *params); +void oauth_params_set(GSList **params, const char *key, const char *value); +const char *oauth_params_get(GSList **params, const char *key); |