Sharing the essence: use open-source code to write Linux programs-general Linux technology-Linux programming and kernel information. The following is a detailed description.
Collation
Programming in linux doesn't have to be written on its own. However, many open-source files can be reused on the Internet. This article is only for conversion, and we also want to share with each other how to effectively use these resources, never be stingy with your experience.
Origin
When I was a child, I liked cartoon cartoons. I recently accidentally saw many cartoons I 've seen on the Internet, such as donwloading ..., however, these cartoons are all placed in a zip package, and it seems inconvenient to decompress them. win has some software that looks at the image directly in the zip package and is easy to use, but in linux, there are very few and even x is needed. It is usually inconvenient for people like me who work directly in the console without x. Therefore, I want to write a small tool to solve this problem.
Problem
In the initial stage, the tool needs to solve the problems of zip decompression, image decoding, and graphic display, which are irrelevant to the code-level platform.
There are two solutions for zip decompression:
1. Use the unzip tool (zipinfo and unzip) to complete
2. Use zlib and its packaging library zziplib
The image-related SDL_image library is used for SDL and related image decoding.
Unzip usage
CODE: # define UNZIP "unzip-p-qq-P" # Define UNZIP_TEST "unzip-q-t-P" # Define ZIPINFO "zipinfo-1" # Define SORT "sort-gin" |