edit-util: make EditFile take reference of EditFileContext

No functional change, just preparation for later commits.
This commit is contained in:
Yu Watanabe
2023-03-11 22:19:22 +09:00
parent 321291d82b
commit 043db3400c
2 changed files with 9 additions and 4 deletions
+1
View File
@@ -95,6 +95,7 @@ int edit_files_add(
}
context->files[context->n_files] = (EditFile) {
.context = context,
.path = TAKE_PTR(new_path),
.original_path = TAKE_PTR(new_original_path),
.comment_paths = TAKE_PTR(new_comment_paths),
+8 -4
View File
@@ -3,21 +3,25 @@
#include "path-lookup.h"
typedef struct EditFile {
typedef struct EditFile EditFile;
typedef struct EditFileContext EditFileContext;
struct EditFile {
EditFileContext *context;
char *path;
char *original_path;
char **comment_paths;
char *temp;
unsigned line;
} EditFile;
};
typedef struct EditFileContext {
struct EditFileContext {
EditFile *files;
size_t n_files;
const char *marker_start;
const char *marker_end;
bool remove_parent;
} EditFileContext;
};
void edit_file_context_done(EditFileContext *context);