automerge/automerge-c/automerge.c
Jason Kankiewicz f52b9a13f7 Added Doxygen documentation generation.
Renamed `AMDatatype` to `AmDataType`.
Reorganized the `AmDataType` tags.
Renamed `AMfree()` to `AMdestroy()`.
Renamed `AMclone()` to `AMdup()`.
2022-02-24 14:39:38 -05:00

36 lines
713 B
C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "automerge.h"
#define MAX_BUFF_SIZE 4096
int main() {
int n = 0;
int data_type = 0;
char buff[MAX_BUFF_SIZE];
char obj[MAX_BUFF_SIZE];
AMresult* res = NULL;
printf("begin\n");
AMdoc* doc = AMcreate();
printf("AMconfig()...");
AMconfig(doc, "actor", "aabbcc");
printf("pass!\n");
printf("AMmapSet()...\n");
res = AMmapSet(doc, NULL, "string", AM_DATA_TYPE_STR, "hello world");
if (AMresultStatus(res) != AM_STATUS_COMMAND_OK)
{
printf("AMmapSet() failed: %s\n", AMerrorMessage(res));
return 1;
}
AMclear(res);
printf("pass!\n");
AMdestroy(doc);
printf("end\n");
}