Log In
New Account
  
 
Home My Page Project Tree Code Snippets Project Openings
 

Browse | Submit A New Snippet | Create A Package

 

Snippets by language: C

Snippet ID Title
Packages Of Snippets1DansguardianOzgur Karatas
DG content filtering latest versions for debian package.
Snippets
5A new strncpy: CPStrncpyManfred Rebentisch
This CPStrnpy() always copies a null at the end of the destination buffer and write only strlen(src) bytes, if the len is shorter than the given maximal size. So you get more performance. But destination buffer must have a size of n + 1.
6Merge Strings with CPStrDupArgManfred Rebentisch
CPStrDupArg copies all given strings inta a new one and returns it. For the returned string is memory allocated, free it with free(). The last argument must be a NULL.
Example:
myPath = CPStrDupArg(rootDir, "/", myDir, NULL);
7Get free disc space with a C-classManfred Rebentisch
With this C-'class' you get disc information.
It is an example, how to program with C using encapsulate methods. I think, using C-objects makes C-programming easier.
11Decimal EmpaquetadoAndres Ovalle
Algoritmo de empaquetamientos de decimales.
12Binario -> HexadecimalAndres Ovalle
Conversion de un Binario a un Hexadecimal, en agrupacion de 4 bits
13enum as string macroNeil Williams
For those times when you want to be able to export an enum to text. No point just printing the digit value, that could change with the next release/compile/patch - and it's a real hassle writing the switch statements yourself. This little macro (actually it's a collection of macros) can be defined in header files and be implemented in the .c, it can be read by doxygen (with suitable config) and it allows you to set the value for the enum as well.

Powered By GForge Collaborative Development Environment