It has been one month that the third year (called Ing1) of EPITA started and this is a recap of the interesting projects that I developed.
malloc (1 week)
The goal of this mini-project is to improve our knowledge of memory management by implementing the C standard library memory allocator (malloc, free, realloc). Implementation using the Binary Buddy technique:
- List of free blocks of size 2^k.
- Split and Merge using adjacent block of the same size called buddy.
- Insertion and Deletion in O(log n).
- 32 & 64 bit ready.
find (1 week)
find is a very well known UNIX command used to satisfy research upon files and directories.
- File listing and options parsing with error handling.
- -name: Filtering using globbing.
- -newer, -atime, -size, -inum, -type, -links: Filtering off information sources. Handles -/+ for "less/more than".
- -perm: Filtering based on permission expressed in octal (0777) or symbolic (u+rwx,go=r) notation.
fnmatch (10 hours)
fnmatch is a function that implements globbing. It returns whether the string matches the pattern. This is mainly used to filter out files (eg: *.txt) or text search in databases (eg: LIKE '%Text%').
- *: any character 0 or more times.
- ?: any character 1 time.
- [abcA-Z]: any character from the class.
- \*: escaping.
Libstream (10 hours)
I/O functions are slow hence they should be called few time as possible. This is why they are typically buffered. The project is to recode all the I/O buffered functions of the C standard library as they are defined by the Single UNIX Specifications V3.
- fopen, fclose, fgetc, fputc, fflush: Core functions to handle buffered I/O at a character level.
- fseek, ftell, frewind: File positioning functions.
- fread, fwrite, fgets, fputs, fgetdelim: Helper functions to use buffered I/O at a string level.
- tinyPrintf: Basic string formatting (%d, %u, %s, %c, %o, %x without modifiers).