Changeset 1278

Show
Ignore:
Timestamp:
2005-04-20 23:32:07 (4 years ago)
Author:
silvia
Message:

Implemented support for CMML 2.1 and libcmml 0.9.0 .
Passes "make distcheck" and "make check".
Have not valground yet, but this commit will enable me to do it on a remote linux box.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libannodex/trunk/include/annodex/anx_general.h

    r1250 r1278  
    292292AnxMetaElement * anx_meta_element_clone (AnxMetaElement * meta); 
    293293 
     294/** 
     295 * Clone an AnxLinkElement structure 
     296 * \param link the link tag structure to clone 
     297 * \returns a new link tag structure 
     298 */ 
     299AnxLinkElement * anx_link_element_clone (AnxLinkElement * link); 
     300 
    294301#ifdef __cplusplus 
    295302} 
  • libannodex/trunk/include/annodex/anx_types.h

    r1012 r1278  
    6060typedef struct _AnxClip AnxClip; 
    6161typedef struct _AnxMetaElement AnxMetaElement; 
     62typedef struct _AnxLinkElement AnxLinkElement; 
    6263 
    6364struct _AnxMetaElement { 
     
    6970  const char *scheme;  /**< scheme name of meta element */ 
    7071}; 
     72 
     73struct _AnxLinkElement { 
     74  char *id;      /**< id attribute of link */ 
     75  char *class;   /**< class attribute of link */ 
     76  char *title;   /**< title attribute of link */ 
     77  char *lang;    /**< language code of link */ 
     78  char *dir;     /**< directionality of lang (ltr/rtl) */ 
     79  char *href;    /**< href attribute of link */ 
     80  char *type;    /**< type attribute of link */ 
     81  char *rel;     /**< rel attribute of link */ 
     82  char *rev;     /**< rev attribute of link */ 
     83  char *media;   /**< media attribute of link */ 
     84}; 
     85 
    7186 
    7287struct _AnxHead { 
     
    8297  const char *base_href;  /**< href attribute of base element */ 
    8398  AnxList * meta;   /**< list of meta elements */ 
     99  AnxList *link;    /**< list of link elements */ 
    84100}; 
    85101 
    86102struct _AnxClip { 
    87103  const char *clip_id;         /**< id attribute of clip */ 
     104  const char *class;           /**< class attribute of clip */ 
     105  const char *title;           /**< title attribute of clip */ 
    88106  const char *lang;            /**< language attribute of desc element */ 
    89107  const char *dir;             /**< directionality of lang */ 
    90108  const char *track;           /**< track attribute of clip */ 
    91109  const char *anchor_id;       /**< id attribute of anchor */ 
     110  const char *anchor_class;    /**< class attribute of clip */ 
     111  const char *anchor_title;    /**< title attribute of clip */ 
    92112  const char *anchor_lang;     /**< language of anchor */ 
    93113  const char *anchor_dir;      /**< directionality of lang */ 
    94   const char *anchor_class;    /**< stylesheet of anchor */ 
    95114  const char *anchor_href;     /**< href out of clip */ 
    96115  const char *anchor_text;     /**< anchor text */ 
    97116  const char *img_id;          /**< id attribute of image */ 
     117  const char *img_class;       /**< class attribute of image */ 
     118  const char *img_title;       /**< title attribute of image */ 
    98119  const char *img_lang;        /**< language of img */ 
    99120  const char *img_dir;         /**< directionality of lang */ 
     
    101122  const char *img_alt;         /**< alternate text for image */ 
    102123  const char *desc_id;         /**< id attribute of desc element */ 
     124  const char *desc_class;      /**< class attribute of desc */ 
     125  const char *desc_title;      /**< title attribute of desc */ 
    103126  const char *desc_lang;       /**< language attribute of desc element */ 
    104127  const char *desc_dir;        /**< directionality of lang */ 
  • libannodex/trunk/src/importers/anx_import_cmml.c

    r1093 r1278  
    9191} 
    9292 
     93static AnxLinkElement * 
     94anx_link_from_cmml_link (const CMML_LinkElement * link) 
     95{ 
     96  AnxLinkElement * new_link; 
     97 
     98  if (link == NULL) return NULL; 
     99 
     100  new_link = (AnxLinkElement* ) anx_malloc (sizeof (AnxLinkElement)); 
     101  new_link->id = anxcmml_strdup (link->id); 
     102  new_link->class = anxcmml_strdup (link->class); 
     103  new_link->title = anxcmml_strdup (link->title); 
     104  new_link->lang = anxcmml_strdup (link->lang); 
     105  new_link->dir = anxcmml_strdup (link->dir); 
     106  new_link->href = anxcmml_strdup (link->href); 
     107  new_link->type = anxcmml_strdup (link->type); 
     108  new_link->rel = anxcmml_strdup (link->rel); 
     109  new_link->rev = anxcmml_strdup (link->rev); 
     110  new_link->media = anxcmml_strdup (link->media); 
     111 
     112  return new_link; 
     113} 
     114 
    93115static AnxHead * 
    94116anx_head_from_cmml_head (const CMML_Head * head) 
     
    137159    anx_list_clone_with ((AnxList*)head->meta, 
    138160                         (AnxCloneFunc)anx_meta_from_cmml_meta); 
     161 
     162  /* list of meta elements */ 
     163  h->link = 
     164    anx_list_clone_with ((AnxList*)head->link, 
     165                         (AnxCloneFunc)anx_link_from_cmml_link); 
    139166 
    140167  return h; 
     
    161188 
    162189    presentation_time = ac->start_time; 
    163     basetime = stream->timebase ? stream->timebase->t.sec : 0.0; 
     190    basetime = stream->basetime ? stream->basetime->t.sec : 0.0; 
    164191    utc = stream->utc ? stream->utc->tstr : NULL; 
    165192 
     
    232259  /* copy clip data across */ 
    233260  a->clip_id = anxcmml_strdup (clip->clip_id); 
     261  a->class = anxcmml_strdup (clip->class); 
     262  a->title = anxcmml_strdup (clip->title); 
    234263  a->lang = anxcmml_strdup (clip->lang); 
    235264  a->dir = anxcmml_strdup (clip->dir); 
    236265  a->track = anxcmml_strdup (clip->track); 
    237266  a->anchor_id = anxcmml_strdup (clip->anchor_id); 
     267  a->anchor_class = anxcmml_strdup (clip->anchor_class); 
     268  a->anchor_title = anxcmml_strup (clip->anchor_title); 
    238269  a->anchor_lang = anxcmml_strdup (clip->anchor_lang); 
    239270  a->anchor_dir = anxcmml_strdup (clip->anchor_dir); 
    240   a->anchor_class = anxcmml_strdup (clip->anchor_class); 
    241271  a->anchor_href = anxcmml_strdup (clip->anchor_href); 
    242272  a->anchor_text = anxcmml_strdup (clip->anchor_text); 
    243273  a->img_id = anxcmml_strdup (clip->img_id); 
     274  a->img_class = anxcmml_strdup (clip->img_class); 
     275  a->img_title = anxcmml_strdup (clip->img_title); 
    244276  a->img_lang = anxcmml_strdup (clip->img_lang); 
    245277  a->img_dir = anxcmml_strdup (clip->img_dir); 
     
    247279  a->img_alt = anxcmml_strdup (clip->img_alt); 
    248280  a->desc_id = anxcmml_strdup (clip->desc_id); 
     281  a->desc_class = anxcmml_strdup (clip->desc_class); 
     282  a->desc_title = anxcmml_strdup (clip->desc_title); 
    249283  a->desc_lang = anxcmml_strdup (clip->desc_lang); 
    250284  a->desc_dir = anxcmml_strdup (clip->desc_dir); 
  • libannodex/trunk/src/libannodex/Version_script.in

    r1172 r1278  
    5151                anx_meta_element_clone; 
    5252                anx_meta_element_free; 
     53 
     54                anx_link_element_clone; 
     55                anx_link_element_free; 
    5356 
    5457                anx_set_read_stream_callback; 
  • libannodex/trunk/src/libannodex/anx_element.c

    r1197 r1278  
    8181  return NULL; 
    8282} 
     83 
     84AnxLinkElement * 
     85anx_link_element_clone (AnxLinkElement * link) 
     86{ 
     87  AnxLinkElement * new_link; 
     88 
     89  if (link == NULL) return NULL; 
     90 
     91  new_link = (AnxLinkElement* ) anx_malloc (sizeof(AnxLinkElement)); 
     92  /* maybe consider memcpy for speedup and introduce reference counting! 
     93     memcpy (new_link, link, sizeof (*new_link)); 
     94  */ 
     95  new_link->id      = anx_strdup (link->id); 
     96  new_link->class   = anx_strdup (link->class); 
     97  new_link->title   = anx_strdup (link->title); 
     98  new_link->lang    = anx_strdup (link->lang); 
     99  new_link->dir     = anx_strdup (link->dir); 
     100  new_link->href    = anx_strdup (link->href); 
     101  new_link->type    = anx_strdup (link->type); 
     102  new_link->rel     = anx_strdup (link->rel); 
     103  new_link->rev     = anx_strdup (link->rev); 
     104  new_link->media   = anx_strdup (link->media); 
     105  return new_link; 
     106} 
     107 
     108AnxLinkElement * 
     109anx_link_element_free (AnxLinkElement * link) 
     110{ 
     111  if (link == NULL) return NULL; 
     112  anx_free (link->id); 
     113  anx_free (link->class); 
     114  anx_free (link->title); 
     115  anx_free (link->lang); 
     116  anx_free (link->dir); 
     117  anx_free (link->href); 
     118  anx_free (link->type); 
     119  anx_free (link->rel); 
     120  anx_free (link->rev); 
     121  anx_free (link->media); 
     122  return NULL; 
     123} 
     124 
    83125 
    84126AnxHead *