Skip to content

Instantly share code, notes, and snippets.

@streamer45
Created October 26, 2013 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save streamer45/7166356 to your computer and use it in GitHub Desktop.
Save streamer45/7166356 to your computer and use it in GitHub Desktop.
#include "krad_compositor_common.h"
enum {
KR_SPRITE_INFO,
KR_TEXT_INFO,
KR_VECTOR_INFO,
KR_COMPOSITOR_PATH_INFO
};
typedef int (kr_info_to_ebml_func)(uint8_t *ebml, void *uber, int max);
int kr_sprite_info_to_ebml(uint8_t *out, kr_sprite_info *st, int max);
int kr_text_info_to_ebml(uint8_t *out, kr_text_info *st, int max);
int kr_vector_info_to_ebml(uint8_t *out, kr_vector_info *st, int max);
int kr_compositor_path_info_to_ebml(uint8_t *out, kr_compositor_path_info *st, int max);
int kr_sprite_info_to_ebml(uint8_t *out, kr_sprite_info *st, int max) {
if ((out == NULL) || (st == NULL) || (max < 1)) {
return -1;
}
/* FIXME */
return 0;
}
int kr_text_info_to_ebml(uint8_t *out, kr_text_info *st, int max) {
if ((out == NULL) || (st == NULL) || (max < 1)) {
return -1;
}
/* FIXME */
return 0;
}
int kr_vector_info_to_ebml(uint8_t *out, kr_vector_info *st, int max) {
if ((out == NULL) || (st == NULL) || (max < 1)) {
return -1;
}
/* FIXME */
return 0;
}
int kr_compositor_path_info_to_ebml(uint8_t *out, kr_compositor_path_info *st, int max) {
if ((out == NULL) || (st == NULL) || (max < 1)) {
return -1;
}
/* FIXME */
return 0;
}
int whatever_info_to_ebml_func(char *ebml, void *uber, int max) {
const kr_info_to_ebml_func to_ebml_func[4] = { kr_sprite_info_to_ebml, kr_text_info_to_ebml, kr_vector_info_to_ebml, kr_compositor_path_info_to_ebml};
return to_ebml_func[0](ebml, uber, max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment