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