Example of how to split a bitmap and save the parts to many files.
Compile with:
gcc -g -L/usr/local/lib save.c -lallegro -lallegro_memfile -lallegro_image -o save
