💾 Archived View for gemini.rmf-dev.com › repo › Vaati › Vgmi › files › 6647d644e52849dcf5907c3fbe06b… captured on 2024-02-05 at 09:56:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Go Back

0 /*

1 * ISC License

2 * Copyright (c) 2023 RMF <rawmonk@firemail.cc>

3 */

4 #define CONFIG_STRING_LENGTH 1024

5 struct config {

6 unsigned int maximumBodyLength;

7 unsigned int maximumDisplayLength;

8 int certificateLifespan;

9 int certificateBits;

10 int maximumRedirects;

11 int maximumCachedPages;

12 int maximumHistorySize;

13 int maximumHistoryCache;

14 int imageParserScratchPad;

15 int enableHistory;

16 int enableSandbox;

17 int enableImage;

18 int enableHexViewer;

19 int enableXdg;

20 char searchEngineURL[CONFIG_STRING_LENGTH];

21 };

22 extern struct config config;

23

24 #ifdef CONFIG_INTERNAL

25 enum {

26 VALUE_STRING,

27 VALUE_INT

28 };

29

30 struct field {

31 char name[128];

32 int type;

33 void *ptr;

34 int restart;

35 };

36

37 static struct field fields[] = {

38 {"hexviewer.enabled", VALUE_INT, &config.enableHexViewer, 0},

39 {"image.enabled", VALUE_INT, &config.enableImage, 1},

40 #ifdef STATIC_ALLOC

41 {"image.scratchpad", VALUE_INT, &config.imageParserScratchPad, 1},

42 #endif

43 {"sandbox.enabled", VALUE_INT, &config.enableSandbox, 1},

44 {"xdg.enabled", VALUE_INT, &config.enableXdg, 1},

45 {"history.enabled", VALUE_INT, &config.enableHistory, 0},

46 {"certificate.bits", VALUE_INT, &config.certificateBits, 0},

47 {"certificate.expiration", VALUE_INT, &config.certificateLifespan, 0},

48 {"request.maxbody", VALUE_INT, &config.maximumBodyLength, 0},

49 {"request.maxdisplay", VALUE_INT, &config.maximumDisplayLength, 0},

50 {"request.maxredirects", VALUE_INT, &config.maximumRedirects, 0},

51 {"request.cachedpages", VALUE_INT, &config.maximumCachedPages, 0},

52 {"history.maxentries", VALUE_INT, &config.maximumHistorySize, 0},

53 {"history.maxcache", VALUE_INT, &config.maximumHistoryCache, 0},

54 {"search.url", VALUE_STRING, &config.searchEngineURL, 0},

55 };

56 #endif

57

58 int config_load(void);

59 int config_save(void);

60 int config_set_field(int id, const char *value);

61 int config_correction(void);

62