ObjFW  Check-in [06cf4cc15f]

Overview
Comment:OFSystemInfo: Add ObjFW version
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 06cf4cc15f9ff68fcb3ed5c4b041e4143da76b9fd72bca2bdf672f5cab3cb704
User & Date: js on 2018-07-01 15:14:59
Other Links: manifest | tags
Context
2018-07-03
23:35
ofhttp: Move around the _URLIndex-- check-in: ba6cb57178 user: js tags: trunk
2018-07-01
15:14
OFSystemInfo: Add ObjFW version check-in: 06cf4cc15f user: js tags: trunk
2018-06-30
00:41
OFApplication: Add property for the active sandbox check-in: 8eedb5a39a user: js tags: trunk
Changes

Modified configure.ac from [934377061f] to [d04140f36d].

1
2
3
4
5


6
7
8
9
10
11
12
AC_INIT(ObjFW, 0.91-dev, js@heap.zone)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux/m4)



dnl This may only be set to 0.91 once 0.91 is released
AC_SUBST(BUNDLE_VERSION, 0.90.9900)
AC_SUBST(BUNDLE_SHORT_VERSION, 0.90)

for i in configure.ac build-aux/m4/*; do
	AS_IF([test $i -nt configure], [
		AC_MSG_ERROR([$i is newer than configure! Run autoreconf!])





>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
AC_INIT(ObjFW, 0.91-dev, js@heap.zone)
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(build-aux)
AC_CONFIG_MACRO_DIR(build-aux/m4)

AC_DEFINE(OBJFW_VERSION_MAJOR, 0, [The major version of ObjFW])
AC_DEFINE(OBJFW_VERSION_MINOR, 91, [The minor version of ObjFW])
dnl This may only be set to 0.91 once 0.91 is released
AC_SUBST(BUNDLE_VERSION, 0.90.9900)
AC_SUBST(BUNDLE_SHORT_VERSION, 0.90)

for i in configure.ac build-aux/m4/*; do
	AS_IF([test $i -nt configure], [
		AC_MSG_ERROR([$i is newer than configure! Run autoreconf!])

Modified src/OFSystemInfo.h from [6c02f851ee] to [ac9dd61ea3].

25
26
27
28
29
30
31



32
33
34
35
36
37
38
 *
 * @brief A class for querying information about the system.
 */
@interface OFSystemInfo: OFObject
#ifdef OF_HAVE_CLASS_PROPERTIES
@property (class, readonly, nonatomic) size_t pageSize;
@property (class, readonly, nonatomic) size_t numberOfCPUs;



@property (class, readonly, nullable, nonatomic) OFString *operatingSystemName;
@property (class, readonly, nullable, nonatomic)
    OFString *operatingSystemVersion;
# ifdef OF_HAVE_FILES
@property (class, readonly, nullable, nonatomic) OFString *userDataPath;
@property (class, readonly, nullable, nonatomic) OFString *userConfigPath;
# endif







>
>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 *
 * @brief A class for querying information about the system.
 */
@interface OFSystemInfo: OFObject
#ifdef OF_HAVE_CLASS_PROPERTIES
@property (class, readonly, nonatomic) size_t pageSize;
@property (class, readonly, nonatomic) size_t numberOfCPUs;
@property (class, readonly, nonatomic) OFString *ObjFWVersion;
@property (class, readonly, nonatomic) unsigned int ObjFWVersionMajor;
@property (class, readonly, nonatomic) unsigned int ObjFWVersionMinor;
@property (class, readonly, nullable, nonatomic) OFString *operatingSystemName;
@property (class, readonly, nullable, nonatomic)
    OFString *operatingSystemVersion;
# ifdef OF_HAVE_FILES
@property (class, readonly, nullable, nonatomic) OFString *userDataPath;
@property (class, readonly, nullable, nonatomic) OFString *userConfigPath;
# endif
65
66
67
68
69
70
71





















72
73
74
75
76
77
78
 *
 * A CPU with multiple cores counts as multiple CPUs.
 *
 * @return The number of CPUs installed in the system
 */
+ (size_t)numberOfCPUs;






















/**
 * @brief Returns the name of the operating system the application is running
 *	  on.
 *
 * @return The name of the operating system the application is running on
 */
+ (nullable OFString *)operatingSystemName;







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 *
 * A CPU with multiple cores counts as multiple CPUs.
 *
 * @return The number of CPUs installed in the system
 */
+ (size_t)numberOfCPUs;

/*!
 * @brief The version of ObjFW.
 *
 * @return The version of ObjFW
 */
+ (OFString *)ObjFWVersion;

/*!
 * @brief The major version of ObjFW.
 *
 * @return The major version of ObjFW
 */
+ (unsigned int)ObjFWVersionMajor;

/*!
 * @brief The minor version of ObjFW.
 *
 * @return The minor version of ObjFW
 */
+ (unsigned int)ObjFWVersionMinor;

/**
 * @brief Returns the name of the operating system the application is running
 *	  on.
 *
 * @return The name of the operating system the application is running on
 */
+ (nullable OFString *)operatingSystemName;

Modified src/OFSystemInfo.m from [3534efb1b1] to [4d8db1e98a].

306
307
308
309
310
311
312















313
314
315
316
317
318
319
	return pageSize;
}

+ (size_t)numberOfCPUs
{
	return numberOfCPUs;
}
















+ (OFString *)operatingSystemName
{
#ifdef OF_HAVE_THREADS
	static of_once_t onceControl = OF_ONCE_INIT;
	of_once(&onceControl, initOperatingSystemName);
#else







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
	return pageSize;
}

+ (size_t)numberOfCPUs
{
	return numberOfCPUs;
}

+ (OFString *)ObjFWVersion
{
	return @PACKAGE_VERSION;
}

+ (unsigned int)ObjFWVersionMajor
{
	return OBJFW_VERSION_MAJOR;
}

+ (unsigned int)ObjFWVersionMinor
{
	return OBJFW_VERSION_MINOR;
}

+ (OFString *)operatingSystemName
{
#ifdef OF_HAVE_THREADS
	static of_once_t onceControl = OF_ONCE_INIT;
	of_once(&onceControl, initOperatingSystemName);
#else

Modified tests/OFSystemInfoTests.m from [76ac388a21] to [c232948306].

28
29
30
31
32
33
34








35
36
37
38
39
40
41
- (void)systemInfoTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

	PRINT(GREEN, @"Page size: %zd", [OFSystemInfo pageSize]);

	PRINT(GREEN, @"Number of CPUs: %zd", [OFSystemInfo numberOfCPUs]);









	PRINT(GREEN, @"Operating system name: %@",
	    [OFSystemInfo operatingSystemName]);

	PRINT(GREEN, @"Operating system version: %@",
	    [OFSystemInfo operatingSystemVersion]);








>
>
>
>
>
>
>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
- (void)systemInfoTests
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];

	PRINT(GREEN, @"Page size: %zd", [OFSystemInfo pageSize]);

	PRINT(GREEN, @"Number of CPUs: %zd", [OFSystemInfo numberOfCPUs]);

	PRINT(GREEN, @"ObjFW version: %@", [OFSystemInfo ObjFWVersion]);

	PRINT(GREEN, @"ObjFW version major: %u",
	    [OFSystemInfo ObjFWVersionMajor]);

	PRINT(GREEN, @"ObjFW version minor: %u",
	    [OFSystemInfo ObjFWVersionMinor]);

	PRINT(GREEN, @"Operating system name: %@",
	    [OFSystemInfo operatingSystemName]);

	PRINT(GREEN, @"Operating system version: %@",
	    [OFSystemInfo operatingSystemVersion]);