Overview
Context
Changes
Modified src/Makefile
from [53919dfb87]
to [b48a2876b6].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
+
-
+
-
+
+
|
LIB = ${LIB_PREFIX}objfw${LIB_SUFFIX}
LIB_MAJOR = 1
LIB_MINOR = 0
SRCS = OFConstString.m \
SRCS = OFList.m \
OFList.m \
OFListObject.m \
OFObject.m \
OFString.m
OBJCFLAGS += -fPIC -DPIC -fno-nil-recivers -fconstant-string-class=OFConstString
INCLUDES = OFList.h \
INCLUDES = OFConstString.h \
OFList.h \
OFListObject.h \
OFObject.h \
OFString.h
include ../buildsys.mk
LD = ${OBJC}
LIBS += -lobjc
|
Added src/OFConstString.h version [d944b1298b].
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <stddef.h>
#import "OFObject.h"
@interface OFConstString: OFObject
{
const char *string;
size_t length;
}
+ new:(const char*)str;
- init;
- init:(const char*)str;
- (const char*)cString;
- (size_t)length;
@end
/* vim: se syn=objc: */
|
| | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFConstString.m version [f25f4f5f15].
|
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008
* Jonathan Schleifer <js@webkeks.org>
*
* All rights reserved.
*
* This file is part of libobjfw. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE included in
* the packaging of this file.
*/
#import <stdlib.h>
#import <string.h>
#import "OFConstString.h"
@implementation OFConstString
+ new:(const char*)str
{
return [[OFConstString alloc] init:str];
}
- init
{
return [self init:NULL];
}
- init:(const char*)str
{
if ((self = [super init])) {
if (str == NULL) {
length = 0;
string = NULL;
} else {
length = strlen(string);
string = str;
}
}
return self;
}
- (const char*)cString
{
return string;
}
- (size_t)length
{
return length;
}
@end
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Modified src/OFString.m
from [c26b0e5b15]
to [ec546376b0].
︙ | | |
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
-
-
|
* the packaging of this file.
*/
#import <stdlib.h>
#import <string.h>
#import "OFString.h"
/* TODO: Use getMem / resizeMem */
@implementation OFString
+ new:(const char*)str
{
return [[OFString alloc] init:str];
}
- init
|
︙ | | |