GATE
|
Web-based service API implementations. More...
#include "gate/tech/gate_tech_api.h"
#include "gate/structs.h"
#include "gate/times.h"
#include "gate/arrays.h"
#include "gate/uris.h"
#include "gate/maps.h"
#include "gate/streams.h"
#include "gate/blobs.h"
Macros | |
#define | GATE_TECH_WEATHER_RECORD_TEMPERATURE_C 0x0010 |
#define | GATE_TECH_WEATHER_RECORD_HUMIDITY_P 0x0020 |
#define | GATE_TECH_WEATHER_RECORD_RAIN_MM 0x0040 |
#define | GATE_TECH_WEATHER_RECORD_WIND_KMH 0x0080 |
#define | GATE_TECH_WEATHER_RECORD_STATE 0x0100 |
#define | GATE_TECH_WEATHER_STATE_INTENSITY_LOW 0x01 |
#define | GATE_TECH_WEATHER_STATE_INTENSITY_MEDIUM 0x02 |
#define | GATE_TECH_WEATHER_STATE_INTENSITY_HIGH 0x04 |
#define | GATE_TECH_WEATHER_STATE_INTENSITY_FREEZING 0x08 |
Functions | |
GATE_TECH_API void | gate_tech_webapi_context_init (gate_tech_webapi_context_t *context) |
Initializes a web context object with empty members. | |
GATE_TECH_API gate_result_t | gate_tech_webapi_get (gate_tech_webapi_context_t *context, gate_uri_t const *url, gate_map_t const *additional_request_headers, gate_uint32_t *response_status, gate_stream_t *response_content, gate_map_t *response_headers) |
Executes a web request and returns response data. | |
GATE_TECH_API void | gate_tech_webapi_ipwhois_request_init (gate_tech_webapi_ipwhois_request_t *request) |
Initializes an ip-whois request structure object. | |
GATE_TECH_API void | gate_tech_webapi_ipwhois_response_init (gate_tech_webapi_ipwhois_response_t *response) |
Initializes an ip-whois response structure object. | |
GATE_TECH_API gate_result_t | gate_tech_webapi_ipwhois (gate_tech_webapi_context_t *context, gate_tech_webapi_ipwhois_request_t *request, gate_tech_webapi_ipwhois_response_t *response) |
Resolves IP address data and returns owner informations. | |
GATE_TECH_API void | gate_tech_webapi_newsentry_init (gate_tech_webapi_newsentry_t *entry) |
Initializes a newsentry structure object. | |
GATE_TECH_API void | gate_tech_webapi_newsfeed_request_init (gate_tech_webapi_newsfeed_request_t *request) |
Initializes a newsfeed request structure object. | |
GATE_TECH_API void | gate_tech_webapi_newsfeed_response_init (gate_tech_webapi_newsfeed_response_t *response) |
Initializes a newsfeed response structure object. | |
GATE_TECH_API gate_result_t | gate_tech_webapi_newsfeed (gate_tech_webapi_context_t *context, gate_tech_webapi_newsfeed_request_t *request, gate_tech_webapi_newsfeed_response_t *response) |
Downloads newsfeed entries from a given feed source. | |
GATE_TECH_API void | gate_tech_webapi_weather_request_init (gate_tech_webapi_weather_request_t *request) |
Initializes a weather request structure object. | |
GATE_TECH_API void | gate_tech_webapi_weather_response_init (gate_tech_webapi_weather_response_t *response) |
Initializes a weather response structure object. | |
GATE_TECH_API gate_result_t | gate_tech_webapi_weather (gate_tech_webapi_context_t *context, gate_tech_webapi_weather_request_t *request, gate_tech_webapi_weather_response_t *response) |
Queries the current weather states of a requested location. | |
GATE_TECH_API void | gate_tech_webapi_geomaps_request_init (gate_tech_webapi_geomaps_request_t *request) |
Initializes a geomaps request structure object. | |
GATE_TECH_API void | gate_tech_webapi_geomaps_response_init (gate_tech_webapi_geomaps_response_t *response) |
Initializes a geomaps response structure object. | |
GATE_TECH_API gate_result_t | gate_tech_webapi_geomaps (gate_tech_webapi_context_t *context, gate_tech_webapi_geomaps_request_t *request, gate_tech_webapi_geomaps_response_t *response) |
Queries a road- or areal-map image of a requested location. | |
Web-based service API implementations.
#define GATE_TECH_WEATHER_RECORD_TEMPERATURE_C 0x0010 |
temperature in degree Celsius
#define GATE_TECH_WEATHER_RECORD_HUMIDITY_P 0x0020 |
relative humidity in percent
#define GATE_TECH_WEATHER_RECORD_RAIN_MM 0x0040 |
rain in millimeters
#define GATE_TECH_WEATHER_RECORD_WIND_KMH 0x0080 |
wind speed in km/h
#define GATE_TECH_WEATHER_RECORD_STATE 0x0100 |
weather interpretation state code, combination of GATE_TECH_WEATHER_STATE_* flags
#define GATE_TECH_WEATHER_STATE_INTENSITY_LOW 0x01 |
flag-bit indicating a low intensity of a weather state
#define GATE_TECH_WEATHER_STATE_INTENSITY_MEDIUM 0x02 |
flag-bit indicating a moderate intensity of a weather state
#define GATE_TECH_WEATHER_STATE_INTENSITY_HIGH 0x04 |
flag-bit indicating a high intensity of a weather state
#define GATE_TECH_WEATHER_STATE_INTENSITY_FREEZING 0x08 |
flag-bit indicating a freezing weather state
GATE_TECH_API void gate_tech_webapi_context_init | ( | gate_tech_webapi_context_t * | context | ) |
Initializes a web context object with empty members.
Instance can be released by gate_struct_release()
[out] | context | pointer to structure to be initialized |
GATE_TECH_API gate_result_t gate_tech_webapi_get | ( | gate_tech_webapi_context_t * | context, |
gate_uri_t const * | url, | ||
gate_map_t const * | additional_request_headers, | ||
gate_uint32_t * | response_status, | ||
gate_stream_t * | response_content, | ||
gate_map_t * | response_headers ) |
Executes a web request and returns response data.
[in] | context | pointer to information context to be used by web connection |
[in] | url | url to web resource to be queried |
[in] | additional_request_headers | map (gate_string -> gate_string) with additional HTTP request headers |
[out] | response_status | pointer to output HTTP status integer to be filled with response code |
[in] | response_content | pointer to output stream, where web response is written to |
[out] | response_headers | optional pointer to uninitialized map to be initialized with a (string->string) map with response header entries |
GATE_TECH_API void gate_tech_webapi_ipwhois_request_init | ( | gate_tech_webapi_ipwhois_request_t * | request | ) |
Initializes an ip-whois request structure object.
Instance can be released by gate_struct_release()
[out] | request | pointer to structure to be initialized |
GATE_TECH_API void gate_tech_webapi_ipwhois_response_init | ( | gate_tech_webapi_ipwhois_response_t * | response | ) |
Initializes an ip-whois response structure object.
Instance can be released by gate_struct_release()
[out] | response | pointer to structure to be initialized |
GATE_TECH_API gate_result_t gate_tech_webapi_ipwhois | ( | gate_tech_webapi_context_t * | context, |
gate_tech_webapi_ipwhois_request_t * | request, | ||
gate_tech_webapi_ipwhois_response_t * | response ) |
Resolves IP address data and returns owner informations.
[in] | context | pointer to information context to be used by web connection |
[in] | request | pointer to be filled out ip-whois request object |
[in,out] | response | pointer to initialized ip-whois response object, which will be updated |
GATE_TECH_API void gate_tech_webapi_newsentry_init | ( | gate_tech_webapi_newsentry_t * | entry | ) |
Initializes a newsentry structure object.
Instance can be released by gate_struct_release()
[out] | entry | pointer to structure to be initialized with empty values |
GATE_TECH_API void gate_tech_webapi_newsfeed_request_init | ( | gate_tech_webapi_newsfeed_request_t * | request | ) |
Initializes a newsfeed request structure object.
Instance can be released by gate_struct_release()
[out] | request | pointer to structure to be initialized with empty values |
GATE_TECH_API void gate_tech_webapi_newsfeed_response_init | ( | gate_tech_webapi_newsfeed_response_t * | response | ) |
Initializes a newsfeed response structure object.
Instance can be released by gate_struct_release()
[out] | response | pointer to structure to be initialized with empty values |
GATE_TECH_API gate_result_t gate_tech_webapi_newsfeed | ( | gate_tech_webapi_context_t * | context, |
gate_tech_webapi_newsfeed_request_t * | request, | ||
gate_tech_webapi_newsfeed_response_t * | response ) |
Downloads newsfeed entries from a given feed source.
[in] | context | pointer to information context to be used by web connection |
[in] | request | pointer to newsfeed request object |
[in,out] | response | pointer to initialized newsfeed response object, which will be updated |
GATE_TECH_API void gate_tech_webapi_weather_request_init | ( | gate_tech_webapi_weather_request_t * | request | ) |
Initializes a weather request structure object.
Instance can be released by gate_struct_release()
[out] | request | pointer to structure to be initialized with empty values |
GATE_TECH_API void gate_tech_webapi_weather_response_init | ( | gate_tech_webapi_weather_response_t * | response | ) |
Initializes a weather response structure object.
Instance can be released by gate_struct_release()
[out] | response | pointer to structure to be initialized with empty values |
GATE_TECH_API gate_result_t gate_tech_webapi_weather | ( | gate_tech_webapi_context_t * | context, |
gate_tech_webapi_weather_request_t * | request, | ||
gate_tech_webapi_weather_response_t * | response ) |
Queries the current weather states of a requested location.
[in] | context | pointer to information context to be used by web connection |
[in] | request | pointer to weather request object |
[in,out] | response | pointer to initialized weather response object, which will be updated |
GATE_TECH_API void gate_tech_webapi_geomaps_request_init | ( | gate_tech_webapi_geomaps_request_t * | request | ) |
Initializes a geomaps request structure object.
Instance can be released by gate_struct_release()
[out] | request | pointer to structure to be initialized with empty values |
GATE_TECH_API void gate_tech_webapi_geomaps_response_init | ( | gate_tech_webapi_geomaps_response_t * | response | ) |
Initializes a geomaps response structure object.
Instance can be released by gate_struct_release()
[out] | response | pointer to structure to be initialized with empty values |
GATE_TECH_API gate_result_t gate_tech_webapi_geomaps | ( | gate_tech_webapi_context_t * | context, |
gate_tech_webapi_geomaps_request_t * | request, | ||
gate_tech_webapi_geomaps_response_t * | response ) |
Queries a road- or areal-map image of a requested location.
[in] | context | pointer to information context to be used by web connection |
[in] | request | pointer to geomaps request object |
[in,out] | response | pointer to initialized geomaps response object, which will be updated |