From e753c19da1b621b1e667de85ce5ef60d186f0684 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 28 Feb 2021 14:19:04 +0100 Subject: Added some minimal set of source (now box64 compile and say hello at least) --- src/include/pathcoll.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 src/include/pathcoll.h (limited to 'src/include/pathcoll.h') diff --git a/src/include/pathcoll.h b/src/include/pathcoll.h new file mode 100755 index 00000000..f1a0b93e --- /dev/null +++ b/src/include/pathcoll.h @@ -0,0 +1,23 @@ +#ifndef __PATHCOLL_H_ +#define __PATHCOLL_H_ + +// utility to handle path collection (like BOX86_PATH or BOX86_LD_LIBRARY_PATH) + +// paths can be resized with realloc, so don't take address as invariant +typedef struct path_collection_s +{ + int size; + int cap; + char** paths; +} path_collection_t; + +void ParseList(const char* List, path_collection_t* collection, int folder); +void FreeCollection(path_collection_t* collection); +void CopyCollection(path_collection_t* to, path_collection_t* from); +void AddPath(const char* path, path_collection_t* collection, int folder); +void PrependPath(const char* path, path_collection_t* collection, int folder); +void AppendList(path_collection_t* collection, const char* List, int folder); +void PrependList(path_collection_t* collection, const char* List, int folder); +int FindInCollection(const char* path, path_collection_t* collection); + +#endif //__PATHCOLL_H_ -- cgit 1.4.1