Groonga 3.0.9 Source Code Document
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ngx_file.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) Nginx, Inc.
5  */
6 
7 
8 #ifndef _NGX_FILE_H_INCLUDED_
9 #define _NGX_FILE_H_INCLUDED_
10 
11 
12 #include <ngx_config.h>
13 #include <ngx_core.h>
14 
15 
16 struct ngx_file_s {
20 
21  off_t offset;
22  off_t sys_offset;
23 
25 
26 #if (NGX_HAVE_FILE_AIO)
27  ngx_event_aio_t *aio;
28 #endif
29 
30  unsigned valid_info:1;
31  unsigned directio:1;
32 };
33 
34 
35 #define NGX_MAX_PATH_LEVEL 3
36 
37 
38 typedef time_t (*ngx_path_manager_pt) (void *data);
39 typedef void (*ngx_path_loader_pt) (void *data);
40 
41 
42 typedef struct {
44  size_t len;
45  size_t level[3];
46 
49  void *data;
50 
51  u_char *conf_file;
53 } ngx_path_t;
54 
55 
56 typedef struct {
58  size_t level[3];
60 
61 
62 typedef struct {
64  off_t offset;
67  char *warn;
68 
70 
71  unsigned log_level:8;
72  unsigned persistent:1;
73  unsigned clean:1;
75 
76 
77 typedef struct {
80  time_t time;
82 
83  unsigned create_path:1;
84  unsigned delete_file:1;
85 
88 
89 
90 typedef struct {
91  off_t size;
92  size_t buf_size;
93 
95  time_t time;
96 
99 
100 
102 
103 typedef ngx_int_t (*ngx_tree_init_handler_pt) (void *ctx, void *prev);
105 
107  off_t size;
108  off_t fs_size;
110  time_t mtime;
111 
117 
118  void *data;
119  size_t alloc;
120 
122 };
123 
124 
127  ngx_pool_t *pool, ngx_uint_t persistent, ngx_uint_t clean,
128  ngx_uint_t access);
129 void ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len);
131 ngx_err_t ngx_create_full_path(u_char *dir, ngx_uint_t access);
136 ngx_int_t ngx_copy_file(u_char *from, u_char *to, ngx_copy_file_t *cf);
138 
140 
141 char *ngx_conf_set_path_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
143  ngx_path_t *prev, ngx_path_init_t *init);
144 char *ngx_conf_set_access_slot(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
145 
146 
149 
150 
151 #endif /* _NGX_FILE_H_INCLUDED_ */