mirror of
https://github.com/simon987/sist2.git
synced 2025-04-10 14:06:45 +00:00
Adjust some structs
This commit is contained in:
parent
9c40dddd41
commit
8c662bb8f8
@ -248,7 +248,6 @@ void write_document_func(void *arg) {
|
||||
zstd_write_string(json_str, json_str_len + 1);
|
||||
|
||||
free(json_str);
|
||||
free(doc->filepath);
|
||||
}
|
||||
|
||||
void zstd_close() {
|
||||
|
@ -9,7 +9,7 @@
|
||||
__always_inline
|
||||
parse_job_t *create_fs_parse_job(const char *filepath, const struct stat *info, int base) {
|
||||
int len = (int) strlen(filepath);
|
||||
parse_job_t *job = malloc(sizeof(parse_job_t) + len);
|
||||
parse_job_t *job = malloc(sizeof(parse_job_t));
|
||||
|
||||
strcpy(job->filepath, filepath);
|
||||
job->base = base;
|
||||
|
@ -61,7 +61,6 @@ void parse(void *arg) {
|
||||
parse_job_t *job = arg;
|
||||
|
||||
document_t *doc = malloc(sizeof(document_t));
|
||||
doc->filepath = malloc(strlen(job->filepath) + 1);
|
||||
|
||||
set_dbg_current_file(job);
|
||||
|
||||
@ -230,10 +229,6 @@ void parse(void *arg) {
|
||||
meta_parent->key = MetaParent;
|
||||
strcpy(meta_parent->str_val, job->parent);
|
||||
APPEND_META((doc), meta_parent)
|
||||
|
||||
doc->has_parent = TRUE;
|
||||
} else {
|
||||
doc->has_parent = FALSE;
|
||||
}
|
||||
|
||||
CLOSE_FILE(job->vfile)
|
||||
|
5
third-party/libscan/libscan/scan.h
vendored
5
third-party/libscan/libscan/scan.h
vendored
@ -112,10 +112,9 @@ typedef struct document {
|
||||
int mtime;
|
||||
short base;
|
||||
short ext;
|
||||
char has_parent;
|
||||
meta_line_t *meta_head;
|
||||
meta_line_t *meta_tail;
|
||||
char *filepath;
|
||||
char filepath[PATH_MAX];
|
||||
} document_t;
|
||||
|
||||
typedef struct vfile vfile_t;
|
||||
@ -163,7 +162,7 @@ typedef struct parse_job_t {
|
||||
int ext;
|
||||
struct vfile vfile;
|
||||
char parent[SIST_DOC_ID_LEN];
|
||||
char filepath[1];
|
||||
char filepath[PATH_MAX];
|
||||
} parse_job_t;
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user