Defines | Functions

ink_file.h File Reference

A brief file description. More...

#include "ink_config.h"
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/statfs.h>
#include <sys/statvfs.h>
#include <sys/mount.h>
Include dependency graph for ink_file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define INK_FILEPATH_NOTABOVEROOT   0x01
#define INK_FILEPATH_SECUREROOTTEST   0x02
#define INK_FILEPATH_SECUREROOT   0x03
#define INK_FILEPATH_NOTRELATIVE   0x04
#define INK_FILEPATH_NOTABSOLUTE   0x08
#define INK_FILEPATH_NATIVE   0x10
#define INK_FILEPATH_TRUENAME   0x20

Functions

int ink_fputln (FILE *stream, const char *s)
int ink_file_fd_readline (int fd, int bufsize, char *buf)
int ink_file_fd_writestring (int fd, const char *buf)
int ink_filepath_merge (char *buf, int bufsz, const char *rootpath, const char *addpath, int flags=INK_FILEPATH_TRUENAME)
int ink_filepath_make (char *path, int pathsz, const char *rootpath, const char *addpath)
 Add addpath to the rootpath prepending slash if rootpath is not NULL and doesn't end with the slash already and put the result into path buffer.
int ink_file_fd_zerofill (int fd, off_t size)
 Resize and zero-fill the given file.
bool ink_file_is_directory (const char *path)
 Return true if the path is a directory.

Detailed Description

A brief file description.

License

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file ink_file.h.


Define Documentation

#define INK_FILEPATH_NATIVE   0x10

Definition at line 75 of file ink_file.h.

#define INK_FILEPATH_NOTABOVEROOT   0x01

Definition at line 62 of file ink_file.h.

Referenced by ink_filepath_merge().

#define INK_FILEPATH_NOTABSOLUTE   0x08

Definition at line 72 of file ink_file.h.

Referenced by ink_filepath_merge().

#define INK_FILEPATH_NOTRELATIVE   0x04

Definition at line 70 of file ink_file.h.

Referenced by ink_filepath_merge().

#define INK_FILEPATH_SECUREROOT   0x03

Definition at line 68 of file ink_file.h.

#define INK_FILEPATH_SECUREROOTTEST   0x02

Definition at line 64 of file ink_file.h.

Referenced by ink_filepath_merge().

#define INK_FILEPATH_TRUENAME   0x20

Definition at line 80 of file ink_file.h.

Referenced by layout_relative(), Layout::relative(), and Layout::relative_to().


Function Documentation

int ink_file_fd_readline ( int  fd,
int  bufsize,
char *  buf 
)
int ink_file_fd_writestring ( int  fd,
const char *  buf 
)
int ink_file_fd_zerofill ( int  fd,
off_t  size 
)

Resize and zero-fill the given file.

Returns 0 on success, errno on failure.

Definition at line 340 of file ink_file.cc.

Referenced by MultiCacheBase::mmap_data().

bool ink_file_is_directory ( const char *  path  ) 

Return true if the path is a directory.

Definition at line 363 of file ink_file.cc.

Referenced by parse_include_directive().

int ink_filepath_make ( char *  path,
int  pathsz,
const char *  rootpath,
const char *  addpath 
)

Add addpath to the rootpath prepending slash if rootpath is not NULL and doesn't end with the slash already and put the result into path buffer.

If the buffer is too small to hold the resulting string, required size is returned. On success zero is returned

Definition at line 302 of file ink_file.cc.

References ink_strlcpy().

Referenced by DiagsConfig::DiagsConfig(), HttpBodySet::init(), Span::path(), plugin_load(), and SDK_API_TSfopen().

int ink_filepath_merge ( char *  buf,
int  bufsz,
const char *  rootpath,
const char *  addpath,
int  flags = INK_FILEPATH_TRUENAME 
)
int ink_fputln ( FILE *  stream,
const char *  s 
)

Definition at line 31 of file ink_file.cc.