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

ref: a99d8c489e81f73ee946a882cd55056877c35a52 CTU-FEE-B0B35APO-Semestral-project/file-browser/src/temp_file_access.c -rw-r--r-- 972 bytes
a99d8c48 — František Boháček feat: add file browser main loop 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "temp_file_access.h"
#include "local_file_access.h"
#define TMP_PATH "/tmp"

fileaccess_state_t temp_fileaccess_init_state(void *data) {
  fileaccess_state_t state = {.payload.temp.path = TMP_PATH,
                              .fileaccess = &temp_file_access};
  return state;
}

bool temp_fileaccess_deinit_state(fileaccess_state_t state) {
  // do nothing
  return true;
}

const fileaccess_t temp_file_access = {
    .type = FA_LOCAL,
    .init = temp_fileaccess_init_state,
    .deinit = temp_fileaccess_deinit_state,

    .delete_file = local_fileaccess_file_delete,
    .execute_file = local_fileaccess_file_execute,
    .get_mime_type = local_fileaccess_file_get_mime_type,

    .list_directory = local_fileaccess_directory_list,
    .close_directory = local_fileaccess_directory_close,
    .create_directory = local_fileaccess_directory_create,
    .delete_directory = local_fileaccess_directory_delete,

    .list_root = local_fileaccess_root_list,

};
Do not follow this link