khia / cnoplus Goto Github PK
View Code? Open in Web Editor NEWExperiments with doing OOP in pure C.
License: Other
Experiments with doing OOP in pure C.
License: Other
DESCRIPTION ------------ Experiments with doing OOP in pure C. The library is a proof of concept code inspired by the book Object Oriented Programming in ANSI-C by Schreiner A. The implementation supports basic exception handling and printing stacktrace. It doesn't protect internal structures yet so it's not tread safe, but proper locking can be easiliy implemented. GOALS ------- OOP - achived Exception handling via THROW - achived Printing stacktrace - achived Dynamic tracing - not finished CONVENTIONS ------------- MACROS - All leters are capital. structures - Has suffix _s. types - Has suffix _t. objects - Has suffix _o. definitions - Has suffix _d. structure representing object - Has suffix _osd. enumerations - Have _e suffix. enumeration elements - Have suffix _EE, and prefix equals to file name. object definition in fact properties field of object as a object_osd structure - Has suffix _od. Global data - Has suffix _g. Constructors for objects - Has names suffixes _ctor. Destructors for objects - Has suffix _dtor. Selectors for different methods of objects - Has suffix _stor. Variables - starts from capital letter. EXAMPLE --------- // MAIN function should be replaced with main_int int main_int(int argc, char * argv[], exception_stack_osa * Stack) { int res; TRY{ res = helper(6, 2, Stack); DEBUG(HEAVY, "res: %i", main_int, res); // This branch will get control } CATCH (e_DivisionOnZero_g) { THROW(e_DivisionOnZero_g); } ENDTRY; TRY{ res = divide(6, 0, Stack); DEBUG(HEAVY, "res: %i", main_int, res); } CATCH (e_DivisionOnZero_g) { DEBUG(HEAVY, "EXCEPTION", main_int); // This branch will get control THROW(e_DivisionOnZero_g); } ENDTRY; return 0; } TODO ----- 1. Update build system to be able to build static and dynamic library library. 2. Implement proper locking.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.