grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / prefs / Zune / prefsio.c
blobb4d78062156d9d386de9a806a45ffe0cfbc5a4ee
1 /*
2 Copyright © 2002, The AROS Development Team.
3 All rights reserved.
5 $Id$
6 */
8 #include <string.h>
9 #include <stdlib.h>
11 #include <libraries/iffparse.h>
13 #include <proto/exec.h>
14 #include <proto/iffparse.h>
16 #include "prefsio.h"
18 /****************************************************************
20 *****************************************************************/
21 STRPTR ReadStringChunkPooled( APTR pool, struct StoredProperty *sp)
23 STRPTR buf;
25 if (!sp) return NULL;
26 if (sp->sp_Size==0) return NULL;
28 if ((buf = (STRPTR)AllocVec(sp->sp_Size+1,0)))
30 strncpy(buf, (STRPTR)sp->sp_Data,sp->sp_Size);
31 buf[sp->sp_Size]=0;
33 return buf;
36 /****************************************************************
38 *****************************************************************/
39 BOOL PushStringChunk( struct IFFHandle *iff, LONG id, STRPTR txt)
41 if(txt)
43 if(!PushChunk(iff,0,id,IFFSIZE_UNKNOWN))
45 WriteChunkBytes(iff,txt,strlen(txt));
46 PopChunk(iff);
49 return TRUE;
52 /****************************************************************
53 Save zune prefs
54 *****************************************************************/
55 void zune_prefs_save_as_iff(char *filename, struct ZunePrefs *prefs)
57 if (!prefs) return;
60 /****************************************************************
61 Load zune prefs from given filename
62 *****************************************************************/
63 struct ZunePrefs *zune_prefs_load(char *filename)
65 return NULL;
68 /****************************************************************
69 Free prefs allocated by zune_prefs_load
70 *****************************************************************/
71 void zune_prefs_free(struct ZunePrefs *prefs)
73 if (!prefs) return;