GPS4Palm

Source Code Documentation


imginfo.c File Reference

#include <PalmOS.h>
#include "file_io.h"
#include "imginfo.h"
#include "stringil.h"

Include dependency graph for imginfo.c:

Go to the source code of this file.

Defines

#define USAT(a, b)   (((b)<<8)|(a))
#define BS   1440
#define SH(p)   ((ush)(uch)((p)[1]) | ((ush)(uch)((p)[0]) << 8))
#define LG(p)   ((ulg)(SH((p)+2)) | ((ulg)(SH(p)) << 16))

Typedefs

typedef unsigned char uch
typedef unsigned short ush
typedef unsigned long ulg

Functions

Boolean imginfo (FileDescrType fd, UInt8 *type, UInt16 *width, UInt16 *height)

Variables

const char png_magic [] = "\211PNG\r\n\032\n"
const char gif87a_magic [] = "GIF87a"
const char gif89a_magic [] = "GIF89a"
const char jpeg_magic [] = "\xFF\xD8"


Define Documentation

#define BS   1440
 

Definition at line 33 of file imginfo.c.

Referenced by imginfo().

#define LG  )     ((ulg)(SH((p)+2)) | ((ulg)(SH(p)) << 16))
 

Definition at line 40 of file imginfo.c.

Referenced by imginfo().

#define SH  )     ((ush)(uch)((p)[1]) | ((ush)(uch)((p)[0]) << 8))
 

Definition at line 39 of file imginfo.c.

#define USAT a,
b   )     (((b)<<8)|(a))
 

Definition at line 32 of file imginfo.c.


Typedef Documentation

typedef unsigned char uch
 

Definition at line 36 of file imginfo.c.

typedef unsigned long ulg
 

Definition at line 38 of file imginfo.c.

typedef unsigned short ush
 

Definition at line 37 of file imginfo.c.


Function Documentation

Boolean imginfo FileDescrType  fd,
UInt8 *  type,
UInt16 *  width,
UInt16 *  height
 

Definition at line 49 of file imginfo.c.

References BS, feof(), fread(), fseek(), gif87a_magic, gif89a_magic, IMGTYPE_GIF, IMGTYPE_PNG, LG, mapmax, memcpy(), png_magic, rewind(), SEEK_CUR, strcmp(), strlen(), strncmp(), and USAT.

Referenced by FileSelFormHandleEvent(), and search_map().


Variable Documentation

const char gif87a_magic[] = "GIF87a"
 

Definition at line 44 of file imginfo.c.

Referenced by imginfo().

const char gif89a_magic[] = "GIF89a"
 

Definition at line 45 of file imginfo.c.

Referenced by imginfo().

const char jpeg_magic[] = "\xFF\xD8"
 

Definition at line 46 of file imginfo.c.

const char png_magic[] = "\211PNG\r\n\032\n"
 

Definition at line 43 of file imginfo.c.

Referenced by imginfo().


Created: Mon, 08 Oct 2007 22:33:16 +0200
Copyright ©2004 M. Prinke