-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathglabel.c
More file actions
28 lines (25 loc) · 738 Bytes
/
glabel.c
File metadata and controls
28 lines (25 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "glabel.h"
int glabel_copy(Glabel* prDest, Glabel* prSrc) {
if ((prDest == NULL) || (prSrc == NULL)) {
return GLABEL_NULLPTR;
}
prDest->address = prSrc->address;
strncpy(prDest->text, prSrc->text, GLABEL_TEXT_LEN);
return GLABEL_SUCCESS;
}
int glabel_init(Glabel* prLabel) {
if (prLabel == NULL) {
return GLABEL_NULLPTR;
}
prLabel->address = 0;
memset(prLabel->text, 0, GLABEL_TEXT_LEN + 1);
return GLABEL_SUCCESS;
}
int glabel_set(Glabel* prLabel, const SceUInt32 address, const char* text) {
if (prLabel == NULL) {
return GLABEL_NULLPTR;
}
prLabel->address = address;
strncpy(prLabel->text, text, GLABEL_TEXT_LEN);
return GLABEL_SUCCESS;
}