mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
LibC: Add stubs for glob and globfree
This commit is contained in:
parent
f672b4c151
commit
6c650d1b8d
3 changed files with 61 additions and 0 deletions
|
@ -12,6 +12,7 @@ set(LIBC_SOURCES
|
|||
ifaddrs.cpp
|
||||
getopt.cpp
|
||||
getsubopt.cpp
|
||||
glob.cpp
|
||||
grp.cpp
|
||||
inttypes.cpp
|
||||
ioctl.cpp
|
||||
|
|
25
Userland/Libraries/LibC/glob.cpp
Normal file
25
Userland/Libraries/LibC/glob.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Format.h>
|
||||
#include <assert.h>
|
||||
#include <glob.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/glob.html
|
||||
int glob(char const*, int, int (*)(char const* epath, int eerrno), glob_t*)
|
||||
{
|
||||
dbgln("FIXME: Implement glob()");
|
||||
TODO();
|
||||
}
|
||||
|
||||
void globfree(glob_t*)
|
||||
{
|
||||
dbgln("FIXME: Implement globfree()");
|
||||
TODO();
|
||||
}
|
||||
}
|
35
Userland/Libraries/LibC/glob.h
Normal file
35
Userland/Libraries/LibC/glob.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2021, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
typedef struct {
|
||||
size_t gl_pathc;
|
||||
char** gl_pathv;
|
||||
size_t gl_offs;
|
||||
} glob_t;
|
||||
|
||||
#define GLOB_APPEND (1 << 0)
|
||||
#define GLOB_DOOFS (1 << 1)
|
||||
#define GLOB_ERR (1 << 2)
|
||||
#define GLOB_MARK (1 << 3)
|
||||
#define GLOB_NOCHECK (1 << 4)
|
||||
#define GLOB_NOESCAPE (1 << 5)
|
||||
#define GLOB_NOSORT (1 << 6)
|
||||
|
||||
#define GLOB_ABORTED 1
|
||||
#define GLOB_NOMATCH 2
|
||||
#define GLOB_NOSPACE 3
|
||||
|
||||
int glob(char const* pattern, int flags, int (*errfunc)(char const* epath, int eerrno), glob_t* pglob);
|
||||
|
||||
void globfree(glob_t* pglob);
|
||||
|
||||
__END_DECLS
|
Loading…
Add table
Add a link
Reference in a new issue