pentominos:libartefact
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
pentominos:libartefact [2010/01/29 08:52] – deva | pentominos:libartefact [2010/01/29 09:14] (current) – deva | ||
---|---|---|---|
Line 4: | Line 4: | ||
The library takes care of http communication, | The library takes care of http communication, | ||
It is intended as a complete interface to the communication possibilities with the Artefact server. | It is intended as a complete interface to the communication possibilities with the Artefact server. | ||
+ | |||
+ | =====How to use libartefact===== | ||
+ | To use libartefact, | ||
+ | The project supplies a pkg-config file called libartefact.pc, | ||
+ | In order to use it simply add | ||
+ | <code autoconf> | ||
+ | PKG_CHECK_MODULES(ATF, | ||
+ | </ | ||
+ | to '' | ||
+ | Alternatively use the '' | ||
=====API overview===== | =====API overview===== | ||
- | <code c> | ||
+ | <code c> | ||
+ | atf_handle_t *handle = atf_init(); | ||
+ | void atf_close(handle); | ||
</ | </ | ||
Line 22: | Line 34: | ||
} | } | ||
</ | </ | ||
+ | |||
+ | =====Replies===== | ||
+ | When a reply is received, it can either be obtained from the library in its raw form, on in parsed form, where the XML is evaluated and returned in a recursive structure, much like an XML DOM model. | ||
+ | If the result is read in its raw form, the handling of interpretation must be done by the client using the library. | ||
+ | This can be useful if the result contains an image as raw binary data, or the parsed data must fit into some already defined internal structure. | ||
+ | The raw data is simply a verbatim copy of the character data contained within the reply nodes in the server response document. If the data is raw binary data, it will most likely be base64 encoded, which must be handled by the client using the library. | ||
+ | If the raw data is not raw binary data, it will most likely contain a tree of XML nodes, without the header. It is important to note that this XML data cannot be fed directly to a strict XML parser, since it is in itself not a valid XML document. It will however be well balanced. In order to force it to become a valid XML document a single outer (root) element must be added (ex. ''< |
pentominos/libartefact.1264751523.txt.gz · Last modified: 2010/01/29 08:52 by deva