allocated_op -> allocated_pat
This commit is contained in:
parent
6d0ba0c074
commit
5d1ffd6144
@ -29,7 +29,7 @@ static pat_t *new_range(file_t *f, const char *start, const char *end, ssize_t m
|
||||
//
|
||||
pat_t *new_pat(file_t *f, const char *start, enum pattype_e type)
|
||||
{
|
||||
allocated_op_t *tracker = new(allocated_op_t);
|
||||
allocated_pat_t *tracker = new(allocated_pat_t);
|
||||
tracker->next = f->ops;
|
||||
f->ops = tracker;
|
||||
tracker->op.type = type;
|
||||
|
@ -151,7 +151,7 @@ void destroy_file(file_t **f)
|
||||
}
|
||||
}
|
||||
|
||||
for (allocated_op_t *next; (*f)->ops; (*f)->ops = next) {
|
||||
for (allocated_pat_t *next; (*f)->ops; (*f)->ops = next) {
|
||||
next = (*f)->ops->next;
|
||||
destroy_pat(&(*f)->ops->op);
|
||||
xfree(&(*f)->ops);
|
||||
|
@ -6,14 +6,14 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
struct allocated_op_s; // declared in types.h
|
||||
struct allocated_pat_s; // declared in types.h
|
||||
|
||||
typedef struct file_s {
|
||||
struct file_s *next;
|
||||
const char *filename;
|
||||
char *contents, **lines, *end;
|
||||
size_t nlines;
|
||||
struct allocated_op_s *ops;
|
||||
struct allocated_pat_s *ops;
|
||||
unsigned int mmapped:1;
|
||||
} file_t;
|
||||
|
||||
|
6
types.h
6
types.h
@ -109,10 +109,10 @@ typedef struct def_s {
|
||||
// Structure used for tracking allocated ops, which must be freed when the file
|
||||
// is freed.
|
||||
//
|
||||
typedef struct allocated_op_s {
|
||||
struct allocated_op_s *next;
|
||||
typedef struct allocated_pat_s {
|
||||
struct allocated_pat_s *next;
|
||||
pat_t op;
|
||||
} allocated_op_t;
|
||||
} allocated_pat_t;
|
||||
|
||||
#endif
|
||||
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1
|
||||
|
Loading…
Reference in New Issue
Block a user