dump information
This commit is contained in:
parent
05694d2611
commit
1be026187c
@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#include <jansson.h>
|
#include <jansson.h>
|
||||||
|
|
||||||
void ncdc_util_dump_json(json_t *j);
|
void dc_util_dump_json(json_t *j);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -350,6 +350,7 @@ bool dc_api_userinfo(dc_api_t api, dc_account_t login,
|
|||||||
|
|
||||||
/* TODO: parse json and store info in user
|
/* TODO: parse json and store info in user
|
||||||
*/
|
*/
|
||||||
|
dc_util_dump_json(reply);
|
||||||
|
|
||||||
ret = true;
|
ret = true;
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <event.h>
|
#include <event.h>
|
||||||
#include <event2/thread.h>
|
#include <event2/thread.h>
|
||||||
|
|
||||||
|
#include <dc/util.h>
|
||||||
|
|
||||||
//#define DEBUG
|
//#define DEBUG
|
||||||
|
|
||||||
#define return_if_true(v,r) do { if (v) return r; } while(0)
|
#define return_if_true(v,r) do { if (v) return r; } while(0)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
void ncdc_util_dump_json(json_t *j)
|
void dc_util_dump_json(json_t *j)
|
||||||
{
|
{
|
||||||
return_if_true(j == NULL,);
|
return_if_true(j == NULL,);
|
||||||
char *str = json_dumps(j, JSON_COMPACT);
|
char *str = json_dumps(j, JSON_COMPACT);
|
||||||
|
@ -240,7 +240,7 @@ int main(int ac, char **av)
|
|||||||
return 3;
|
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 (mkdir(dc_private_dir, 0755) < 0) {
|
||||||
if (errno != EEXIST) {
|
if (errno != EEXIST) {
|
||||||
fprintf(stderr, "failed to make %s: %s\n", dc_private_dir,
|
fprintf(stderr, "failed to make %s: %s\n", dc_private_dir,
|
||||||
|
Loading…
Reference in New Issue
Block a user