forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LibC: Add stubs for glob and globfree
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ set(LIBC_SOURCES | |
ifaddrs.cpp | ||
getopt.cpp | ||
getsubopt.cpp | ||
glob.cpp | ||
grp.cpp | ||
inttypes.cpp | ||
ioctl.cpp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |