Changeset 2171

Show
Ignore:
Timestamp:
2006-03-13 02:19:04 (3 years ago)
Author:
silvia
Message:

Adapted libannodex for CMML 2.1.
This also fixes the problem where a c++ compiler would barf on some struct members named "class".

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • libannodex/trunk/ChangeLog

    r2141 r2171  
     12006-03-13  Silvia Pfeiffer <silvia at silvia dot silvia-pfeiffer dot de> 
     2        * added the new files from Alex Krumm-Heller for windows port to Makefile.am 
     3        * fixed up libannodex for cmml 2.1 
     4        * changed previous struct member name from "class" to make it c++ compatible 
     5         
    162006-03-05  Thomas Vander Stichele  <thomas at apestaart dot org> 
    27 
  • libannodex/trunk/configure.ac

    r2141 r2171  
    216216HAVE_LIBCMML=no 
    217217 
    218 PKG_CHECK_MODULES(CMML, cmml >= 0.9.0
     218PKG_CHECK_MODULES(CMML, cmml >= 0.9.2
    219219                  HAVE_LIBCMML="yes", HAVE_LIBCMML="no") 
    220220 
     
    229229    AC_MSG_ERROR([ 
    230230*** 
    231 *** libcmml-0.9.0 or greater seems to exist on your system, however 
     231*** libcmml-0.9.2 or greater seems to exist on your system, however 
    232232*** the pkg-config tool cannot find its build information. 
    233233*** 
  • libannodex/trunk/include/annodex/anx_types.h

    r1278 r2171  
    7272 
    7373struct _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 */ 
     74  char *id;         /**< id attribute of link */ 
     75  char *link_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 */ 
    8484}; 
    8585 
     
    102102struct _AnxClip { 
    103103  const char *clip_id;         /**< id attribute of clip */ 
    104   const char *class;           /**< class attribute of clip */ 
     104  const char *clip_class;      /**< class attribute of clip */ 
    105105  const char *title;           /**< title attribute of clip */ 
    106106  const char *lang;            /**< language attribute of desc element */ 
  • libannodex/trunk/src/importers/anx_import_cmml.c

    r1427 r2171  
    100100  new_link = (AnxLinkElement* ) anx_malloc (sizeof (AnxLinkElement)); 
    101101  new_link->id = anxcmml_strdup (link->id); 
    102   new_link->class = anxcmml_strdup (link->class); 
     102  new_link->link_class = anxcmml_strdup (link->link_class); 
    103103  new_link->title = anxcmml_strdup (link->title); 
    104104  new_link->lang = anxcmml_strdup (link->lang); 
     
    259259  /* copy clip data across */ 
    260260  a->clip_id = anxcmml_strdup (clip->clip_id); 
    261   a->class = anxcmml_strdup (clip->class); 
     261  a->clip_class = anxcmml_strdup (clip->clip_class); 
    262262  a->title = anxcmml_strdup (clip->title); 
    263263  a->lang = anxcmml_strdup (clip->lang); 
  • libannodex/trunk/src/libannodex/anx_element.c

    r1278 r2171  
    9494  */ 
    9595  new_link->id      = anx_strdup (link->id); 
    96   new_link->class   = anx_strdup (link->class); 
     96  new_link->link_class   = anx_strdup (link->link_class); 
    9797  new_link->title   = anx_strdup (link->title); 
    9898  new_link->lang    = anx_strdup (link->lang); 
     
    111111  if (link == NULL) return NULL; 
    112112  anx_free (link->id); 
    113   anx_free (link->class); 
     113  anx_free (link->link_class); 
    114114  anx_free (link->title); 
    115115  anx_free (link->lang); 
     
    144144  new_head->meta = 
    145145    anx_list_clone_with (head->meta, (AnxCloneFunc)anx_meta_element_clone); 
     146  new_head->link = 
     147    anx_list_clone_with (head->link, (AnxCloneFunc)anx_link_element_clone); 
    146148 
    147149  return new_head; 
     
    165167 
    166168  anx_list_free_with (head->meta, (AnxFreeFunc)anx_meta_element_free); 
     169  anx_list_free_with (head->link, (AnxFreeFunc)anx_link_element_free); 
    167170 
    168171  anx_free (head); 
     
    176179  AnxHead * head; 
    177180  AnxMetaElement * meta; 
     181  AnxLinkElement * link; 
    178182  XTag * child; 
    179183 
     
    212216  } 
    213217 
     218  head->link = anx_list_new (); 
     219 
     220  for (child = xtag_first_child (tag, "link"); child; 
     221       child = xtag_next_child (tag, "link")) { 
     222    link = anx_malloc (sizeof (AnxLinkElement)); 
     223    link->id = anx_strdup_attribute (child, "id"); 
     224    link->link_class = anx_strdup_attribute (child, "class"); 
     225    link->title = anx_strdup_attribute (child, "title"); 
     226    link->lang = anx_strdup_attribute (child, "lang"); 
     227    link->dir = anx_strdup_attribute (child, "dir"); 
     228    link->href = anx_strdup_attribute (child, "href"); 
     229    link->type = anx_strdup_attribute (child, "type"); 
     230    link->rel = anx_strdup_attribute (child, "rel"); 
     231    link->rev = anx_strdup_attribute (child, "rev"); 
     232    link->media = anx_strdup_attribute (child, "media"); 
     233 
     234    head->link = anx_list_append (head->link, link); 
     235  } 
     236 
    214237  return head; 
    215238} 
     
    223246 
    224247  new_clip->clip_id = anx_strdup (clip->clip_id); 
     248  new_clip->clip_class = anx_strdup (clip->clip_class); 
     249  new_clip->title = anx_strdup (clip->title); 
    225250  new_clip->lang = anx_strdup (clip->lang); 
    226251  new_clip->dir = anx_strdup (clip->dir); 
     
    228253 
    229254  new_clip->anchor_id = anx_strdup (clip->anchor_id); 
     255  new_clip->anchor_class = anx_strdup (clip->anchor_class); 
     256  new_clip->anchor_title = anx_strdup (clip->anchor_title);  
    230257  new_clip->anchor_lang = anx_strdup (clip->anchor_lang); 
    231258  new_clip->anchor_dir = anx_strdup (clip->anchor_dir); 
    232   new_clip->anchor_class = anx_strdup (clip->anchor_class); 
    233259  new_clip->anchor_href = anx_strdup (clip->anchor_href); 
    234260  new_clip->anchor_text = anx_strdup (clip->anchor_text); 
    235261 
    236262  new_clip->img_id = anx_strdup (clip->img_id); 
     263  new_clip->img_class = anx_strdup (clip->img_class); 
     264  new_clip->img_title = anx_strdup (clip->img_title); 
    237265  new_clip->img_lang = anx_strdup (clip->img_lang); 
    238266  new_clip->img_dir = anx_strdup (clip->img_dir); 
     
    241269 
    242270  new_clip->desc_id = anx_strdup (clip->desc_id); 
     271  new_clip->desc_class = anx_strdup (clip->desc_class); 
     272  new_clip->desc_title = anx_strdup (clip->desc_title); 
    243273  new_clip->desc_lang = anx_strdup (clip->desc_lang); 
    244274  new_clip->desc_dir = anx_strdup (clip->desc_dir); 
     
    257287 
    258288  anx_free (clip->clip_id); 
     289  anx_free (clip->clip_class); 
     290  anx_free (clip->title); 
    259291  anx_free (clip->lang); 
    260292  anx_free (clip->dir); 
    261293  anx_free (clip->track); 
    262294  anx_free (clip->anchor_id); 
     295  anx_free (clip->anchor_class); 
     296  anx_free (clip->anchor_title); 
    263297  anx_free (clip->anchor_lang); 
    264298  anx_free (clip->anchor_dir); 
    265   anx_free (clip->anchor_class); 
    266299  anx_free (clip->anchor_href); 
    267300  anx_free (clip->anchor_text); 
    268301  anx_free (clip->img_id); 
     302  anx_free (clip->img_class); 
     303  anx_free (clip->img_title); 
    269304  anx_free (clip->img_lang); 
    270305  anx_free (clip->img_dir); 
     
    272307  anx_free (clip->img_alt); 
    273308  anx_free (clip->desc_id); 
     309  anx_free (clip->desc_class); 
     310  anx_free (clip->desc_title); 
    274311  anx_free (clip->desc_lang); 
    275312  anx_free (clip->desc_dir); 
     
    293330 
    294331  clip->clip_id = anx_strdup_attribute (tag, "id"); 
     332  clip->clip_class = anx_strdup_attribute (tag, "class"); 
     333  clip->title = anx_strdup_attribute (tag, "title"); 
    295334  clip->lang = anx_strdup_attribute (tag, "lang"); 
    296335  clip->dir = anx_strdup_attribute (tag, "dir"); 
     
    299338  child = xtag_first_child (tag, "a"); 
    300339  clip->anchor_id = anx_strdup_attribute (child, "id"); 
     340  clip->anchor_class = anx_strdup_attribute (child, "class"); 
     341  clip->anchor_title = anx_strdup_attribute (child, "title"); 
    301342  clip->anchor_lang = anx_strdup_attribute (child, "lang"); 
    302343  clip->anchor_dir = anx_strdup_attribute (child, "dir"); 
    303   clip->anchor_class = anx_strdup_attribute (child, "class"); 
    304344  clip->anchor_href = anx_strdup_attribute (child, "href"); 
    305345  clip->anchor_text = anx_strdup_pcdata (child); 
     
    307347  child = xtag_first_child (tag, "img"); 
    308348  clip->img_id = anx_strdup_attribute (child, "id"); 
     349  clip->img_class = anx_strdup_attribute (child, "class"); 
     350  clip->img_title = anx_strdup_attribute (child, "title"); 
    309351  clip->img_lang = anx_strdup_attribute (child, "lang"); 
    310352  clip->img_dir = anx_strdup_attribute (child, "dir"); 
    311353  clip->img_src = anx_strdup_attribute (child, "src"); 
    312354  clip->img_alt = anx_strdup_attribute (child, "alt"); 
     355 
     356  child = xtag_first_child (tag, "desc"); 
     357  clip->desc_id = anx_strdup_attribute (child, "id"); 
     358  clip->desc_class = anx_strdup_attribute (child, "class"); 
     359  clip->desc_title = anx_strdup_attribute (child, "title"); 
     360  clip->desc_lang = anx_strdup_attribute (child, "lang"); 
     361  clip->desc_dir = anx_strdup_attribute (child, "dir"); 
     362  clip->desc_text = anx_strdup_pcdata (child); 
    313363 
    314364  clip->meta = anx_list_new (); 
     
    326376    clip->meta = anx_list_append (clip->meta, meta); 
    327377  } 
    328  
    329   child = xtag_first_child (tag, "desc"); 
    330   clip->desc_id = anx_strdup_attribute (child, "id"); 
    331   clip->desc_lang = anx_strdup_attribute (child, "lang"); 
    332   clip->desc_dir = anx_strdup_attribute (child, "dir"); 
    333   clip->desc_text = anx_strdup_pcdata (child); 
    334378 
    335379  return clip;