|
|
1.1 root 1:
2: /******************************************************************************\
3: * This is a part of the Microsoft Source Code Samples.
4: * Copyright (C) 1993 Microsoft Corporation.
5: * All rights reserved.
6: * This source code is only intended as a supplement to
7: * Microsoft Development Tools and/or WinHelp documentation.
8: * See these sources for detailed information regarding the
9: * Microsoft samples programs.
10: \******************************************************************************/
11:
12: /*
13: * SCANDIR.H
14: *
15: */
16:
17: /* Handle to the list of files scanned */
18: typedef struct dirlist FAR * DIRLIST;
19:
20: /* Handle to one item within the list of files */
21: typedef struct diritem FAR * DIRITEM;
22:
23:
24: DIRLIST dir_buildlist(LPSTR pathname, BOOL bOnDemand);
25: void dir_delete(DIRLIST list);
26: BOOL dir_isfile(DIRLIST list);
27: DIRITEM dir_firstitem(DIRLIST list);
28: DIRITEM dir_nextitem(DIRLIST list, DIRITEM previtem, BOOL fDeep);
29:
30: /* Filenames
31: *
32: * From a DIRITEM, you can query either the relative or the full name.
33: *
34: * The relative name does not include the tree root that was originally
35: * passed to dir_buildlist. The full name does include this. Note however
36: * that if you passed a relative name to dir_buildlist, the full
37: * name you get back will not be an *absolute* pathname.
38: *
39: * Thus, if you call dir_buildlist with "c:\",
40: * we will return:
41: * relative name: ".\config.sys"
42: * full name: "c:\config.sys"
43: *
44: * If you call dir_buildlist with ".\geraintd",
45: * we will return:
46: * relative name: ".\source\scandir.h"
47: * full name: ".\geraintd\source\scandir.h"
48: *
49: * In both cases, we return a pointer to a filename string: you must
50: * call dir_freefullname or dir_freerelname to free this memory when you
51: * have finished with it. Depending on the implementation, one or other
52: * (or possibly both) of these names will have been built specially
53: * when you called the query function.
54: *
55: * You can also return a pointer to the tree root name. (In the above
56: * examples this would be c:\ and .\geraintd). Depending on the implementation,
57: * this may have been forced to an absolute path.
58: *
59: */
60:
61: LPSTR dir_getfullname(DIRITEM item);
62: LPSTR dir_getrelname(DIRITEM item);
63: LPSTR dir_getroot_item(DIRITEM item);
64: LPSTR dir_getroot_list(DIRLIST dl);
65: void dir_freefullname(DIRITEM item, LPSTR fullname);
66: void dir_freerelname(DIRITEM item, LPSTR relname);
67: void dir_freeroot_item(DIRITEM item, LPSTR rootname);
68: void dir_freeroot_list(DIRLIST dl, LPSTR rootname);
69: LPSTR dir_getopenname(DIRITEM item);
70: void dir_freeopenname(DIRITEM item, LPSTR openname);
71: int dir_openfile(DIRITEM item);
72: void dir_closefile(DIRITEM item, int fh);
73: long dir_getfilesize(DIRITEM item);
74: BOOL dir_copy(DIRITEM item, LPSTR newroot);
75: BOOL dir_startcopy(DIRLIST dl);
76: int dir_endcopy(DIRLIST dl);
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.