Tabs to spaces, more consistent formatting.
[AROS.git] / workbench / libs / nonvolatile / deletenv.c
blobdd31d9eef9505b4741baaa4a585264bf8a82788e
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /*****************************************************************************
8 NAME */
10 #ifndef DEBUG
11 #define DEBUG 1
12 #endif
14 #include <aros/debug.h>
16 #include <libraries/nonvolatile.h>
17 #include <dos/dosextens.h>
18 #include <proto/nvdisk.h>
20 #include <string.h>
23 AROS_LH3(BOOL, DeleteNV,
25 /* SYNOPSIS */
27 AROS_LHA(STRPTR, appName, A0),
28 AROS_LHA(STRPTR, itemName, A1),
29 AROS_LHA(BOOL, killRequesters, D1),
31 /* LOCATION */
33 struct Library *, nvBase, 8, Nonvolatile)
35 /* FUNCTION
37 Delete a piece of data in the nonvolatile storage.
39 INPUTS
41 appName -- the application owning the data to be deleted; maximum
42 length 31
43 itemName -- name of the data to be deleted; maximum length 31
44 killRequesters -- if set to TRUE no system requesters will be displayed
45 during the deletion operation; if set to FALSE, system
46 requesters will be allowed to be displayed
48 RESULT
50 Success / failure indicator.
52 NOTES
54 The 'appName' and 'itemName' strings may NOT include the characters
55 '/' or ':'.
57 EXAMPLE
59 BUGS
61 SEE ALSO
63 INTERNALS
65 ******************************************************************************/
68 AROS_LIBFUNC_INIT
70 struct Process *me = (struct Process *)FindTask(NULL);
71 APTR oldReq = me->pr_WindowPtr;
72 BOOL result;
74 D(bug("Entering DeleteNV()\n"));
76 if(appName == NULL || itemName == NULL)
77 return FALSE;
79 if(strpbrk(appName, ":/") != NULL ||
80 strpbrk(itemName, ":/") != NULL)
81 return FALSE;
83 if(killRequesters)
84 me->pr_WindowPtr = (APTR)-1;
86 D(bug("Calling DeleteData()\n"));
88 result = DeleteNVDData(appName, itemName);
90 if(killRequesters)
91 me->pr_WindowPtr = oldReq;
93 return result;
95 AROS_LIBFUNC_EXIT
96 } /* DeleteNV */