Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / nonvolatile / getcopynv.c
blob31d0f2dda6447035b7afc66c7e4d1f467bbdb516
1 /*
2 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <string.h>
7 #include <dos/dosextens.h>
9 /*****************************************************************************
11 NAME */
13 #include <libraries/nonvolatile.h>
14 #include <proto/exec.h>
15 #include <proto/nvdisk.h>
17 AROS_LH3(APTR, GetCopyNV,
19 /* SYNOPSIS */
21 AROS_LHA(STRPTR, appName, A0),
22 AROS_LHA(STRPTR, itemName, A1),
23 AROS_LHA(BOOL, killRequesters, D1),
25 /* LOCATION */
27 struct Library *, nvBase, 5, Nonvolatile)
29 /* FUNCTION
31 Search the nonvolatile storage for the object 'itemName' allocated by
32 'appName' and return a copy of the data.
34 INPUTS
36 appName -- name of the application that allocated the item
37 itemName -- the object to look for
38 killRequesters -- if TRUE no system requesters will be allowed to be
39 displayed during the operation of this function
41 RESULT
43 Pointer to the data assocated with 'itemName' as allocated by 'appName'.
45 NOTES
47 EXAMPLE
49 BUGS
51 SEE ALSO
53 FreeNVData(), <libraries/nonvolatile.h>
55 INTERNALS
57 ******************************************************************************/
60 AROS_LIBFUNC_INIT
62 struct Process *me = (struct Process *)FindTask(NULL);
63 APTR oldReq = me->pr_WindowPtr;
64 APTR result;
66 if(appName == NULL || itemName == NULL)
67 return NULL;
69 if(strpbrk(appName, ":/") != NULL ||
70 strpbrk(itemName, ":/") != NULL)
71 return NULL;
73 if(killRequesters)
74 me->pr_WindowPtr = (APTR)-1;
76 result = ReadData(appName, itemName);
78 if(killRequesters)
79 me->pr_WindowPtr = oldReq;
81 return result;
83 AROS_LIBFUNC_EXIT
84 } /* GetCopyNV */