cStuff/file.h

43 lines
965 B
C

/******************************************************************************
*
* Copyright (c) 2017-2019 by Löwenware Ltd
* Please, refer LICENSE file for legal information
*
******************************************************************************/
/**
* @file file.h
* @author Ilja Kartašov <ik@lowenware.com>
* @brief
*
* @see https://lowenware.com/
*/
#ifndef CSTUFF_FILE_H_3C3D5EDC_A624_4550_98A4_29AD5A41301D
#define CSTUFF_FILE_H_3C3D5EDC_A624_4550_98A4_29AD5A41301D
#include <stdbool.h>
#include <sys/types.h>
#include "retcode.h"
typedef int
(*CStuffFileGetLine)(char *line, ssize_t length, void *ctx);
bool
cstuff_file_exists(const char *file);
CStuffRetcode
cstuff_file_copy(const char *src, const char *dest);
CStuffRetcode
cstuff_file_move(const char *src, const char *dest);
CStuffRetcode
cstuff_file_get_lines(const char *src, CStuffFileGetLine get_line, void *ctx);
#endif /* !FILE_H */