~ruther/CTU-FEE-B0B35APO-Semestral-project

584549e4cfab9c1764e22e7b11ca94c8d36459f7 — František Boháček 3 years ago 187e21d
feat: add filoperation error get text
1 files changed, 4 insertions(+), 9 deletions(-)

M file-browser/src/file_access.c
M file-browser/src/file_access.c => file-browser/src/file_access.c +4 -9
@@ 2,15 2,6 @@
#include "logger.h"
#include <string.h>
#include <errno.h>
/*
  FILOPER_SUCCESS,
  FILOPER_PERMISSIONS,
  FILOPER_DOES_NOT_EXIST,
  FILOPER_USED,
  FILOPER_ALREADY_EXISTS,
  FILOPER_NOT_ENOUGH_SPACE,
  FILOPER_UNKNOWN,
 */

const char *file_operation_error_strings[] = {
  "Success",


@@ 22,6 13,10 @@ const char *file_operation_error_strings[] = {
  "Unknown error",
};

const char *fileaccess_get_error_text(file_operation_error_t error) {
  return file_operation_error_strings[error];
}

void fileaccess_log_error(logger_t *logger, file_operation_error_t error) {
  logger_error(logger, __FILE__, __FUNCTION__, __LINE__,
               "File operation error: %s", file_operation_error_strings[error]);

Do not follow this link