iOS/buildlibs/armv7/allegro-4.4.2/addons/jpgalleg/src/decode.c
/* read_appn_chunk:
 *  Reads an APP0/APP1 (JFIF/EXIF descriptor) chunk from the input stream.
 */
Reads an APP0/APP1 (JFIF/EXIF descriptor) chunk from the input stream.
Reads an APP0 / APP1 ( JFIF / EXIF descriptor ) chunk from the input stream .
static int
read_appn_chunk(int n, int flags)
{
	char header[6] = { 0 };
	char *header_id;
	int i;
	if (n == CHUNK_APP0)
		header_id = "JFIF";
	else
		header_id = "Exif";
	_jpeg_open_chunk();
	if ((n == CHUNK_APP1) || (!(flags & APP0_DEFINED))) {
		for (i = 0; i < 5; i++) {
			if ((header[i] = _jpeg_getc()) != header_id[i]) {
				TRACE("Bad %s header, found %s", (n == CHUNK_APP0) ? "JFIF" : "EXIF", header);
				_jpeg_close_chunk();
				jpgalleg_error = JPG_ERROR_NOT_JPEG;
				return -1;
			}
		}
		if (n == CHUNK_APP0) {
			if (_jpeg_getc() != 1) {
				TRACE("Not a JFIF version 1.x file");
				_jpeg_close_chunk();
				return -1;
			}
		}
	}
	_jpeg_close_chunk();
	return 0;
}
static int read_appn_chunk ( int n , int flags ) { char header [ 6 ] = { 0 } ; char * header_id ; int i ; if ( n == CHUNK_APP0 ) header_id = " " ; else header_id = " " ; _jpeg_open_chunk ( ) ; if ( ( n == CHUNK_APP1 ) || ( ! ( flags & APP0_DEFINED ) ) ) { for ( i = 0 ; i < 5 ; i ++ ) { if ( ( header [ i ] = _jpeg_getc ( ) ) != header_id [ i ] ) { TRACE ( " " , ( n == CHUNK_APP0 ) ? " " : " " , header ) ; _jpeg_close_chunk ( ) ; jpgalleg_error = JPG_ERROR_NOT_JPEG ; return -1 ; } } if ( n == CHUNK_APP0 ) { if ( _jpeg_getc ( ) != 1 ) { TRACE ( " " ) ; _jpeg_close_chunk ( ) ; return -1 ; } } } _jpeg_close_chunk ( ) ; return 0 ; }
read_appn_chunk:
  Reads an APP0/APP1 (JFIF/EXIF descriptor) chunk from the input stream.
read_appn_chunk : Reads an APP0 / APP1 ( JFIF / EXIF descriptor ) chunk from the input stream .
/* Only JFIF version 1.x is supported */