Main Page   File List   Globals  

libinfo.h File Reference

Library header. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for libinfo.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define LI_UNSELECTED   0
#define LI_SELECTED   1
#define LI_OUTPUT_XPM
#define LI_OUTPUT_PPM
#define LIBINFO_VERSION   "1.0 Beta"
#define LIBINFO_DATE   "20/11/2003"
#define LIBINFO_COPYRIGHT   "Copyright (C) 2003 Gary Harris <garyjharris@users.sourceforge.net>"

Typedefs

typedef unsigned char u8
typedef signed char s8
typedef unsigned short u16
typedef unsigned int u32

Functions

int LIReadDefIcon (char *filename)
 Read images from a default icon.

int LIReadNewIcon (char *filename)
 Read images from a NewIcon.

void LICleanUp (void)
 Release memory and clean up.

int LISetXPMTransparency (int colour)
 Set transparent colour for XPM output.

int LIWriteXPM (char *filename, int image)
 Write icon image to XPM image.

int LIWritePPM (char *filename, int image)
 Write icon image to PPM image.

char * LIGetVersion (void)
 Get the library version.

char * LIGetDate (void)
 Get the library release date.

char * LIGetCopyright (void)
 Get the library copyright.

u16 Get16 (u8 *p)
u32 Get32 (u8 *p)
int Read8 (u8 *buf, int len)
int ReadHeader (void)
int ReadIcon (int image)
int ReadNewicon (int image, char *name)
u8 * DecompressNewicon (u8 *src, char *name, int len, int bits)
char * ReadString ()
int StartTooltypes ()
u8 * GetTooltype (char *name)
int WriteXPM (char *filename, int width, int height, int ncols, u8 *palette, int image)
int WritePPM (char *filename, int width, int height, int ncols, u8 *palette, int image)

Variables

u8 * LIBitmapUnselected
u8 * LIBitmapSelected
u8 * LIPalette
int LIWidth
int LIHeight
int LINumColours
char * LIErrorString
FILE * fileIcon
u16 magic
u16 version
u16 type
u32 image1
u32 image2
u32 tool
u32 num_tooltypes


Detailed Description

Library header.

libinfo - a library to read Amiga icon files.

Copyright (C) 2003 Gary Harris <garyjharris@users.sourceforge.net>.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

libinfo recognizes the default Workbench and NewIcons formats.

libinfo is based on:

amicon: an Amiga icon to ppm/xpm convertor. Copyright 2001 Adam Sampson <azz@gnu.org>

Definition in file libinfo.h.


Define Documentation

#define LI_OUTPUT_PPM
 

Define to include PPM output code.

Definition at line 60 of file libinfo.h.

#define LI_OUTPUT_XPM
 

Define to include XPM output code.

Definition at line 59 of file libinfo.h.

#define LI_SELECTED   1
 

Selected Icon Image.

Definition at line 48 of file libinfo.h.

Referenced by LIReadDefIcon(), and LIReadNewIcon().

#define LI_UNSELECTED   0
 

Unselected Icon Image.

Definition at line 47 of file libinfo.h.

Referenced by LIReadDefIcon(), and LIReadNewIcon().


Function Documentation

void LICleanUp void   ) 
 

Release memory and clean up.

Returns:
Nil.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 209 of file libinfo.c.

References LIBitmapSelected, LIBitmapUnselected, and LIPalette.

char* LIGetCopyright void   ) 
 

Get the library copyright.

Returns:
The library copyright.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 257 of file libinfo.c.

char* LIGetDate void   ) 
 

Get the library release date.

Returns:
Library creation date.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 242 of file libinfo.c.

char* LIGetVersion void   ) 
 

Get the library version.

Returns:
The version number.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 226 of file libinfo.c.

int LIReadDefIcon char *  filename  ) 
 

Read images from a default icon.

Parameters:
filename - The path to the icon.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 68 of file libinfo.c.

References LI_SELECTED, LI_UNSELECTED, and LIErrorString.

int LIReadNewIcon char *  filename  ) 
 

Read images from a NewIcon.

Parameters:
filename - The path to the icon.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
4/12/03
Remarks:
4/12/03 - Added missing code that prevents a crash due to spurious num_tooltypes values.

Definition at line 103 of file libinfo.c.

References LI_SELECTED, LI_UNSELECTED, and LIErrorString.

int LISetXPMTransparency int  colour  ) 
 

Set transparent colour for XPM output.

Parameters:
colour - the colour to make transparent.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 144 of file libinfo.c.

References LIErrorString, and LINumColours.

int LIWritePPM char *  filename,
int  image
 

Write icon image to PPM image.

Parameters:
filename - path to output image.
image - constant identifying the image to write. LI_UNSELECTED or LI_SELECTED.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 192 of file libinfo.c.

References LIHeight, LINumColours, LIPalette, and LIWidth.

int LIWriteXPM char *  filename,
int  image
 

Write icon image to XPM image.

Parameters:
filename - path to output image.
image - constant identifying the image to write. LI_UNSELECTED or LI_SELECTED.
Returns:
-1 on error, 0 otherwise.
Errors are written to LIErrorString.
Author:
Gary Harris.
Date:
17/11/03

Definition at line 170 of file libinfo.c.

References LIHeight, LINumColours, LIPalette, and LIWidth.


Variable Documentation

u8* LIBitmapSelected
 

Selected image bitmap.

Definition at line 69 of file libinfo.h.

Referenced by LICleanUp().

u8* LIBitmapUnselected
 

Unselected image bitmap.

Definition at line 68 of file libinfo.h.

Referenced by LICleanUp().

char* LIErrorString
 

Error string.

Definition at line 78 of file libinfo.h.

Referenced by LIReadDefIcon(), LIReadNewIcon(), and LISetXPMTransparency().

int LIHeight
 

Icon height.

Definition at line 74 of file libinfo.h.

Referenced by LIWritePPM(), and LIWriteXPM().

int LINumColours
 

Number of colours in icon's palette.

Definition at line 75 of file libinfo.h.

Referenced by LISetXPMTransparency(), LIWritePPM(), and LIWriteXPM().

u8* LIPalette
 

Icon palette.

Definition at line 70 of file libinfo.h.

Referenced by LICleanUp(), LIWritePPM(), and LIWriteXPM().

int LIWidth
 

Icon width.

Definition at line 73 of file libinfo.h.

Referenced by LIWritePPM(), and LIWriteXPM().


Generated on Tue Dec 23 15:34:28 2003 for LibInfo by doxygen1.3