aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/str.h27
-rw-r--r--include/strlist.h8
-rw-r--r--include/system.h2
-rw-r--r--include/template.h2
4 files changed, 11 insertions, 28 deletions
diff --git a/include/str.h b/include/str.h
index 8018cc0..895b8cc 100644
--- a/include/str.h
+++ b/include/str.h
@@ -51,33 +51,6 @@ int endswith(const char *sptr, const char *pattern);
void strchrdel(char *sptr, const char *chars);
/**
- * Find the integer offset of the first occurrence of `ch` in `sptr`
- *
- * ~~~{.c}
- * char buffer[255];
- * char string[] = "abc=123";
- * long int separator_offset = strchroff(string, '=');
- * for (long int i = 0; i < separator_offset); i++) {
- * buffer[i] = string[i];
- * }
- * ~~~
- *
- * @param sptr string to scan
- * @param ch character to find
- * @return offset to character in string, or 0 on failure
- */
-long int strchroff(const char *sptr, int ch);
-
-/**
- * This function scans `sptr` from right to left removing any matches to `suffix`
- * from the string.
- *
- * @param sptr string to be modified
- * @param suffix string to be removed from `sptr`
- */
-void strdelsuffix(char *sptr, const char *suffix);
-
-/**
* Split a string by every delimiter in `delim` string.
*
* Callee should free memory using `GENERIC_ARRAY_FREE()`
diff --git a/include/strlist.h b/include/strlist.h
index 2d3c3cf..3f35e23 100644
--- a/include/strlist.h
+++ b/include/strlist.h
@@ -44,4 +44,12 @@ struct StrList *strlist_copy(struct StrList *pStrList);
int strlist_cmp(struct StrList *a, struct StrList *b);
void strlist_free(struct StrList **pStrList);
+#define STRLIST_E_SUCCESS 0
+#define STRLIST_E_OUT_OF_RANGE 1
+#define STRLIST_E_INVALID_VALUE 2
+#define STRLIST_E_UNKNOWN 3
+extern int strlist_errno;
+const char *strlist_get_error(int flag);
+
+
#endif //OMC_STRLIST_H
diff --git a/include/system.h b/include/system.h
index 7428355..94d5a36 100644
--- a/include/system.h
+++ b/include/system.h
@@ -14,6 +14,8 @@
#include <sys/wait.h>
#include <sys/stat.h>
+#define OMC_SHELL_SAFE_RESTRICT ";&|()"
+
struct Process {
// Write stdout stream to file
char f_stdout[PATH_MAX];
diff --git a/include/template.h b/include/template.h
index a242a08..362eb3d 100644
--- a/include/template.h
+++ b/include/template.h
@@ -42,7 +42,7 @@ int tpl_render_to_file(char *str, const char *filename);
struct tplfunc_frame *tpl_getfunc(char *key);
struct tplfunc_frame;
-typedef int tplfunc(struct tplfunc_frame *frame);
+typedef int tplfunc(struct tplfunc_frame *frame, void *result);
struct tplfunc_frame {
char *key;
tplfunc *func;