userspace: Add basic find utility

This is mostly working but is missing -exec and -ok support. It can
search files though :^)
This commit is contained in:
2026-07-08 05:46:56 +03:00
parent fa89645542
commit 3148c28c3d
7 changed files with 732 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
#include <BAN/Vector.h>
struct Token
{
enum Type
{
TOK_NOT, TOK_LPAREN, TOK_RPAREN, TOK_CURLIES,
TOK_PLUS, TOK_SEMICOLON, TOK_AND, TOK_OR,
TOK_NAME, TOK_INAME, TOK_PATH, TOK_NOUSER,
TOK_NOGROUP, TOK_MOUNT, TOK_XDEV, TOK_PRUNE,
TOK_PERM, TOK_TYPE, TOK_LINKS, TOK_USER,
TOK_GROUP, TOK_SIZE, TOK_ATIME, TOK_CTIME,
TOK_MTIME, TOK_EXEC, TOK_OK, TOK_PRINT,
TOK_PRINT0, TOK_NEWER, TOK_DEPTH, TOK_LITERAL,
TOK_END
};
Type type;
const char* string;
};
BAN::Vector<Token> tokenize(const char* const* strings);