dump information

This commit is contained in:
Florian Stinglmayr 2019-06-25 15:01:36 +02:00
parent 05694d2611
commit 1be026187c
5 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,6 @@
#include <jansson.h>
void ncdc_util_dump_json(json_t *j);
void dc_util_dump_json(json_t *j);
#endif

View File

@ -350,6 +350,7 @@ bool dc_api_userinfo(dc_api_t api, dc_account_t login,
/* TODO: parse json and store info in user
*/
dc_util_dump_json(reply);
ret = true;

View File

@ -21,6 +21,8 @@
#include <event.h>
#include <event2/thread.h>
#include <dc/util.h>
//#define DEBUG
#define return_if_true(v,r) do { if (v) return r; } while(0)

View File

@ -2,7 +2,7 @@
#include "internal.h"
void ncdc_util_dump_json(json_t *j)
void dc_util_dump_json(json_t *j)
{
return_if_true(j == NULL,);
char *str = json_dumps(j, JSON_COMPACT);

View File

@ -240,7 +240,7 @@ int main(int ac, char **av)
return 3;
}
asprintf(&dc_private_dir, "%s/.ncdc", getenv("HOME"));
asprintf(&dc_private_dir, "%s/.ndc", getenv("HOME"));
if (mkdir(dc_private_dir, 0755) < 0) {
if (errno != EEXIST) {
fprintf(stderr, "failed to make %s: %s\n", dc_private_dir,