9ee696ab — Louis Solofrizzo 1 year, 2 months ago master
Typos: Fix a bug in the RSS and some typos in the help

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
37aec51b — Louis Solofrizzo 1 year, 2 months ago
Readme: Add a basic README to the project, typos in the code

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
54ec38a8 — Louis Solofrizzo 1 year, 2 months ago
Rss: Now generating feed and sitemap

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
cbec05b2 — Louis Solofrizzo 1 year, 2 months ago
Dump: Now dumping the website and generating the index

This commit introduces full website HTML dumping, with route and such.
I've added a sort by time in order to generate the index correctly,
which is now done.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
289e1237 — Louis Solofrizzo 1 year, 2 months ago
Builder: Now reading layouts and copying final files

This commit do introduce layouts reading, in order to easily use them
later on. I've also coded the entire file copy needed for the final
website (Favicon, styles and images).

On another note, I've reworked the main offset API a bit, since I use it
in two different places now.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
f6d0086b — Louis Solofrizzo 1 year, 2 months ago
Parser: Now parsing markdown from posts files

We now parse the content of a markdown post, and convert it to html.
I've also added more error messages in case of parsing error, and fixed
a crash on a file size of 0.

I've also modified the pool API a bit, with a more simple approach on
the user side, and the possibility to be called back with the current
thread number

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
02d774e5 — Louis Solofrizzo 1 year, 2 months ago
Parser: Now (concurrently) parsing header of posts file

This commit introduces full reading and header parsing from posts files.
In order to do that, so changes were made to the core code. Mainly, a
new API to execute asynchronous code in pool.c. I've also added a
--debug flag to the binary, and some fixes here and there to the log
functions.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
7816c787 — Louis Solofrizzo 1 year, 2 months ago
Args: Add command line argument line parsing

This commit introduce full argument parsing in shayla. There is several
options in the code, and since the --help option is covering all of
them, I will not go one-by-one in this commit message.

On the minor side of this patch, I fixed a memory leak in the 'add_file'
function, and changed the compilation standard from C99 to C11.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
15b02325 — Louis Solofrizzo 1 year, 3 months ago
Files: Add recursive file listing

This commit introduces numerous things. The main one is to be able to
list every file in a directory with 'list_dir', using linked lists for
that. The implementation is to be safe, and seems so at the moment
(Valgrind does not shout at me). File links are properly handled,
exception made for kernel file systems (/proc, /dev, etc) which are
hardcoded to be ignored at the moment.

I've also added creation / destruction method for the main context
(shayla_t) and files (file_t), it should be now simple and clear.

Last, there is the (almost) entire linux linked list implementation,
adapted for user space and my needs.

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
96b3e3e2 — Louis Solofrizzo 1 year, 3 months ago
License: Add GPL License to the tree

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>
bfd9b032 — Louis Solofrizzo 1 year, 3 months ago
Log: Add various log functions and macros

This commit do introduce various helpers on logging inside shayla. I've
also imported my 'utils.h' file, which I do not use much at the moment,
but will come handy in the future. As for the log helpers:

Simple log macros:
- INFO
- WARNING
- ERROR
- FATAL
- DEBUG

I've also added a more 'complex' API for progressions. The code is well
documented, but I'll describe the basics here:

One can start a progression with PROGRESS_BEGIN(). This macro takes a
printf-like format, aswell as all of the macros in this API. Once the
progress has begun, and the huge task is underway, one can update the
displayed message with PROGRESS_UPDATE(). If one encounter an error in
the progression, the status and message can be updated with
PROGRESS_ERROR(). Otherwise, one can terminate the progression with
PROGRESS_DONE(). Here's a simple example:

> PROGRESS_BEGIN("Massive allocation...");
>
> for (size_t i = 0; i < 100000; i++)
> {
>     char *ptr = malloc(2048);
>     if (ptr == NULL)
>     {
>         PROGRESS_ERROR("Cannot allocate memory");
>         return ;
>     }
>
>     PROGRESS_UPDATE("Chunk %zu allocated", i);
>     usleep(200);
> }
>
> PROGRESS_DONE();

Signed-off-by: Louis Solofrizzo <lsolofrizzo@online.net>