Menu

Tree [r1] /
 History

HTTPS access


File Date Author Commit
 license.txt 2008-04-19 rupan [r1] Initial Import
 main.c 2008-04-19 rupan [r1] Initial Import
 meizu_api.c 2008-04-19 rupan [r1] Initial Import
 meizu_api.h 2008-04-19 rupan [r1] Initial Import
 meizu_types.h 2008-04-19 rupan [r1] Initial Import
 readme.txt 2008-04-19 rupan [r1] Initial Import
 record_type.c 2008-04-19 rupan [r1] Initial Import
 record_type.h 2008-04-19 rupan [r1] Initial Import

Read Me

libmeizu is copyright (c) 2008 by Michael Mohr <akihana@gmail.com>.

libmeizu is a library developed under Linux which provides an easy-to-use interface to Meizu resource files.  It should build on any POSIX-compliant architecture; the API is documented below.

This document is almost certainly out of date.  Please review the source code (especially the headers) for up-to-date API specifications.

Known bugs:
* this library almost certainly only works on little-endian hardware.  patches are welcome.

Changelog:
* Version 0.1.0
-Initial public release

ToDo:
-???

API Documentation:

Read a resource into memory from a file.  This resource handle should be freed with free_resource().
  resource_t *read_resource(uint8_t *filename);

Write a resource file to disk given a resource handle.  Note that this call will fail (with a negative return value) if there are uninitialized records present in the handle.
  int32_t    write_resource(uint8_t *filename, resource_t *handle);

Instantiate a new resource template that can be populated with records.  The total number of resources that the destination image should be able to hold must be specified.  This resource handle should be freed with free_resource().  'type' must be exactly one of MEIZU_M6 or MEIZU_M3; this only affects image conversion at this time.
  resource_t *new_resource(profile_t type, uint32_t resource_count);

Free an allocated resource handle.
  void free_resource(resource_t *handle);

Retrieve a record from the given handle at the supplied index.
  void    *get_record(resource_t *handle, int index);

Replace the record at the given index in the supplied handle with 'record'.
  int32_t set_record(resource_t *handle, int index, void *record);

Write a record to disk.  If 'convert' is TRUE, try to convert the supplied resource into an appropriate file:
  *Given an IMG_REC, convert to XPM before writing to disk
  *Given a STR_REC, convert to a UTF-8 newline-delimited flat-form text file
  *Given a BIN_REC, write to disk without conversion
If 'convert' is false, write the resource to disk as-is (do not convert).
  int32_t write_record(uint8_t *filename, uint32_t convert, void *record);

Read a record from disk.  If 'convert' is TRUE, try to convert the supplied file into an appropriate resource:
  *Given an XPM image, convert to IMG_REC
  *Given a UTF-8 newline-delimited flat-form text file, return a STR_REC
  *Given anything else, return a BIN_REC
If 'convert' is false, assume that the data on-disk is a raw resource record.  The library will attempt to detect what type of record it is and return an appropriate record with freshly allocated memory.
  void    *read_record(uint8_t *filename, uint32_t convert, profile_t type);

Return the number of slots allocated for resources in the supplied handle.  Note that handles returned by new_resource() may contain uninitialized slots and that it is the responsibility of the calling application to ensure that these are all filled.
  uint32_t get_record_count(resource_t *handle);

Return the record type for the supplied record.
  types_t get_record_type(void *record);
MongoDB Logo MongoDB