Table of contents : DMS
DMS / I. TECHNOLOGY OVERVIEW
DMS / II. PROGRAMMING MANUAL

- 1. PDataMan
- 2. InstallNewManager()
- 3. UnInstallManager()
- 4. FoundManagerByEncoder()
- 5. FoundManagerByExtention()
- 6. DefaultRessourceManager()
- 7. DefaultManager()

DMS / I. TECHNOLOGY OVERVIEW

DMS (Data Management System) is a revolutionary technology. It allow programs to access all file formats and data types. Contrary to most operating system where each progams need to have it own data loader/saver and memory type. In this way programs are smaller, easier to make, faster and compatible. DMS manage also ressources files skeeping many extra functions and libraries.

DMS / II. PROGRAMMING MANUAL

    typedef struct TDataMan {
    	l_datatype   DataTypeManaged;
    	l_dataencode DataEncodeManaged;
    	l_text     Name;
    	l_text     Extention;
    	l_bool     UseForRessource;
    	l_bool (*SaveToFile)   ( l_text file, l_ptr  Data, l_ulong  Size );
    	l_bool (*LoadFromFile) ( l_text file, l_ptr *Data, l_ulong *Size );
    	l_bool (*Save) ( FILE *file, l_ptr  Data, l_ulong  Size, l_ulong *EndOffset );
    	l_bool (*Load) ( FILE *file, l_ptr *Data, l_ulong *Size, l_ulong *EndOffset );
    	void (*FreeData) (void*);
    	l_int   *ExtraOptions;
    	l_bool (*ExtraOptionsSet) ( PDataMan o );
    } TDataMan;

Values:
DataTypeManaged : Internal type of data accepted : (see types.h)(ex : TYPE_IMAGE)
DataEncodeManaged : Internal identifier of codec (ex: ULONG_ID('B','M','P',' '))
Name : Name of codec/manager for user display (ex : "Microsoft Windows Bitmap")
Extention : Usual extention of encoded files (ex: "BMP")
UseForRessource : Tell if encoder can save/load data to/from ressources files (most of times FALSE as system prefer use its own formats to keep compatibility)
(*SaveToFile)(,,) : Pointer to a function wich save data to file
file : Desination file
Data : Pointer to data to write
Size : Size of data (Only necessary for TYPE_UNKNOW_BINARY)
(*LoadFromFile)(,,) : Pointer to a function wich load data from a file
file : Source file
*Data : Pointer to store pointer to Data
*Size : Pointer to a l_ulong to store size of data (Only necessary for TYPE_UNKNOW_BINARY)
(*Save)(,,,) : Pointer to a function which save data to a file stream, should tell his endoffset if set
file : Desination file stream
Data : Pointer to data to write
Size : Size of data (Only necessary for TYPE_UNKNOW_BINARY)
EndOffset : Pointer to a l_ulong to store ending offset of write
(*Load)(,,,) : Pointer to a function which load data from a file stream, should tell his endoffset if set
file : Source file stream
*Data : Pointer to store pointer to Data
*Size : Pointer to a l_ulong to store size of data (Only necessary for TYPE_UNKNOW_BINARY)
EndOffset : Pointer to a l_ulong to store ending offset of read
(*FreeData)() : Pointer to a function wich free loaded data
*Extraoptions : Pointer to extra options data (l_int array) wich are set by (*ExtraOptionsSet)()
(*ExtraOptionsSet)() : Pointer to a function wich allow user to set extra options (GUI)

    PDataMan InstallNewManager ( l_datatype   DataTypeManaged,
    	                           l_dataencode DataEncodeManaged,
    	                           l_text Name,
    	                           l_text Extention,
    	                           l_bool UseForRessource,
    	                           l_bool (*SaveToFile)   ( l_text file, l_ptr  Data, l_ulong  Size ),
    	                           l_bool (*LoadFromFile) ( l_text file, l_ptr *Data, l_ulong *Size ),
    	                           l_bool (*Save) ( FILE *file, l_ptr  Data, l_ulong  Size, l_ulong *EndOffset ),
    	                           l_bool (*Load) ( FILE *file, l_ptr *Data, l_ulong *Size, l_ulong *EndOffset ),
    	                           void (*FreeData) (void*),
    	                           l_bool (*ExtraOptionsSet) ( PDataMan o ) );

