infotojson.h 796 B

123456789101112131415161718192021222324252627282930313233343536
  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. struct json
  18. {
  19. char *module;
  20. char *title;
  21. char *author;
  22. char **desc;
  23. };
  24. /* Function for storing json structure to file given struct json*/
  25. int storejsontofile(struct json *jsonobj, char *jsonfile);
  26. /*Function to store in database*/
  27. int storejsontodb(struct json *jsonobj, char *db);
  28. /*create json structure*/
  29. struct json * createjson(char **infofile, char *author);
  30. /*Extract info from file*/
  31. char ** extractinfo(char **file);