GitHub
All our OpenSource projects have been migrated to GitHub.
Feel free to fork!
Feel free to fork!
About
The XEOS C Foundation library provides the base for object-oriented C style coding, reference counting memory management with auto-release capabilities, reflection, runtime environment, polymorphism, exceptions, and basic objects. It's purpose is to be integrated in the XEOS Operating System, once its C standard library will be complete.
For now, it's just a standalone project, that should compile on every OS with a decent C compiler.
Supported OS
XSFoundation can be used on POSIX compliant systems (Mac OS X, Unix, Linux) as well as on Windows.
Building
The standard command make will build static and dynamic versions of the XSFoundation library.
Linking
Once built, you can link with the XSFoundation library:
gcc -Wall -o exec_name libxeos.a source.c
Header files
A main header file is provided: XS.h. No other header file should be directly included.
Documentation
Wiki can be found on GitHub: https://github.com/macmade/XSFoundation/wiki
Basic example
#include "XS.h"
XSMainStart( argc, argv )
{
XSUInteger e;
XSString str1;
XSString str2;
XSString str3;
// String creation - The object will be released automatically
str1 = XSSTR( "hello, world" );
// Substring - The object will be released automatically
str2 = XSString_SubstringtoIndex( str1, 5 );
// String copy - The object will have to be released explicitly
str3 = XSCopy( str2 );
// Prints "hello, world, world, world"
XSLog( "This is a log message: $@$@$@", str1, str2, str3 );
// Release memory
XSRelease( str3 );
}
XSMainEnd( EXIT_SUCCESS )
License
XSFoundation is released under the Boost License.
Feel free to use and modify it at your convenience.
Feel free to use and modify it at your convenience.