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

ref: b62ac26978e78532bcfdb97d8f2ac397d40a76b4 CTU-FEE-B0B35APO-Semestral-project/file-browser/include/options.h -rw-r--r-- 937 bytes
b62ac269 — František Boháček fix: loading and saving options correctly 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
33
#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);

extern exec_options_t *browser_exec_options;
Do not follow this link