cutils icon indicating copy to clipboard operation
cutils copied to clipboard

Set of Minimal C Utilities

                                                        .;oO0.
                                                        cXMM0.
                                              .xKKo      ;WM0
                                              .KMMO.     ,WM0
                                                ""       ,WM0
                                    ;;                   ,WM0
 .';ccc:,.  ...,:.     ...,:.    .:OWO.....     ;lc      ,WM0       .,:cc:,.

.oOXl;":l0WK. ,kWMN' :kWMM: :kWMMXkkkkk' cXMMk ,WM0 .kXo;":oXk lN0. l: .KMN' 0MM; .KMMd oMMx ,WM0 kM0 'd oWX. .0MN' OMM; .KMMd :MMx ,WM0 xMWk, NMk .KMN' OMM; .KMMd :MMx ,WM0 .lXMMXx; MMK. .KMN' OMM; .KMMd cMMx ,WM0 ;dKMMK; 0MMk. .KMW' OMM; .KMMd cMMx ,WM0 ,. :XMN 'KMMKc. ,x: OMMx :XMMc 0MMK. cMMk ,WM0. x0. dMX .l0WMWK0OOOd' '0WMXxddolcKMMXdl. :KWMXxooc. ;l0WWNoc. ,cOWWNxc. ;XXo;,,oKk' 'ldkxo:' :dkkd:" TOl:' ':dkxo' 'P"'''"P' 'P"'''"P' .cdkkdc.

ABOUT

cutils (C Utilities) is a collection of simple, modern and truly powerful tools to make one's life a little easier when programming in C. The utilities were created mostly to fulfill the personal needs of the author, however he hopes and believes many will find the tools just as useful and essential as he does.

For detailed information and documentation visit:

http://www.cutils.org

INSTALL

  1. Install LibYAML (eg. pacman -S libyaml)
  2. Install pyyaml (eg. pip install pyyaml)
  3. Install pyhashxx (eg. pip install pyhashxx)
  4. Edit MAKEFILE => set libraries and python location
  5. make
  6. sudo make install

CONTRIBUTOR'S NOTE

cutils uses very strict naming conventions, so, if you want to contribute to it, you have to follow these rules. In my personal experience, the conventions described below truly makes the code cleanewr, easier to read, to understand, to modify later on and make it maintainable on the long run.

Public variable and function/method names:

all_lowercase_letters_separated_by_underscores

eg.:

    /* inline variable name */
    bool error_flag = false;

    /* method name of object in global namespace */
    cutils_cdar_DynamicArray_void_ptr_new()
      ^       ^          ^             ^
      |       |          |             |
    project  module    object        method
     name     name      name          name

Private variable and function/method names:

_all_lowercase_letters_separated_by_underscores_started_with_underscore

eg.: int _counter;

Constants (macros enums):

FULL_UPPERCASE_LETTERS_SEPARATED_BY_UNDERSCORE

eg.:

    /* inline and public constants */
    #define CUTILS_NAMESPACE

    /* guard macro variables */
    _C_APPLICATION_PROGRAMMING_INTERFACE_H_27277619327951796_
    ^                   ^                ^        ^         ^
    |                   |                |        |         |
   leading          full name        extension  random   trailing
  underscore      of the module                 number  underscore

Labels:

Words_Started_With_Capital_Letters_Separated_By_Underscore

eg.: goto Error_Window_Initialisation_Failed;

Objects:

WordsStartedWithCapitalLettersAndNotSeparated

eg.: typedef struct {} MyObject;

    DynamicArray_unsigned_long_long
         ^               ^
         |               |
     base type        related
                    standard type

LICENSE

Copyright (C) 2014 Peter Varo

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program, most likely a file in the root directory, called 'LICENSE'. If not, see http://www.gnu.org/licenses.