Various modules solving daily C developer tasks
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
965 B

  1. /******************************************************************************
  2. *
  3. * Copyright (c) 2017-2019 by Löwenware Ltd
  4. * Please, refer LICENSE file for legal information
  5. *
  6. ******************************************************************************/
  7. /**
  8. * @file file.h
  9. * @author Ilja Kartašov <ik@lowenware.com>
  10. * @brief
  11. *
  12. * @see https://lowenware.com/
  13. */
  14. #ifndef CSTUFF_FILE_H_3C3D5EDC_A624_4550_98A4_29AD5A41301D
  15. #define CSTUFF_FILE_H_3C3D5EDC_A624_4550_98A4_29AD5A41301D
  16. #include <stdbool.h>
  17. #include <sys/types.h>
  18. #include "retcode.h"
  19. typedef int
  20. (*CStuffFileGetLine)(char *line, ssize_t length, void *ctx);
  21. bool
  22. cstuff_file_exists(const char *file);
  23. CStuffRetcode
  24. cstuff_file_copy(const char *src, const char *dest);
  25. CStuffRetcode
  26. cstuff_file_move(const char *src, const char *dest);
  27. CStuffRetcode
  28. cstuff_file_get_lines(const char *src, CStuffFileGetLine get_line, void *ctx);
  29. #endif /* !FILE_H */