feat(landerctl): support all entry types
This commit is contained in:
parent
810bfd2bc9
commit
92d6d83256
4 changed files with 156 additions and 58 deletions
|
|
@ -32,11 +32,28 @@ typedef enum landerctl_mode {
|
|||
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);
|
||||
typedef enum landerctl_err {
|
||||
landerctl_err_ok = 0,
|
||||
landerctl_err_not_found
|
||||
} landerctl_err;
|
||||
|
||||
typedef struct landerctl_ctx {
|
||||
landerctl_cfg cfg;
|
||||
landerctl_mode mode;
|
||||
bool secure;
|
||||
bool verbose;
|
||||
const char *arg;
|
||||
const char *key;
|
||||
CURL *curl;
|
||||
struct curl_slist *headers;
|
||||
FILE *data_file;
|
||||
} landerctl_ctx;
|
||||
|
||||
const char *landerctl_err_msg(landerctl_err err);
|
||||
|
||||
void landerctl_set_common(landerctl_ctx *ctx);
|
||||
landerctl_err landerctl_post_short(landerctl_ctx *ctx);
|
||||
landerctl_err landerctl_post_paste(landerctl_ctx *ctx);
|
||||
landerctl_err landerctl_post_file(landerctl_ctx *ctx);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue