]> git.ozlabs.org Git - ccan/blob - tools/_infotojson/infotojson.h
5fb4ad3d42c64cd0064719250e34bf628b626af2
[ccan] / tools / _infotojson / infotojson.h
1 /** json structure 
2  * This file contains definition of json structure
3  **/
4 #include <err.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <string.h>
9 #include <sys/types.h>
10 #include <sys/stat.h>
11 #include <fcntl.h>
12 #include <stdbool.h>
13 #include <sqlite3.h>
14 #include "database.h"
15 #include "ccan/talloc/talloc.h"
16 #include "utils.h"
17
18  struct json
19  {
20         char *module;
21         char *title;
22         char *author;
23         char **desc;
24  };
25  
26  /* Function for storing json structure to file given struct json*/ 
27 int storejsontofile(struct json *jsonobj, char *jsonfile);
28
29 /*Function to store in database*/
30 int storejsontodb(struct json *jsonobj, char *db);
31
32 /*create json structure*/
33 struct json * createjson(char **infofile, char *author);
34
35 /*Extract info from file*/
36 char ** extractinfo(char **file);