Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.548.789 Times

libxcpc 0.21

  Date Added: November 13, 2010  |  Visits: 667

libxcpc

Report Broken Link
Printer Friendly Version


Product Homepage
Download (72 downloads)



libxcpc library implements an automatic resource cleanup and exception handling in C. Error handling and cleanup code (at least for code that does error handling) can take quite some space in terms of lines of code to be written. This not only increases the binary size, but makes the code more difficult to read. C++ has native exception handling, and this solves part of the problem, while keeping exposed the resource cleanup one. The libxcpc offers C++ like exception handling, plus automatic resource cleanup, to be used in software written in C. The libxcpc introduces three abstractions, that are Resource, Container and Exception. The Resource is every object (or action) that needs cleanup. This can be a block of allocated memory, an open file, a mapped memory region, etc... Every allocated Resource is owned by a Container. A Resource can be moved from a Container to another. A Container is a bucket inside which Resource are allocated. A Container can be the parent of other Containers, by hence introducing a parent/child relationship between Containers. A Container can be reassigned to be child of a new Container. By freeing a Container all the Resources allocated inside the Container will be freed, and all the child Containers will be recursively freed too. Resource Containers greatly simplify the resource cleanup code, by being able to issue a single call to free a Container and having automatically all the Resources contained by it, freed as well. Resources are added/removed in a LIFO (Last In First Out) way, and the libxcpc library offers APIs to re-arrange the order of the Resources inside their Contexts. An Exception is (like in C++) any kind of abnormal condition that prevent the program to flow in its path. This can be a failed memory allocation, a failure to open a file, a failure to mmap(2) a portion of a file, a failure to write(2) a file, etc... An Exception is described by a unique number (int) and by an associated data (void *). Exceptions are thrown using the XCPC_THROW(ctx, exno, data) statement, or re-thrown using XCPC_RETHROW(ctx). A nice feature of exception handling, is that it allows you to handle only certain kind of exceptions, and different exceptions in different points of your code tree. Using libxcpc library, you handle exceptions by surrounding the potentially-throwing code with the XCPC_TRY(ctx) statement. The code can then use either the XCPC_CATCH(exno) or the XCPC_CATCH_ANY statements to handle specific or all kind of exceptions that happened in the code bound by the XCPC_TRY(ctx). An Exception block must be terminated by a XCPC_END_TRY statement. If the current Exception block does not handle the current Exception using the XCPC_CATCH(exno) statement, and does not have a XCPC_CATCH_ANY statement, the libxcpc library backtrack to find a valid handler in the code at higher layers of the call hierarchy. It is important that at least the other Exception block uses a XCPC_CATCH_ANY statement, so that any Exceptions not caught by the code, is handled properly. When an Exception is caught by an handler, all the resources allocated by the code from the beginning of the XCPC_TRY(ctx) block, down to the place where the Exception is thrown, are automatically freed once the handler reaches the XCPC_END_TRY statement. Whats New in This Release: - This release adds new system calls wrappers and fixes a few minor bugs..

Requirements: No special requirements
Platforms: Linux
Keyword: Catch Cleanup Code Container Exception Exception Handling Handling Libraries Libxcpc Programming Resource Try Xcpc
Users rating: 0/10

License: Freeware Size: 389.12 KB
USER REVIEWS
More Reviews or Write Review


LIBXCPC RELATED
Libraries  -  Exception::Class::TryCatch 1.10
Exception::Class::TryCatch is a syntactic try/catch sugar for use with Exception::Class. SYNOPSIS use Exception::Class::TryCatch; # simple usage of catch() eval { Exception::Class::Base->throw(error) }; catch my $err and warn $err->error;...
15.36 KB  
Libraries  -  Exception::Class 1.23
Exception::Class is a Perl module that allows you to declare real exception classes in Perl. SYNOPSIS use Exception::Class ( MyException, AnotherException => { isa => MyException }, YetAnotherException => { isa => AnotherException,...
16.38 KB  
Libraries  -  Exception::System 0.0601
Exception::System is the exception class for system or library calls. SYNOPSIS # Loaded automatically if used as Exception::Bases argument use Exception::Base Exception::System, Exception::File => { isa => Exception::System }; try...
10.24 KB  
Code Management Tools  -  Jedi Code Format 2.3+
The Jedi Code Formatter is an Open-Source code formatter for the Borland Delphi Object-Pascal programming language. The formatter can standardize all aspects of Delphi Object Pascal and Delphi.NET source code formatting, including indentation,...
2.5 MB  
Teaching Tools  -  Computing and Information Technology 9.2
Computing - Data Structures - Data Files - Computer Systems - Data Handling - System Development - Computer Programming - Binary Numbers - Binary Arithmetic - Number Systems - Digital Techniques - Logic Gates - Logic Gates 2 - Logic Families -...
4.36 MB  
Development Editors  -  Code::Blocks EDU Portable 1.1.1
Code::Blocks is an open source, free, configurable programming environment for C/C++. The Code::Blocks EDU-Portable interface, integrated help, tools and default compilation settings are all configured for ease of learning C and C++. The...
116 MB  
Programming  -  Jalopy Java Source Code Formatter 0.2.1.5rc3
Jalopy is a source code formatter/beautifier/pretty printer for the Java programming language. It is aimed to provide a full-featured, yet free alternative to the well-known Jindent. Plug-ins for Ant, Eclipse, IDEA, JBuilder, JDeveloper, jEdit,...
1.66 MB  
HTML Utilities  -  Source Morph 1.0.1
Source Morph is program that converts C, C++, Visual Basic, QBasic, Java, JavaScript, and Perl programs into webpages that display your code with the same syntax highlighting as your programming environment. Converts hundreds of files at once....
1.78 MB  
Programming  -  lptools 1.03b
The lptools suite provides a complete, programming-language independent, literate programming environment. The suite targets XML documentation, but the underlying system has no bias that would disadvantage other documentation languages. Also...
92.16 KB  
Development Tools  -  FinPerf 1.0
This is the example code for the Fall 2003 News and Notes Programming Patterns article. The code demonstrates how to call C functions directly from MATLAB without writing a MEX-file. The example computes the profitability of PeopleSoft, using the...
419.84 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB