1 | #include "mupdf/fitz.h" |
2 | #include "fitz-imp.h" |
3 | |
4 | fz_outline * |
5 | fz_new_outline(fz_context *ctx) |
6 | { |
7 | fz_outline *outline = fz_malloc_struct(ctx, fz_outline); |
8 | outline->refs = 1; |
9 | return outline; |
10 | } |
11 | |
12 | fz_outline * |
13 | fz_keep_outline(fz_context *ctx, fz_outline *outline) |
14 | { |
15 | return fz_keep_imp(ctx, outline, &outline->refs); |
16 | } |
17 | |
18 | void |
19 | fz_drop_outline(fz_context *ctx, fz_outline *outline) |
20 | { |
21 | while (fz_drop_imp(ctx, outline, &outline->refs)) |
22 | { |
23 | fz_outline *next = outline->next; |
24 | fz_drop_outline(ctx, outline->down); |
25 | fz_free(ctx, outline->title); |
26 | fz_free(ctx, outline->uri); |
27 | fz_free(ctx, outline); |
28 | outline = next; |
29 | } |
30 | } |
31 | |