Snippet ID |
Title |
|
Packages Of Snippets | | 1 | Dansguardian | Ozgur Karatas |
DG content filtering latest versions for debian package. |
Snippets |
5 | A new strncpy: CPStrncpy | Manfred 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. |
6 | Merge Strings with CPStrDupArg | Manfred 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); |
7 | Get free disc space with a C-class | Manfred 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. |
11 | Decimal Empaquetado | Andres Ovalle |
Algoritmo de empaquetamientos de decimales. |
12 | Binario -> Hexadecimal | Andres Ovalle |
Conversion de un Binario a un Hexadecimal, en agrupacion de 4 bits |
13 | enum as string macro | Neil 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.
|