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

CTU-FEE-B0B35APO-Semestral-project/file-browser/include/file_open.h -rw-r--r-- 804 bytes
7aa0ada9 — Rutherther chore: fix image in readme 2 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
33
34
35
#ifndef __FILE_OPEN_H__
#define __FILE_OPEN_H__

#include "file_access.h"
#include "options.h"
#include <stdbool.h>

typedef enum {
  OPENED_NONE,
  OPENED_MIME,
  OPENED_EXEC,
  OPENED_TEXT,
} opened_type_t;

typedef struct {
  opened_type_t type;

  bool executed;
  bool ended_with_error;

  file_operation_error_t error;

  executing_file_t executing_file;
} opened_file_state_t;

opened_file_state_t file_open(file_t *file, exec_options_t *options,
                              fileaccess_state_t state);

opened_file_state_t file_open_text(file_t *file, exec_options_t *options,
                                   fileaccess_state_t state);

opened_file_state_t file_open_mime_raw(char *file, exec_options_t *options,
                                       char *mime);

#endif // __FILE_OPEN_H__