feat(landerctl): support posting redirects
This commit is contained in:
parent
49c4c78242
commit
810bfd2bc9
5 changed files with 212 additions and 13 deletions
|
|
@ -1,8 +1,13 @@
|
|||
#ifndef LANDERCTL
|
||||
#define LANDERCTL
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
typedef struct landerctl_cfg {
|
||||
const char *api_key;
|
||||
const char *server_url;
|
||||
} landerctl_cfg;
|
||||
|
||||
typedef enum landerctl_cfg_err {
|
||||
|
|
@ -20,4 +25,18 @@ typedef enum landerctl_cfg_err {
|
|||
*/
|
||||
landerctl_cfg_err landerctl_cfg_parse(landerctl_cfg *out, const char *path);
|
||||
|
||||
typedef enum landerctl_mode {
|
||||
landerctl_mode_none = 0,
|
||||
landerctl_mode_short,
|
||||
landerctl_mode_paste,
|
||||
landerctl_mode_file,
|
||||
} landerctl_mode;
|
||||
|
||||
struct curl_slist *landerctl_set_common(const landerctl_cfg *cfg, CURL *curl,
|
||||
landerctl_mode mode, bool secure,
|
||||
const char *key);
|
||||
void landerctl_post_short(CURL *curl, const char *url);
|
||||
void landerctl_post_paste(CURL *curl, const char *path);
|
||||
void landerctl_post_file(CURL *curl, const char *path);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue