This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a7dbb1
commit 940cd68
Showing
14 changed files
with
815 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" | ||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ | ||
<!ENTITY version SYSTEM "version.xml"> | ||
]> | ||
<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude"> | ||
<bookinfo> | ||
<title>libexpidus Reference Manual</title> | ||
<releaseinfo> | ||
for ExpidusOS's libexpidus library v&version; | ||
</releaseinfo> | ||
|
||
<copyright> | ||
<year>2023</year> | ||
<holder>Midstall Software & The ExpidusOS Team</holder> | ||
</copyright> | ||
</bookinfo> | ||
|
||
<chapter> | ||
<title>API Reference</title> | ||
<xi:include href="xml/config-parser.xml" /> | ||
</chapter> | ||
|
||
<index id="api-index-full"> | ||
<title>API Index</title> | ||
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> | ||
</index> | ||
</book> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
gnome.gtkdoc('libexpidus', | ||
main_xml: 'manual.xml', | ||
content_files: configure_file(input: 'version.xml.in', output: 'version.xml', configuration: conf_data), | ||
src_dir: [ | ||
join_paths(meson.project_source_root(), 'include'), | ||
], | ||
scan_args: ['--rebuild-sections'], | ||
dependencies: [libexpidus], | ||
install: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@VERSION_LONG@ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
description = "Library for handling a lot of the ExpidusOS specific functionality"; | ||
|
||
nixConfig = rec { | ||
trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" ]; | ||
substituters = [ "https://cache.nixos.org" "https://cache.garnix.io" ]; | ||
trusted-substituters = substituters; | ||
fallback = true; | ||
http2 = false; | ||
}; | ||
|
||
inputs.expidus-sdk.url = github:ExpidusOS/sdk/refactor; | ||
|
||
outputs = { self, expidus-sdk }: | ||
with expidus-sdk.lib; | ||
flake-utils.simpleFlake { | ||
inherit self; | ||
nixpkgs = expidus-sdk; | ||
name = "expidus"; | ||
overlay = import ./overlay.nix { inherit self; }; | ||
shell = import ./shell.nix { inherit self; }; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
#pragma once | ||
|
||
#include <neutron/elemental.h> | ||
|
||
NT_BEGIN_DECLS | ||
|
||
/** | ||
* SECTION: config-parser | ||
* @title: Config Parser | ||
* @short_description: Parsing of ExpidusOS configuration files | ||
*/ | ||
|
||
#if defined(__GNUC__) | ||
#pragma GCC visibility push(default) | ||
#elif defined(__clang__) | ||
#pragma clang visibility push(default) | ||
#endif | ||
|
||
/** | ||
* ExpidusConfigParser: | ||
* @instance: The %NtTypeInstance associated | ||
* @priv: Private data | ||
* | ||
* Type for parsing ExpidusOS configuration files | ||
*/ | ||
typedef struct _ExpidusConfigParser { | ||
NtTypeInstance instance; | ||
|
||
/*< private >*/ | ||
struct _ExpidusConfigParserPrivate* priv; | ||
} ExpidusConfigParser; | ||
|
||
/** | ||
* ExpidusConfigProperty: | ||
* @name: Name of the property | ||
* @type: The type of property this should be | ||
* @default_value: The default value data to use | ||
* | ||
* Structure for defining properties for %ExpidusConfigParser | ||
*/ | ||
typedef struct _ExpidusConfigProperty { | ||
const char* name; | ||
NtValueType type; | ||
NtValueData default_value; | ||
} ExpidusConfigProperty; | ||
|
||
/** | ||
* EXPIDUS_TYPE_CONFIG_PARSER: | ||
* | ||
* The %NtType ID of %ExpidusConfigParser | ||
*/ | ||
#define EXPIDUS_TYPE_CONFIG_PARSER expidus_config_parser_get_type() | ||
NT_DECLARE_TYPE(EXPIDUS, CONFIG_PARSER, ExpidusConfigParser, expidus_config_parser); | ||
|
||
/** | ||
* expidus_config_parser_new: | ||
* | ||
* Creates a new empty configuration parser | ||
* | ||
* Returns: A new instance | ||
*/ | ||
ExpidusConfigParser* expidus_config_parser_new(); | ||
|
||
/** | ||
* expidus_config_parser_remove_property: | ||
* @self: Instance | ||
* @name: Name of the property | ||
* | ||
* Removes the property by its name | ||
*/ | ||
void expidus_config_parser_remove_property(ExpidusConfigParser* self, const char* name); | ||
|
||
/** | ||
* expidus_config_parser_add_property: | ||
* @self: Instance | ||
* @name: Name of the property | ||
* @type: The type of property this should be | ||
* @default_value: The default value data to use | ||
* | ||
* Adds the new property | ||
*/ | ||
void expidus_config_parser_add_property(ExpidusConfigParser* self, const char* name, NtValueType type, NtValueData default_value); | ||
|
||
/** | ||
* expidus_config_parser_set_properties: | ||
* @self: Instance | ||
* @props: An array of properties with the last one having name set to %NULL | ||
* | ||
* Fills the configuration parser with all the properties at one go. | ||
*/ | ||
void expidus_config_parser_set_properties(ExpidusConfigParser* self, ExpidusConfigProperty* props); | ||
|
||
/** | ||
* expidus_config_parser_read_line: | ||
* @self: Instance | ||
* @str: The string to read as a single line | ||
* @length: The length of @str | ||
* @backtrace: The backtrace to append to in case of an error | ||
* @error: Pointer to store the error in | ||
* | ||
* Parses the string as a single line with a determined length. | ||
* If it failed to parse the line, then an error is pushed through @error. | ||
* If the property doesn't exist then name in %NtTypeArgument will be %NULL. | ||
* | ||
* Returns: The property name and value represented as a type argument. If it doesn't exist, then name will be %NULL. | ||
*/ | ||
NtTypeArgument expidus_config_parser_read_line(ExpidusConfigParser* self, const char* str, size_t length, NtBacktrace* backtrace, NtError** error); | ||
|
||
/** | ||
* expidus_config_parser_read: | ||
* @self: Instance | ||
* @str: The configuration to parse | ||
* @backtrace: The backtrace to append to in case of an error | ||
* @error: Pointer to store the error in | ||
* | ||
* Parse the configuration line by line | ||
* | ||
* Returns: A list of %NtTypeArgument's which are keyed based on %ExpidusVendorConfigProperty. %NULL is returned if failure. | ||
*/ | ||
NtTypeArgument* expidus_config_parser_read(ExpidusConfigParser* self, const char* str, NtBacktrace* backtrace, NtError** error); | ||
|
||
/** | ||
* expidus_config_parser_read_file: | ||
* @self: Instance | ||
* @path: The path to the file | ||
* @backtrace: The backtrace to append to in case of an error | ||
* @error: Pointer to store the error in | ||
* | ||
* Parses the configuration from a file | ||
* | ||
* Returns: A list of %NtTypeArgument's which are keyed based on %ExpidusVendorConfigProperty. %NULL is returned if failure. | ||
*/ | ||
NtTypeArgument* expidus_config_parser_read_file(ExpidusConfigParser* self, const char* path, NtBacktrace* backtrace, NtError** error); | ||
|
||
#if defined(__GNUC__) | ||
#pragma GCC visibility pop | ||
#elif defined(__clang__) | ||
#pragma clang visibility pop | ||
#endif | ||
|
||
NT_END_DECLS |
Oops, something went wrong.