New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / compiler / arossupport / isdosentrya.c
blobecfe37398448f4b84b455283c6eef86011ace3eb
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <proto/arossupport.h>
7 #include <proto/dos.h>
8 #include <proto/utility.h>
10 #include <aros/system.h>
11 #include <dos/dos.h>
13 //#define dol_OldName dol_Name
15 #include <dos/dosextens.h>
16 #include <exec/types.h>
17 #include <utility/utility.h>
19 #define BUFFER_SIZE 100
21 /*****************************************************************************
23 NAME */
25 BOOL IsDosEntryA(
27 /* SYNOPSIS */
29 char * Name,
30 ULONG Flags)
32 /* LOCATION */
34 /* FUNCTION
36 There is a need in file/directory processing where an application
37 may need to determine whether a path is just a volume/device or
38 assignment name.
40 INPUTS
42 Name - The path to test.
44 Flags - Any combination of the following:
46 LDF_ASSIGNS
47 LDF_DEVICES
48 LDF_VOLUMES
50 RESULT
52 Boolean True or False.
54 NOTES
56 Requires the programmer to open the utility.library and initialise
57 UtilityBase.
59 In future releases the buffer size will be set via a taglist.
61 EXAMPLE
63 BOOL Success;
65 ...
67 Success = IsDosEntryA("Work:", LDF_VOLUMES)
68 if (Success == TRUE)
70 ...
73 BUGS
75 SEE ALSO
77 <dos/dosextens.h>
79 INTERNALS
81 HISTORY
83 27-Jul-1997 laguest Initial inclusion into the AROS tree
85 ******************************************************************************/
87 struct DosList *DList;
88 char *DLName;
89 int Position;
90 int Success;
91 BOOL ReturnValue;
92 char Buffer[BUFFER_SIZE + 1];
94 ReturnValue = FALSE;
96 Position = SplitName(Name, ':', &Buffer[0], 0, BUFFER_SIZE + 1);
97 if (Position != -1 && Name[Position] == NULL)
99 DList = AttemptLockDosList(Flags | LDF_READ);
100 if (DList != NULL)
102 DList = NextDosEntry(DList, Flags);
103 while (DList != NULL && ReturnValue == FALSE)
105 DLName = AROS_BSTR_ADDR(DList->dol_OldName);
107 Success = Strnicmp(DLName, &Buffer[0], Position - 1);
108 if (Success == 0)
110 ReturnValue = TRUE;
113 DList = NextDosEntry(DList, Flags);
116 UnLockDosList(Flags | LDF_READ);
120 return (ReturnValue);
122 } /* IsDosEntry */