X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=blobdiff_plain;f=include%2Fbabeltrace%2Ftypes.h;h=3d2b70a4ed92d878588ff5547d7fc85537ac43b8;hp=012391df67fd086264da607bca22869697b6e976;hb=dd2544fde7500d15afb76f588009874cc577f0ac;hpb=a072041756e3fd40aa3926bc1d2774befe58f0bb diff --git a/include/babeltrace/types.h b/include/babeltrace/types.h index 012391df..3d2b70a4 100644 --- a/include/babeltrace/types.h +++ b/include/babeltrace/types.h @@ -31,59 +31,7 @@ /* Preallocate this many fields for structures */ #define DEFAULT_NR_STRUCT_FIELDS 8 -/* - * Always update stream_pos with move_pos and init_pos. - */ -struct stream_pos { - char *base; /* Base address */ - size_t offset; /* Offset from base, in bits */ - int dummy; /* Dummy position, for length calculation */ -}; - -static inline -void init_pos(struct stream_pos *pos, char *base) -{ - pos->base = base; /* initial base, page-aligned */ - pos->offset = 0; - pos->dummy = false; -} - -/* - * move_pos - move position of a relative bit offset - * - * TODO: allow larger files by updating base too. - */ -static inline -void move_pos(struct stream_pos *pos, size_t offset) -{ - pos->offset = pos->offset + offset; -} - -/* - * align_pos - align position on a bit offset (> 0) - * - * TODO: allow larger files by updating base too. - */ -static inline -void align_pos(struct stream_pos *pos, size_t offset) -{ - pos->offset += offset_align(pos->offset, offset); -} - -static inline -void copy_pos(struct stream_pos *dest, struct stream_pos *src) -{ - memcpy(dest, src, sizeof(struct stream_pos)); -} - -static inline -char *get_pos_addr(struct stream_pos *pos) -{ - /* Only makes sense to get the address after aligning on CHAR_BIT */ - assert(!(pos->offset % CHAR_BIT)); - return pos->base + (pos->offset / CHAR_BIT); -} - +struct stream_pos; struct format; struct definition; @@ -349,7 +297,7 @@ int register_declaration(GQuark declaration_name, struct declaration *declaration, struct declaration_scope *scope); struct declaration *lookup_declaration(GQuark declaration_name, - struct declaration_scope *scope); + struct declaration_scope *scope); /* * Type scopes also contain a separate registry for struct, variant and