TABLE OF CONTENTS preferences.library/AllocPrefsHandle preferences.library/FreePrefsHandle preferences.library/SetPrefs preferences.library/GetPrefs preferences.library/ReadPrefs preferences.library/WritePrefs preferences.library/FindPrefs preferences.library/SetEntry preferences.library/GetEntry preferences.library/RemEntry NAME AllocPrefsHandle SYNOPSIS PrefsHandle = AllocPrefsHandle ( Name ) D0 A0 struct PrefsHandle AllocPrefsHandle ( APTR Name ); FUNCTION Allocates a prefshandle or returns the existing one. INPUTS Name - Identify name RESULT PrefsHandle - needed to use the other functions SEE ALSO NAME FreePrefsHandle SYNOPSIS AllocPrefsHandle ( PrefsHandle ) A0 void FreePrefsHandle ( struct PrefsHandle ); FUNCTION Frees a PrefsHandle and all included prefs. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() RESULT SEE ALSO NAME SetPrefs SYNOPSIS SetPrefs ( PrefsHandle, ID, Tag, Struct, Struct_Size ) A0 D0 D1 A1 D2 void SetPrefs ( struct PrefsHandle, ULONG ID, ULONG Tag, APTR Struct, UWORD Struct_Size ); FUNCTION Sets a number of bytes as given tag (Tag) in the give chunk (ID). Old prefs will be overwritten. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs Struct - an array of bytes Struct_Size - the size in bytes of Struct RESULT SEE ALSO NAME GetPrefs SYNOPSIS bytes = GetPrefs ( PrefsHandle, ID, Tag, Struct, Struct_Size ) D0 A0 D0 D1 A1 D2 ULONG bytes GetPrefs ( struct PrefsHandle, ULONG ID, ULONG Tag, APTR Struct, UWORD Struct_Size ); FUNCTION Reads a number of bytes from the prefs. Identification via ID and Tag. The prefs will be filled into the struct array. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs Struct - an array of bytes Struct_Size - the size in bytes of Struct RESULT bytes - number of copied bytes or NULL if the prefs couldn't be found. SEE ALSO NAME ReadPrefs SYNOPSIS ReadPrefs ( PrefsHandle, Filename ) A0 A1 ReadPrefs ( struct PrefsHandle, APTR Filename ); FUNCTION Filles the prefs (PrefsHandle) from an IFF file. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() Filename - filename of an IFF-PREF file written by preferences.library RESULT SEE ALSO NAME WritePrefs SYNOPSIS WritePrefs ( PrefsHandle, Filename ) A0 A1 WritePrefs ( struct PrefsHandle, APTR Filename ); FUNCTION Writes all prefs of a PrefsHandle to an IFF file. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() Filename - filename where to write the IFF-PREF file RESULT SEE ALSO NAME FindPrefs SYNOPSIS PrefsStruct = FindPrefs ( PrefsHandle, ID, Tag ) D0 A0 D0 D1 struct PrefsStruct FindPrefs ( struct PrefsHandle, ULONG ID, ULONG Tag ); FUNCTION Finds prefs identified with Tag and ID. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs RESULT PrefsStruct - information about prefs SEE ALSO NAME SetEntry SYNOPSIS SetEntry ( PrefsHandle, ID, Tag, Struct, Struct_Size, Entry ) A0 D0 D1 A1 D2 D3 void SetEntry ( struct PrefsHandle, ULONG ID, ULONG Tag, APTR Struct, UWORD Struct_Size, ULONG Entry ); FUNCTION Creates a list named with Tag and ID. Entries will be handled like normal prefs in SetPrefs(). INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs Struct - an array of bytes Struct_Size - the size in bytes of Struct Entry - Entrynumber RESULT SEE ALSO NAME GetEntry SYNOPSIS bytes = GetEntry ( PrefsHandle, ID, Tag, Struct, Struct_Size, Entry ) D0 A0 D0 D1 A1 D2 D3 ULONG bytes GetEntry ( struct PrefsHandle, ULONG ID, ULONG Tag, APTR Struct, UWORD Struct_Size, ULONG Entry ); FUNCTION Reads a number of bytes from the prefs. Identification via ID, Tag and Entry. The prefs will be filled into the struct array. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs Struct - an array of bytes Struct_Size - the size in bytes of Struct Entry - Entrynumber you like to readout RESULT bytes - number of copied bytes or NULL if the prefs couldn't be found. SEE ALSO NAME RemEntry SYNOPSIS succ RemEntry ( PrefsHandle, ID, Tag, Entry ) D0 A0 D0 D1 D2 BOOL RemEntry ( struct PrefsHandle, ULONG ID, ULONG Tag, ULONG Entry ); FUNCTION Removes an entry from a prefs list. INPUTS PrefsHandle - returnvalue from AllocPrefsHandle() ID - IFF Chunk ID Tag - a tag to identify the prefs Entry - Entrynumber to remove RESULT succ - FALSE if this entry doesn't exist, else TRUE SEE ALSO