summaryrefslogtreecommitdiffstats
path: root/libass/ass_cache.h
diff options
context:
space:
mode:
authorgreg <greg@blackbox>2009-06-18 17:54:08 +0200
committergreg <greg@blackbox>2009-06-20 03:38:00 +0200
commit2303b5430337da60f582613f95e605f08606759f (patch)
tree7ab52c9de634da3dfe55e1f36e87030beff2a3fe /libass/ass_cache.h
parent9c7521c0224f16880870839f7492e50b1c8602f7 (diff)
downloadlibass-2303b5430337da60f582613f95e605f08606759f.tar.bz2
libass-2303b5430337da60f582613f95e605f08606759f.tar.xz
Reindent all source code.
Reindent complete source code (*.c, *.h) with indent, the exact command line being: indent -kr -i4 -bap -nut -l76 *.c *.h From now on, new code should use (more or less) K&R style, only spaces and no tabs, 4 spaces indent width. Avoid long lines. Fix function declaration pointer spacing. Remove spaces that were added to many function declarations by indent, like some_func(foo_t * bar). Fix indenting of macros in ass.c
Diffstat (limited to 'libass/ass_cache.h')
-rw-r--r--libass/ass_cache.h123
1 files changed, 65 insertions, 58 deletions
diff --git a/libass/ass_cache.h b/libass/ass_cache.h
index 55c543e..f374b86 100644
--- a/libass/ass_cache.h
+++ b/libass/ass_cache.h
@@ -1,5 +1,3 @@
-// -*- c-basic-offset: 8; indent-tabs-mode: t -*-
-// vim:ts=8:sw=8:noet:ai:
/*
* Copyright (C) 2006 Evgeniy Stepanov <eugeni.stepanov@gmail.com>
*
@@ -27,90 +25,99 @@
#include "ass_font.h"
#include "ass_bitmap.h"
-typedef void (*hashmap_item_dtor_t)(void* key, size_t key_size, void* value, size_t value_size);
-typedef int (*hashmap_key_compare_t)(void* key1, void* key2, size_t key_size);
-typedef unsigned (*hashmap_hash_t)(void* key, size_t key_size);
+typedef void (*hashmap_item_dtor_t) (void *key, size_t key_size,
+ void *value, size_t value_size);
+typedef int (*hashmap_key_compare_t) (void *key1, void *key2,
+ size_t key_size);
+typedef unsigned (*hashmap_hash_t) (void *key, size_t key_size);
typedef struct hashmap_item_s {
- void* key;
- void* value;
- struct hashmap_item_s* next;
+ void *key;
+ void *value;
+ struct hashmap_item_s *next;
} hashmap_item_t;
-typedef hashmap_item_t* hashmap_item_p;
+typedef hashmap_item_t *hashmap_item_p;
typedef struct hashmap_s {
- int nbuckets;
- size_t key_size, value_size;
- hashmap_item_p* root;
- hashmap_item_dtor_t item_dtor; // a destructor for hashmap key/value pairs
- hashmap_key_compare_t key_compare;
- hashmap_hash_t hash;
- // stats
- int hit_count;
- int miss_count;
- int count;
+ int nbuckets;
+ size_t key_size, value_size;
+ hashmap_item_p *root;
+ hashmap_item_dtor_t item_dtor; // a destructor for hashmap key/value pairs
+ hashmap_key_compare_t key_compare;
+ hashmap_hash_t hash;
+ // stats
+ int hit_count;
+ int miss_count;
+ int count;
} hashmap_t;
-hashmap_t* hashmap_init(size_t key_size, size_t value_size, int nbuckets,
- hashmap_item_dtor_t item_dtor, hashmap_key_compare_t key_compare,
- hashmap_hash_t hash);
-void hashmap_done(hashmap_t* map);
-void* hashmap_insert(hashmap_t* map, void* key, void* value);
-void* hashmap_find(hashmap_t* map, void* key);
+hashmap_t *hashmap_init(size_t key_size, size_t value_size, int nbuckets,
+ hashmap_item_dtor_t item_dtor,
+ hashmap_key_compare_t key_compare,
+ hashmap_hash_t hash);
+void hashmap_done(hashmap_t *map);
+void *hashmap_insert(hashmap_t *map, void *key, void *value);
+void *hashmap_find(hashmap_t *map, void *key);
-hashmap_t* ass_font_cache_init(void);
-ass_font_t* ass_font_cache_find(hashmap_t*, ass_font_desc_t* desc);
-void* ass_font_cache_add(hashmap_t*, ass_font_t* font);
-void ass_font_cache_done(hashmap_t*);
+hashmap_t *ass_font_cache_init(void);
+ass_font_t *ass_font_cache_find(hashmap_t *, ass_font_desc_t *desc);
+void *ass_font_cache_add(hashmap_t *, ass_font_t *font);
+void ass_font_cache_done(hashmap_t *);
// Create definitions for bitmap_hash_key and glyph_hash_key
#define CREATE_STRUCT_DEFINITIONS
#include "ass_cache_template.c"
typedef struct bitmap_hash_val_s {
- bitmap_t* bm; // the actual bitmaps
- bitmap_t* bm_o;
- bitmap_t* bm_s;
+ bitmap_t *bm; // the actual bitmaps
+ bitmap_t *bm_o;
+ bitmap_t *bm_s;
} bitmap_hash_val_t;
-hashmap_t* ass_bitmap_cache_init(void);
-void* cache_add_bitmap(hashmap_t*, bitmap_hash_key_t* key, bitmap_hash_val_t* val);
-bitmap_hash_val_t* cache_find_bitmap(hashmap_t* bitmap_cache, bitmap_hash_key_t* key);
-hashmap_t* ass_bitmap_cache_reset(hashmap_t* bitmap_cache);
-void ass_bitmap_cache_done(hashmap_t* bitmap_cache);
+hashmap_t *ass_bitmap_cache_init(void);
+void *cache_add_bitmap(hashmap_t *, bitmap_hash_key_t *key,
+ bitmap_hash_val_t *val);
+bitmap_hash_val_t *cache_find_bitmap(hashmap_t *bitmap_cache,
+ bitmap_hash_key_t *key);
+hashmap_t *ass_bitmap_cache_reset(hashmap_t *bitmap_cache);
+void ass_bitmap_cache_done(hashmap_t *bitmap_cache);
// Cache for composited bitmaps
typedef struct composite_hash_key_s {
- int aw, ah, bw, bh;
- int ax, ay, bx, by;
- bitmap_hash_key_t a;
- bitmap_hash_key_t b;
+ int aw, ah, bw, bh;
+ int ax, ay, bx, by;
+ bitmap_hash_key_t a;
+ bitmap_hash_key_t b;
} composite_hash_key_t;
typedef struct composite_hash_val_s {
- unsigned char* a;
- unsigned char* b;
+ unsigned char *a;
+ unsigned char *b;
} composite_hash_val_t;
-hashmap_t* ass_composite_cache_init(void);
-void* cache_add_composite(hashmap_t*, composite_hash_key_t* key, composite_hash_val_t* val);
-composite_hash_val_t* cache_find_composite(hashmap_t* composite_cache, composite_hash_key_t* key);
-hashmap_t* ass_composite_cache_reset(hashmap_t* composite_cache);
-void ass_composite_cache_done(hashmap_t* composite_cache);
+hashmap_t *ass_composite_cache_init(void);
+void *cache_add_composite(hashmap_t *, composite_hash_key_t *key,
+ composite_hash_val_t *val);
+composite_hash_val_t *cache_find_composite(hashmap_t *composite_cache,
+ composite_hash_key_t *key);
+hashmap_t *ass_composite_cache_reset(hashmap_t *composite_cache);
+void ass_composite_cache_done(hashmap_t *composite_cache);
typedef struct glyph_hash_val_s {
- FT_Glyph glyph;
- FT_Glyph outline_glyph;
- FT_BBox bbox_scaled; // bbox after scaling, but before rotation
- FT_Vector advance; // 26.6, advance distance to the next bitmap in line
+ FT_Glyph glyph;
+ FT_Glyph outline_glyph;
+ FT_BBox bbox_scaled; // bbox after scaling, but before rotation
+ FT_Vector advance; // 26.6, advance distance to the next bitmap in line
} glyph_hash_val_t;
-hashmap_t* ass_glyph_cache_init(void);
-void* cache_add_glyph(hashmap_t*, glyph_hash_key_t* key, glyph_hash_val_t* val);
-glyph_hash_val_t* cache_find_glyph(hashmap_t* glyph_cache, glyph_hash_key_t* key);
-hashmap_t* ass_glyph_cache_reset(hashmap_t* glyph_cache);
-void ass_glyph_cache_done(hashmap_t* glyph_cache);
+hashmap_t *ass_glyph_cache_init(void);
+void *cache_add_glyph(hashmap_t *, glyph_hash_key_t *key,
+ glyph_hash_val_t *val);
+glyph_hash_val_t *cache_find_glyph(hashmap_t *glyph_cache,
+ glyph_hash_key_t *key);
+hashmap_t *ass_glyph_cache_reset(hashmap_t *glyph_cache);
+void ass_glyph_cache_done(hashmap_t *glyph_cache);
-#endif /* LIBASS_CACHE_H */
+#endif /* LIBASS_CACHE_H */