Files
mediafire-fuse/utils/http.h
josch ef3b2aa844 Refactor code into utils, mfapi and mfshell
- utils is the low level library used by the others
 - mfapi uses utils and implements the api and some wrappers
 - mfshell uses mfapi and utils to provide a shell
2014-09-19 17:08:20 +02:00

38 lines
1.4 KiB
C

/*
* Copyright (C) 2014 Johannes Schauer <j.schauer@email.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2, as published by█
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with█
* this program; if not, write to the Free Software Foundation, Inc., 51
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef _MFSHELL_HTTP_H_
#define _MFSHELL_HTTP_H_
#include <jansson.h>
typedef struct _http_s http_t;
struct _http_s;
http_t* http_create(void);
void http_destroy(http_t* conn);
int http_get_buf(http_t *conn, const char *url, int (*data_handler)(http_t *conn, void *data), void *data);
int http_post_buf(http_t *conn, const char *url, const char *post_args, int (*data_handler)(http_t *conn, void *data), void *data);
int http_get_file(http_t *conn, const char *url, const char *path);
int http_post_file(http_t *conn, const char *url, const char *post_args, FILE *fd);
json_t *http_parse_buf_json(http_t* conn, size_t flags, json_error_t *error);
#endif