revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / nonvolatile / deletenv.c
blob0ed97c6c9a54418e48c35ce845004ba518f2bb1a
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 */
22 #include <libraries/nonvolatile.h>
24 AROS_LH3(BOOL, DeleteNV,
26 /* SYNOPSIS */
28 AROS_LHA(STRPTR, appName, A0),
29 AROS_LHA(STRPTR, itemName, A1),
30 AROS_LHA(BOOL, killRequesters, D1),
32 /* LOCATION */
34 struct Library *, nvBase, 8, Nonvolatile)
36 /* FUNCTION
38 Delete a piece of data in the nonvolatile storage.
40 INPUTS
42 appName -- the application owning the data to be deleted; maximum
43 length 31
44 itemName -- name of the data to be deleted; maximum length 31
45 killRequesters -- if set to TRUE no system requesters will be displayed
46 during the deletion operation; if set to FALSE, system
47 requesters will be allowed to be displayed
49 RESULT
51 Success / failure indicator.
53 NOTES
55 The 'appName' and 'itemName' strings may NOT include the characters
56 '/' or ':'.
58 EXAMPLE
60 BUGS
62 SEE ALSO
64 INTERNALS
66 ******************************************************************************/
69 AROS_LIBFUNC_INIT
71 struct Process *me = (struct Process *)FindTask(NULL);
72 APTR oldReq = me->pr_WindowPtr;
73 BOOL result;
75 D(bug("Entering DeleteNV()\n"));
77 if(appName == NULL || itemName == NULL)
78 return FALSE;
80 if(strpbrk(appName, ":/") != NULL ||
81 strpbrk(itemName, ":/") != NULL)
82 return FALSE;
84 if(killRequesters)
85 me->pr_WindowPtr = (APTR)-1;
87 D(bug("Calling DeleteData()\n"));
89 result = DeleteNVDData(appName, itemName);
91 if(killRequesters)
92 me->pr_WindowPtr = oldReq;
94 return result;
96 AROS_LIBFUNC_EXIT
97 } /* DeleteNV */