Added option to not write to restore file and fixed a lot of restore file issues

This commit is contained in:
rexy712
2018-12-16 14:27:58 -08:00
parent 3c2e3f35a0
commit 87b7dd2503
5 changed files with 137 additions and 139 deletions

View File

@@ -29,6 +29,9 @@
#define OP_VERSION 254
#define OP_USAGE 255
#define ARG_FLAG_NONE 0
#define ARG_FLAG_NO_SAVE 1
struct cmd_arg{
const char* lopt;
const char* sopt;
@@ -48,7 +51,11 @@ struct arg_values{
//NULL means all devices
const char* device;
//What value to put in the backlight file
//starting brightness
int act_start;
//value to write in backlight file
int act_delta;
//output percentage
float delta;
//How many seconds to transition
@@ -60,6 +67,7 @@ struct arg_values{
int operation;
int num_values;
};
int flags;
};

View File

@@ -24,8 +24,8 @@
#include "common.h"
#include "cmd.h"
void save_restore_file(struct string_array* devices);
int restore_to_delta(struct arg_values* curr, RJP_value** root, int* try_restore);
void save_restore_file(struct string_array* devices, struct arg_values* args);
int restore_to_delta(struct arg_values* curr);
void prep_restore(struct arg_values* a);
RJP_value* find_matching_json_device(const char* name, RJP_value* root);
RJP_value* read_restore_file(const char* file);