PatchworkOS
3984a1d
A non-POSIX operating system.
Theme:
Default
Round
Robot
Loading...
Searching...
No Matches
wordcmp.c
Go to the documentation of this file.
1
#include <
sys/proc.h
>
2
3
#include <
string.h
>
4
5
int64_t
wordcmp
(
const
char
*
string
,
const
char
*
word
)
6
{
7
size_t
len =
strlen
(
word
);
8
return
strncmp
(
string
,
word
, len) == 0 && (
string
[len] ==
'\0'
||
string
[len] ==
' '
) ? 0 : -1;
9
}
y
int64_t y
Definition
main.c:153
wordcmp
int64_t wordcmp(const char *string, const char *word)
Helper for comparing the first word of a string.
Definition
wordcmp.c:5
proc.h
int64_t
__INT64_TYPE__ int64_t
Definition
stdint.h:16
string.h
strncmp
_PUBLIC int strncmp(const char *s1, const char *s2, size_t n)
Definition
strncmp.c:3
strlen
_PUBLIC size_t strlen(const char *s)
Definition
strlen.c:3
src
libstd
user
functions
proc
wordcmp.c
Generated on Sat Jan 10 2026 00:03:16 for PatchworkOS by
1.9.8