]> git.ozlabs.org Git - ccan/blob - tools/_infotojson/infotojson.h
c3c9658c53fd2831e687a600e694d750aea20af2
[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 "ccan/string/string.h"
17 #include "utils.h"
18
19  struct json
20  {
21         char *module;
22         char *title;
23         char *author;
24         char **desc;
25  };
26  
27  /* Function for storing json structure to file given struct json*/ 
28 int storejsontofile(struct json *jsonobj, char *jsonfile);
29
30 /*Function to store in database*/
31 int storejsontodb(struct json *jsonobj, char *db);
32
33 /*create json structure*/
34 struct json * createjson(char **infofile, char *author);
35
36 /*Extract info from file*/
37 char ** extractinfo(char **file);