mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Add ispunct() to LibC + some minor cleanups.
This commit is contained in:
parent
3b2f172d48
commit
7cc4caee4f
Notes:
sideshowbarker
2024-07-19 16:11:15 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7cc4caee4f8
5 changed files with 16 additions and 2 deletions
|
@ -8,7 +8,6 @@ cp -v ../Userland/sh mnt/bin/sh
|
|||
cp -v ../Userland/id mnt/bin/id
|
||||
cp -v ../Userland/ps mnt/bin/ps
|
||||
cp -v ../Userland/ls mnt/bin/ls
|
||||
cp -v ../Userland/pwd mnt/bin/pwd
|
||||
cp -v ../Userland/sleep mnt/bin/sleep
|
||||
cp -v ../Userland/date mnt/bin/date
|
||||
cp -v ../Userland/true mnt/bin/true
|
||||
|
|
|
@ -25,6 +25,7 @@ LIBC_OBJS = \
|
|||
setjmp.o \
|
||||
stat.o \
|
||||
mntent.o \
|
||||
ctype.o \
|
||||
entry.o
|
||||
|
||||
OBJS = $(AK_OBJS) $(LIBC_OBJS)
|
||||
|
|
8
LibC/ctype.cpp
Normal file
8
LibC/ctype.cpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
int ispunct(int c)
|
||||
{
|
||||
const char* punctuation_characters = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
||||
return !!strchr(punctuation_characters, c);
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
ALWAYS_INLINE int isascii(int ch)
|
||||
{
|
||||
return (ch & ~0x7f) == 0;
|
||||
|
@ -40,3 +42,7 @@ ALWAYS_INLINE int isdigit(int c)
|
|||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
int ispunct(int c);
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
@ -7,7 +7,7 @@ int setjmp(jmp_buf)
|
|||
assert(false);
|
||||
}
|
||||
|
||||
void longjmp(jmp_buf, int val)
|
||||
void longjmp(jmp_buf, int)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue