# E:/DevIL/src-IL/src/il_xpm.c File Reference

`#include "il_internal.h"`
`#include <ctype.h>`

## Data Structures

struct | XPMHASHENTRY

## Defines

#define | XPM_MAX_CHAR_PER_PIXEL 2
#define | XPM_HASH_LEN 257
#define | BUFFER_SIZE 2000

## Typedefs

typedef ILubyte | XpmPixel [4]

## Functions

ILboolean | iIsValidXpm (void)
ILboolean | iLoadXpmInternal (void)
ILint | XpmGetsInternal (ILubyte *Buffer, ILint MaxLen)
ILboolean | ilIsValidXpm (ILconst_string FileName)
| Checks if the file specified in FileName is a valid XPM file.
ILboolean | ilIsValidXpmF (ILHANDLE File)
| Checks if the ILHANDLE contains a valid XPM file at the current position.
ILboolean | ilIsValidXpmL (const void *Lump, ILuint Size)
| Checks if Lump is a valid XPM lump.
ILboolean | ilLoadXpm (ILconst_string FileName)
ILboolean | ilLoadXpmF (ILHANDLE File)
| Reads an already-opened .xpm file.
ILboolean | ilLoadXpmL (const void *Lump, ILuint Size)
| Reads from a memory "lump" that contains an .xpm.
XPMHASHENTRY ** | XpmCreateHashTable ()
void | XpmDestroyHashTable (XPMHASHENTRY **Table)
void | XpmInsertEntry (XPMHASHENTRY **Table, const ILubyte *Name, int Len, XpmPixel Colour)
void | XpmGetEntry (XPMHASHENTRY **Table, const ILubyte *Name, int Len, XpmPixel Colour)
ILint | XpmGets (ILubyte *Buffer, ILint MaxLen)
ILint | XpmGetInt (ILubyte *Buffer, ILint Size, ILint *Position)
ILboolean | XpmPredefCol (char *Buff, XpmPixel *Colour)
ILboolean | XpmGetColour (ILubyte *Buffer, ILint Size, int Len, XPMHASHENTRY **Table)

## Define Documentation

#define BUFFER_SIZE 2000

Referenced by iLoadXpmInternal().

#define XPM_HASH_LEN 257

Referenced by XpmCreateHashTable(), and XpmDestroyHashTable().

#define XPM_MAX_CHAR_PER_PIXEL 2

Referenced by iLoadXpmInternal(), and XpmGetColour().

## Typedef Documentation

typedef ILubyte XpmPixel[4]

## Function Documentation

ILboolean iIsValidXpm | ( | void |  | ) |

Referenced by ilIsValidXpmF(), and ilIsValidXpmL().

ILboolean ilIsValidXpm | ( | ILconst_string | FileName | ) |

Checks if the file specified in FileName is a valid XPM file.

Referenced by ilIsValid().

ILboolean ilIsValidXpmF | ( | ILHANDLE | File | ) |

Checks if the ILHANDLE contains a valid XPM file at the current position.

Referenced by ilDetermineTypeF(), ilIsValidF(), and ilIsValidXpm().

ILboolean ilIsValidXpmL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Checks if Lump is a valid XPM lump.

Referenced by ilDetermineTypeL(), and ilIsValidL().

ILboolean ilLoadXpm | ( | ILconst_string | FileName | ) |

Referenced by ilLoad(), and ilLoadImage().

ILboolean ilLoadXpmF | ( | ILHANDLE | File | ) |

Reads an already-opened .xpm file.

Referenced by ilLoadF(), and ilLoadXpm().

ILboolean ilLoadXpmL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Reads from a memory "lump" that contains an .xpm.

Referenced by ilLoadL().

ILboolean iLoadXpmInternal | ( | void |  | ) |

Referenced by ilLoadXpmF(), and ilLoadXpmL().

XPMHASHENTRY** XpmCreateHashTable | ( |  | ) |

Referenced by iLoadXpmInternal().

void XpmDestroyHashTable | ( | XPMHASHENTRY ** | Table | ) |

Referenced by iLoadXpmInternal().

ILboolean XpmGetColour | ( | ILubyte * | Buffer,
|  | ILint | Size,
|  | int | Len,
|  | XPMHASHENTRY ** | Table |
| ) |  |  |

Referenced by iLoadXpmInternal().

void XpmGetEntry | ( | XPMHASHENTRY ** | Table,
|  | const ILubyte * | Name,
|  | int | Len,
|  | XpmPixel | Colour |
| ) |  |  |

Referenced by iLoadXpmInternal().

ILint XpmGetInt | ( | ILubyte * | Buffer,
|  | ILint | Size,
|  | ILint * | Position |
| ) |  |  |

Referenced by iLoadXpmInternal().

ILint XpmGets | ( | ILubyte * | Buffer,
|  | ILint | MaxLen |
| ) |  |  |

Referenced by iLoadXpmInternal().

ILint XpmGetsInternal | ( | ILubyte * | Buffer,
|  | ILint | MaxLen |
| ) |  |  |

Referenced by iIsValidXpm(), iLoadXpmInternal(), and XpmGets().

void XpmInsertEntry | ( | XPMHASHENTRY ** | Table,
|  | const ILubyte * | Name,
|  | int | Len,
|  | XpmPixel | Colour |
| ) |  |  |

Referenced by XpmGetColour().

ILboolean XpmPredefCol | ( | char * | Buff,
|  | XpmPixel * | Colour |
| ) |  |  |

Referenced by XpmGetColour().