libscipaper 1.0.x
utils.h
1#pragma once
2#include <glib.h>
3#include "types.h"
4
13struct Pair
14{
15 char* key;
16 char* value;
17};
18
24void pair_free(struct Pair* pair);
25
32struct Pair* pair_new(const char* key, const char* value);
33
40GString* buildQuery(const GSList* list);
41
48PdfData* wgetPdf(const char* url, int timeout);
49
56GString* wgetUrl(const char* url, int timeout);
57
65GString* wpostUrl(const char* url, const char* data, int timeout);
66
77GString* createJsonEntry(const int indent, const char* key, const char* value, bool quote, bool newline);
78
GString * buildQuery(const GSList *list)
Builds an url encoded query string that can be added to a url.
void pair_free(struct Pair *pair)
Frees a pair struct.
GString * wpostUrl(const char *url, const char *data, int timeout)
Get the http data return as a string from a url via a http(s) POST request.
struct Pair * pair_new(const char *key, const char *value)
Frees a pair struct.
GString * wgetUrl(const char *url, int timeout)
Get the http data return as a string from a url via a http(s) GET request.
PdfData * wgetPdf(const char *url, int timeout)
Get a pdf file va a http(s) GET request.
GString * createJsonEntry(const int indent, const char *key, const char *value, bool quote, bool newline)
Create a json style entry string.
A key value Pair struct to be used wih G(S)Lists.
Definition utils.h:14
This struct contains the raw data of a PDF document.
Definition types.h:260