]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/tools/build/src/engine/filesys.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / tools / build / src / engine / filesys.h
CommitLineData
7c673cae
FG
1/*
2 * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc.
3 *
4 * This file is part of Jam - see jam.c for Copyright information.
5 */
6
7/* This file is ALSO:
8 * Copyright 2001-2004 David Abrahams.
9 * Distributed under the Boost Software License, Version 1.0.
1e59de90 10 * (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
7c673cae
FG
11 */
12
13/*
14 * filesys.h - OS specific file routines
15 */
16
17#ifndef FILESYS_DWA20011025_H
18#define FILESYS_DWA20011025_H
19
92f5a8d4 20#include "config.h"
7c673cae
FG
21#include "hash.h"
22#include "lists.h"
23#include "object.h"
24#include "pathsys.h"
25#include "timestamp.h"
26
20effc67
TL
27#include <string>
28
7c673cae
FG
29
30typedef struct file_info_t
31{
32 OBJECT * name;
33 char is_file;
34 char is_dir;
35 char exists;
36 timestamp time;
37 LIST * files;
38} file_info_t;
39
40typedef struct file_item FILEITEM;
41struct file_item
42{
92f5a8d4 43 file_info_t * value; /* expected to be equivalent with &FILEITEM */
7c673cae
FG
44 FILEITEM * next;
45};
46
47typedef struct file_list
48{
49 FILEITEM * head;
50 FILEITEM * tail;
51 int size;
52} FILELIST;
53
54typedef file_info_t * * FILELISTITER; /* also &FILEITEM equivalent */
55
56
57typedef struct file_archive_info_t
58{
11fdf7f2 59 OBJECT * name;
7c673cae
FG
60 file_info_t * file;
61 FILELIST * members;
62} file_archive_info_t;
63
64
65typedef void (*archive_scanback)( void * closure, OBJECT * path, LIST * symbols,
66 int found, timestamp const * const );
67typedef void (*scanback)( void * closure, OBJECT * path, int found,
68 timestamp const * const );
69
70
71void file_archscan( char const * arch, scanback func, void * closure );
72void file_archivescan( OBJECT * path, archive_scanback func, void * closure );
73void file_build1( PATHNAME * const f, string * file ) ;
74void file_dirscan( OBJECT * dir, scanback func, void * closure );
75file_info_t * file_info( OBJECT * const path, int * found );
76int file_is_file( OBJECT * const path );
77int file_mkdir( char const * const path );
78file_info_t * file_query( OBJECT * const path );
79void file_remove_atexit( OBJECT * const path );
80void file_supported_fmt_resolution( timestamp * const );
81int file_time( OBJECT * const path, timestamp * const );
82
20effc67
TL
83namespace b2 { namespace filesys {
84
85 inline bool is_file(const std::string &path)
86 {
87 OBJECT * path_o = object_new(path.c_str());
88 bool result = file_is_file(path_o) == 1;
89 object_free(path_o);
90 return result;
91 }
92
93}}
94
7c673cae
FG
95
96/* Archive/library file support */
97file_archive_info_t * file_archive_info( OBJECT * const path, int * found );
98file_archive_info_t * file_archive_query( OBJECT * const path );
99
100/* FILELIST linked-list */
101FILELIST * filelist_new( OBJECT * path );
102FILELIST * filelist_push_back( FILELIST * list, OBJECT * path );
103FILELIST * filelist_push_front( FILELIST * list, OBJECT * path );
104FILELIST * filelist_pop_front( FILELIST * list );
105int filelist_length( FILELIST * list );
106void filelist_free( FILELIST * list );
107
108FILELISTITER filelist_begin( FILELIST * list );
109FILELISTITER filelist_end( FILELIST * list );
110FILELISTITER filelist_next( FILELISTITER it );
111file_info_t * filelist_item( FILELISTITER it );
112file_info_t * filelist_front( FILELIST * list );
113file_info_t * filelist_back( FILELIST * list );
114
b32b8144
FG
115int filelist_empty( FILELIST * list );
116
7c673cae
FG
117#define FL0 ((FILELIST *)0)
118
119
120/* Internal utility worker functions. */
121void file_query_posix_( file_info_t * const );
122
123void file_done();
124
125#endif