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

ref: f9cc39006acbc2a7ea5bac86e175d021de92daca CTU-FEE-B0B35APO-Semestral-project/file-browser/include/options.h -rw-r--r-- 891 bytes
f9cc3900 — František Boháček feat: add gui list commands for scrolling and clicking items 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
#include "file_access.h"
#include <stdint.h>
#include <stdlib.h>

typedef struct {
  uint16_t length;
  uint16_t mime_length;
  uint16_t program_length;
  char *mime;
  char *program;
} __attribute__((__packed__)) exec_option_t;

typedef struct {
  uint32_t bytes_size;
  uint16_t options_count;
  exec_option_t *options;
} __attribute__((__packed__)) exec_options_t;

typedef struct {
  char *options_filename;
  uint32_t bytes_size;
  exec_options_t *exec_options;
} exec_options_loader_t;

exec_options_loader_t exec_options_loader_create(char *filename);

file_operation_error_t exec_options_loader_get_size(exec_options_loader_t *loader);
file_operation_error_t exec_options_loader_load(exec_options_loader_t *loader, char *buffer);

file_operation_error_t exec_options_save(exec_options_t *options, char *filename);
char *exec_options_get_program(exec_options_t *options, char *mime);
Do not follow this link