misc: Added a module to put misc. functions

It currently have only one function that calls perror and exit.
Certainly more functions to come...

Signed-off-by: Celelibi <celelibi@gmail.com>
misc: added functions asprintf and avsprintf

These functions act like sprintf and vsprintf, except they allocate
their arguments instead of requiring a pre-allocated one.

Signed-off-by: Celelibi <celelibi@gmail.com>
getopthelp: added module getopthelp

This module is a wrapper around getopt_long that handle the short and
long options in an unified way. It can also generate help message
automatically.

Signed-off-by: Celelibi <celelibi@gmail.com>
Makefile: Added generation of .d files

These files contains the dependancies between the .o, .c and .h.

Signed-off-by: Celelibi <celelibi@gmail.com>
getopthelp: Fix comments

Consistent comment-block style. Make valid sentences.

Signed-off-by: Celelibi <celelibi@gmail.com>
getopthelp: Added argidx field

This field is set to the first non-option argument index in argv. So
that the caller can reach its mandatory arguments. It is equivalent to
optind for getopt.

Signed-off-by: Celelibi <celelibi@gmail.com>
filtered_string: Module for accessing strings

It allows the caller to access only the characters that belong to a
given charset without having to modify the real string.

Signed-off-by: Celelibi <celelibi@gmail.com>
filtered_string: Comment fix

Made the comment for function fs_update more explicit.

Signed-off-by: Celelibi <celelibi@gmail.com>
misc: Added function custom_error

This function prints a message on stderr and exit.

Signed-off-by: Celelibi <celelibi@gmail.com>
filtered_string: Don't mark the string as const

Sometimes we need to access it through the struct to modify the data.
Especially in the forthcoming vigenere module.

Signed-off-by: Celelibi <celelibi@gmail.com>
getopthelp: Added argval to the struct state

This field contains the value of the option when it takes one.

Signed-off-by: Celelibi <celelibi@gmail.com>
vigenere: New module for ciphering / deciphering

It just does plain (de)ciphering using filtered_string. Thus it keeps
case and spaces and every non-alpha character.

Signed-off-by: Celelibi <celelibi@gmail.com>
unvigenere: Just cipher / decipher

Cracking is not yet implemented, but still this program makes something
useful. :)

Signed-off-by: Celelibi <celelibi@gmail.com>
misc: Added custom_warn

This function print a message on stderr.

Signed-off-by: Celelibi <celelibi@gmail.com>
Makefile: Generate the .d when no goal is given

The special case when no target is given to make prevented the .d files
to be included. Thus some dependancies were missing sometimes.

Signed-off-by: Celelibi <celelibi@gmail.com>
.gitignore: Add .deps directory

Signed-off-by: Celelibi <celelibi@gmail.com>
vigenere: Corrected buffer overruns

We used to read more than the whole string by not checking the right
termination condition.

Signed-off-by: Celelibi <celelibi@gmail.com>
array: new module to handle basic arrays

It just have a few functions and macros to do what you would write by
hand.

Signed-off-by: Celelibi <celelibi@gmail.com>
vigenere: Use array module

Instead of doing array manipulations itself.

Signed-off-by: Celelibi <celelibi@gmail.com>
unvigenere: Use array module

This simplify the code quite a bit.

Signed-off-by: Celelibi <celelibi@gmail.com>