-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
73 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "PR/os_internal.h" | ||
|
||
void* memset(char* s, int c, size_t n) { | ||
int i; | ||
|
||
for (i = 0; i < n; i++) { | ||
s[i] = c; | ||
} | ||
|
||
return s; | ||
} |
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,9 @@ | ||
#include "PR/os_internal.h" | ||
|
||
const char gSaCertFname[] = "cert.sys"; | ||
const char gSaRlFname[] = "crl.sys"; | ||
const char gSaAppExt[] = "app"; | ||
const char gSaRecExt[] = "rec"; | ||
const char gSaTicketFname[] = "ticket.sys"; | ||
const char gSaRecryptKeyFname[] = "recrypt.sys"; | ||
const char gSaClubTitle[] = "iQue Club"; |
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,16 @@ | ||
#include "PR/os_internal.h" | ||
|
||
int memcmp(void* s1, void* s2, size_t n) { | ||
u8* a = s1; | ||
u8* b = s2; | ||
u8 a1, b1; | ||
|
||
while (n-- > 0) { | ||
b1 = *b++; | ||
a1 = *a++; | ||
if (a1 != b1) { | ||
return a1 - b1; | ||
} | ||
} | ||
return 0; | ||
} |
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,17 @@ | ||
#include "PR/os_internal.h" | ||
|
||
int strcmp(u8* s, u8* t) { | ||
while (*s && *t && *s == *t) { | ||
s++; | ||
t++; | ||
} | ||
|
||
if (*s < *t) { | ||
return -1; | ||
} | ||
if (*s > *t) { | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} |
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,20 @@ | ||
#include "PR/os_internal.h" | ||
|
||
int strncmp(char* s, char* t, int n) { | ||
int i; | ||
|
||
for (i = 0; (*s == *t) && (i < n); i++) { | ||
if (*s == 0) { | ||
if (*t == 0) { | ||
return 0; | ||
} | ||
break; | ||
} | ||
if (*t == 0) { | ||
break; | ||
} | ||
s++; | ||
t++; | ||
} | ||
return (i != n) ? *s - *t : 0; | ||
} |