mmakefile.src(%build_module): -noarosc not needed; it is default when linking a module.
[AROS.git] / workbench / libs / nonvolatile / deletenv.c
blob54bdd67e69ea49a7fb7904cd6fda3d9ded0b7fce
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef DEBUG
7 #define DEBUG 1
8 #endif
10 #include <aros/debug.h>
12 #include <dos/dosextens.h>
13 #include <proto/nvdisk.h>
15 #include <string.h>
17 #include LC_LIBDEFS_FILE
19 /*****************************************************************************
21 NAME */
23 #include <libraries/nonvolatile.h>
25 AROS_LH3(BOOL, DeleteNV,
27 /* SYNOPSIS */
29 AROS_LHA(STRPTR, appName, A0),
30 AROS_LHA(STRPTR, itemName, A1),
31 AROS_LHA(BOOL, killRequesters, D1),
33 /* LOCATION */
35 struct Library *, nvBase, 8, Nonvolatile)
37 /* FUNCTION
39 Delete a piece of data in the nonvolatile storage.
41 INPUTS
43 appName -- the application owning the data to be deleted; maximum
44 length 31
45 itemName -- name of the data to be deleted; maximum length 31
46 killRequesters -- if set to TRUE no system requesters will be displayed
47 during the deletion operation; if set to FALSE, system
48 requesters will be allowed to be displayed
50 RESULT
52 Success / failure indicator.
54 NOTES
56 The 'appName' and 'itemName' strings may NOT include the characters
57 '/' or ':'.
59 EXAMPLE
61 BUGS
63 SEE ALSO
65 INTERNALS
67 ******************************************************************************/
70 AROS_LIBFUNC_INIT
72 struct Process *me = (struct Process *)FindTask(NULL);
73 APTR oldReq = me->pr_WindowPtr;
74 BOOL result;
76 D(bug("Entering DeleteNV()\n"));
78 if(appName == NULL || itemName == NULL)
79 return FALSE;
81 if(strpbrk(appName, ":/") != NULL ||
82 strpbrk(itemName, ":/") != NULL)
83 return FALSE;
85 if(killRequesters)
86 me->pr_WindowPtr = (APTR)-1;
88 D(bug("Calling DeleteData()\n"));
90 result = DeleteNVDData(appName, itemName);
92 if(killRequesters)
93 me->pr_WindowPtr = oldReq;
95 return result;
97 AROS_LIBFUNC_EXIT
98 } /* DeleteNV */