diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-02-28 14:19:04 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-02-28 14:19:04 +0100 |
| commit | e753c19da1b621b1e667de85ce5ef60d186f0684 (patch) | |
| tree | 9bc80378efbe42ec72678230de2905ab121a4d8f /src/include/pathcoll.h | |
| parent | 7b50468b61b7bdd9a15753c0a28711c1654a8c12 (diff) | |
| download | box64-e753c19da1b621b1e667de85ce5ef60d186f0684.tar.gz box64-e753c19da1b621b1e667de85ce5ef60d186f0684.zip | |
Added some minimal set of source (now box64 compile and say hello at least)
Diffstat (limited to 'src/include/pathcoll.h')
| -rwxr-xr-x | src/include/pathcoll.h | 23 |
1 files changed, 23 insertions, 0 deletions
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_ |