diff --git a/Developer-documentation.md b/Developer-documentation.md index 5f9813e..ca5ca68 100644 --- a/Developer-documentation.md +++ b/Developer-documentation.md @@ -45,6 +45,55 @@ There are two different kinds of functions that perform data validation: It is not unusual for a parser function to call a validator function to validate its whole input before extracting the fields. +## Functions + +This section gives an overview of the important source files and functions. + +### caff_tools.c + +This file contains functions that are used to validate and parse CAFF files. + +`parse_caff_header` is used to parse the header of a CAFF file. + +`validate_caff_credits` is used to validate the credits section of a CAFF file. + +`validate_caff_animation` is used to validate a single CAFF animation section. + +`validate_caff_file` is used to validate the whole CAFF file. + +`parse_caff_get_first_ciff` is used to parse a CAFF file and extract the first CIFF image from it. + +### ciff_tools.c + +This file contains functions that are used to validate and parse CIFF images. + +`validate_ciff` is used to validate a CIFF image. + +`parse_ciff_get_pixel_data` is used to parse a CIFF image and to find the location of pixel data. + +### magic_memory.c + +This file contains our own MagicMemory library that provides memory allocation functions. + +`magic_memory_begin` is used to create a MagicMemory context that can be used with other MagicMemory functions later. + +`magic_malloc` is the same as the standard `malloc`, but the pointer is also added to a context. Contexts are used to keep track of pointers so that they won't be lost. A context is basically a linked list of pointers. + +### main.c + +`main` is the entrypoint of the previewer module. + +`perform_extraction` takes care of the preview extraction process: it calls parser and validator functions and other helper functions. + +### utils.c + +`read_file_to_mem` is used to read CAFF files into memory. + + +### libtarga.c + +This files contains the [LibTarga](https://research.cs.wisc.edu/graphics/Gallery/LibTarga/) library by Alex Mohr. + # CAFF previewer wrapper This module makes communication between the previewer and the web client possible.