Nugget
Bare-metal libraries and examples for the original PlayStation
Loading...
Searching...
No Matches
libcmisc.h
Go to the documentation of this file.
1/*
2
3MIT License
4
5Copyright (c) 2020 PCSX-Redux authors
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26
27#pragma once
28
29#include <stddef.h>
30#include <stdint.h>
31
32int psxdummy();
33
34int psxtodigit(int c);
35void psxatof(const char *str);
36int psxabs(int j);
37char *psxatob(char *str, int *result);
38const char *psxstrpbrk(const char *s, const char *accepted);
39unsigned psxstrspn(const char *s, const char *accepted);
40unsigned psxstrcspn(const char *s, const char *rejected);
41char *psxstrtok(char *str, const char *delim);
42const char *psxbcopy(const void *src, void *dst, int n);
43const char *psxbzero(void *ptr, int n);
44int psxbcmp(const void *s1, const void *s2, int n);
45uint32_t psxrand();
46void psxsrand(uint32_t seed);
47const void *psxlsearch(const char *key, const char *base, int nmemb, size_t size,
48 int (*compar)(const char *, const char *));
49const void *psxbsearch(const char *key, const char *base, int nmemb, size_t size,
50 int (*compar)(const char *, const char *));
51
52long strtol(const char *nptr, char **endptr, int base);
53static __inline__ int atoi(const char *str) { return strtol(str, NULL, 10); }
54static __inline__ long atol(const char *str) { return strtol(str, NULL, 10); }
55
56void qsort(void *base, size_t num, size_t size, int (*cmp)(const void *, const void *));
static int size
Definition string.h:149
volatile uint32_t * ptr
Definition cop0.c:80
const void * psxlsearch(const char *key, const char *base, int nmemb, size_t size, int(*compar)(const char *, const char *))
Definition libcmisc.c:183
int psxbcmp(const void *s1, const void *s2, int n)
Definition libcmisc.c:170
const char * psxstrpbrk(const char *s, const char *accepted)
Definition libcmisc.c:101
long strtol(const char *nptr, char **endptr, int base)
Definition libcmisc.c:47
const char * psxbcopy(const void *src, void *dst, int n)
Definition libcmisc.c:157
void qsort(void *base, size_t num, size_t size, int(*cmp)(const void *, const void *))
Definition qsort.c:34
uint32_t psxrand()
Definition libcmisc.c:176
char * psxatob(char *str, int *result)
Definition libcmisc.c:95
unsigned psxstrspn(const char *s, const char *accepted)
Definition libcmisc.c:111
const char * psxbzero(void *ptr, int n)
Definition libcmisc.c:164
unsigned psxstrcspn(const char *s, const char *rejected)
Definition libcmisc.c:128
int psxtodigit(int c)
Definition libcmisc.c:36
void psxatof(const char *str)
const void * psxbsearch(const char *key, const char *base, int nmemb, size_t size, int(*compar)(const char *, const char *))
Definition libcmisc.c:190
int psxdummy()
Definition libcmisc.c:34
int psxabs(int j)
Definition libcmisc.c:42
char * psxstrtok(char *str, const char *delim)
Definition libcmisc.c:146
void psxsrand(uint32_t seed)
Definition libcmisc.c:181
void * result
Definition memcpy.c:52
char * s
Definition string.c:48
static const char * s2
Definition syscalls.h:144
static int c
Definition syscalls.h:172
static size_t size_t int(* compar)(const void *, const void *))
Definition syscalls.h:210
static const char * src
Definition syscalls.h:132