Skip to content

Commit a484c4b

Browse files
committed
set up build files
1 parent bd86fc9 commit a484c4b

File tree

5 files changed

+63
-0
lines changed

5 files changed

+63
-0
lines changed

libc/config/linux/x86_64/entrypoints.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ set(TARGET_LIBC_ENTRYPOINTS
386386
libc.src.wchar.wmemchr
387387
libc.src.wchar.wcpcpy
388388
libc.src.wchar.wcpncpy
389+
libc.src.wchar.wcstok
389390

390391
# sys/uio.h entrypoints
391392
libc.src.sys.uio.writev

libc/include/wchar.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ functions:
189189
arguments:
190190
- type: wchar_t *__restrict
191191
- type: const wchar_t *__restrict
192+
- name: wcstok
193+
standards:
194+
- stdc
195+
return_type: wchar_t *
196+
arguments:
197+
- type: wchar_t *__restrict
198+
- type: const wchar_t *__restrict
199+
- type: wchar_t** __restrict
192200
- name: wcpcpy
193201
standards:
194202
- stdc

libc/src/wchar/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@ add_entrypoint_object(
3434
libc.src.__support.wctype_utils
3535
)
3636

37+
add_entrypoint_object(
38+
wcstok
39+
SRCS
40+
wcstok.cpp
41+
HDRS
42+
wcstok.h
43+
DEPENDS
44+
libc.hdr.types.wchar_t
45+
)
46+
3747
add_entrypoint_object(
3848
wcrtomb
3949
SRCS

libc/src/wchar/wcstok.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Implementation of wcstok ------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "src/wchar/wcstok.h"
10+
11+
#include "hdr/types/wchar_t.h"
12+
#include "src/__support/common.h"
13+
14+
namespace LIBC_NAMESPACE_DECL {
15+
16+
LLVM_LIBC_FUNCTION(wchar_t *, wcstok,
17+
(wchar_t *__restrict str, const wchar_t *__restrict delim,
18+
wchar_t **__restrict ptr)) {
19+
20+
}
21+
22+
} // namespace LIBC_NAMESPACE_DECL

libc/src/wchar/wcstok.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//===-- Implementation header for wcstok ----------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLVM_LIBC_SRC_WCHAR_WCSTOK_H
10+
#define LLVM_LIBC_SRC_WCHAR_WCSTOK_H
11+
12+
#include "hdr/types/wchar_t.h"
13+
#include "src/__support/macros/config.h"
14+
15+
namespace LIBC_NAMESPACE_DECL {
16+
17+
wchar_t *wcstok(wchar_t *__restrict str, const wchar_t *__restrict delim,
18+
wchar_t **__restrict ptr);
19+
20+
} // namespace LIBC_NAMESPACE_DECL
21+
22+
#endif // LLVM_LIBC_SRC_WCHAR_WCSTOK_H

0 commit comments

Comments
 (0)