NAME: InstallNewManager
TYPE: PDataMan
PARAMETERS: (see dms/bin.c, dms/txt.c ... for examples)
DataTypeManaged : Internal type of data accepted : (see types.h)(ex : TYPE_IMAGE)
DataEncodeManaged : Internal identifier of codec (ex: ULONG_ID('B','M','P',' '))
Name : Name of codec/manager for user display (ex : "Microsoft Windows Bitmap")
Extention : Usual extention of encoded files (ex: "BMP")
UseForRessource : Tell if encoder can save/load data to/from ressources files (most of times FALSE as system prefer use its own formats to keep compatibility)
(*SaveToFile)(,,) : Pointer to a function wich save data to file
(*LoadFromFile)(,,) : Pointer to a function wich load data from a file
(*Save)(,,,) : Pointer to a function which save data to a file stream, should tell his endoffset if set
(*Load)(,,,) : Pointer to a function which load data from a file stream, should tell his endoffset if set
(*FreeData)() : Pointer to a function wich free loaded data
(*ExtraOptionsSet)() : Pointer to a function wich allow user to set extra options (GUI)
DESCRIPTION: Install a new I/O data manager in DMS
RETURN: Pointer to the data manager installed.

    void UnInstallManager ( PDataMan o );

NAME: UnInstallManager
TYPE: void
PARAMETERS:
o : Data Manager to uninstall
DESCRIPTION: Uninstall a data manager installed by InstallNewManager

    PDataMan FoundManagerByEncoder ( l_datatype DataTypeAccepted, l_dataencode DataEncode );

NAME: FoundManagerByEncoder
TYPE: PDataMan
PARAMETERS:
DataTypeAccepted : Internal type of data wanted (see types.h)(ex : TYPE_IMAGE)
DataEncode : Internal identifier of codec wanted (ex: ULONG_ID('B','M','P',' '))
DESCRIPTION: Search and return a data manager handling specified data type and codec
RETURN: Pointer to the data manager wanted or NULL if not found.

    PDataMan FoundManagerByExtention ( l_datatype DataTypeAccepted, l_text Extention );

NAME: FoundManagerByExtention
TYPE: PDataMan
PARAMETERS:
DataTypeAccepted : Internal type of data wanted (see types.h)(ex : TYPE_IMAGE)
Extention : Usual extention assosciated to wanted codec ("BMP" for Microsoft Windows Bitmap)
DESCRIPTION: Search and return a data manager handling specified data type and specified extention
RETURN: Pointer to the data manager wanted or NULL if not found.

    PDataMan DefaultRessourceManager ( l_datatype DataTypeAccepted );

NAME: DefaultRessourceManager
TYPE: PDataMan
PARAMETERS:
DataTypeAccepted : Internal type of data wanted (see types.h)(ex : TYPE_IMAGE)
DESCRIPTION: Search and return the first Manager wich can save/load to/from ressource files specified data type
RETURN: Pointer to the data manager wanted or NULL if not found.

    PDataMan DefaultManager ( l_datatype DataTypeAccepted );

NAME: DefaultManager
TYPE: PDataMan
PARAMETERS:
DataTypeAccepted : Internal type of data wanted (see types.h)(ex : TYPE_IMAGE)
DESCRIPTION: Search and return the first Manager wich handle specified data type
RETURN: Pointer to the data manager wanted or NULL if not found.

(c) Copyright 2003,2004 Point Mad, Lukas Lipka. All rights reserved.