2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Creates an entry for the dos list.
8 #include <exec/memory.h>
9 #include <proto/exec.h>
13 #include "dos_intern.h"
15 /*****************************************************************************
18 #include <proto/dos.h>
20 AROS_LH2(struct DosList
*, MakeDosEntry
,
23 AROS_LHA(CONST_STRPTR
, name
, D1
),
24 AROS_LHA(LONG
, type
, D2
),
27 struct DosLibrary
*, DOSBase
, 116, Dos
)
30 Create an entry for the dos list. Depending on the type this may
31 be a device, a volume or an assign node.
34 name - pointer to name
35 type - type of list entry to create
38 The new device entry, or NULL if it couldn't be created.
47 AddDosEntry(), RemDosEntry(), FindDosEntry(), LockDosList(),
48 NextDosEntry(), FreeDosEntry()
51 This call should be replaced by a value for AllocDosObject().
53 *****************************************************************************/
57 ULONG len
= strlen(name
);
61 dl
= (struct DosList
*)AllocVec(sizeof(struct DosList
),
62 MEMF_PUBLIC
| MEMF_CLEAR
);
67 s2
= (STRPTR
)AllocVec(len
+1, MEMF_PUBLIC
| MEMF_CLEAR
);
68 dl
->dol_Name
= MKBADDR(s2
);
70 /* Binary compatibility for BCPL string.
71 * First byte is the length then comes the string.
72 * For ease of use a zero is put at the end so it can be used as a
75 s2
= (STRPTR
)AllocVec(len
+2, MEMF_PUBLIC
| MEMF_CLEAR
);
76 dl
->dol_Name
= MKBADDR(s2
);
78 *s2
++ = (UBYTE
)(len
> 255 ? 255 : len
);
88 SetIoErr(ERROR_NO_FREE_STORE
);
95 SetIoErr(ERROR_NO_FREE_STORE
);