~ubuntu-branches/ubuntu/utopic/lebiniou/utopic-proposed

« back to all changes in this revision

Viewing changes to src/sequence_load.c

  • Committer: Package Import Robot
  • Author(s): Logan Rosen
  • Date: 2013-11-13 21:19:20 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20131113211920-af65h37psw9fz6oy
Tags: 3.19.1-1ubuntu1
* Merge from Debian unstable. Remaining changes:
  - debian/patches/fix_ftbfs_with_binutils_gold: Add -lz to fix FTBFS with
    binutils-gold.
* debian/patches/fix_ftbfs_with_binutils_gold: Remove -lavutil, as it is
  already linked.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright 1994-2012 Olivier Girondel
 
2
 *  Copyright 1994-2013 Olivier Girondel
3
3
 *
4
4
 *  This file is part of lebiniou.
5
5
 *
41
41
  xmlChar *youhou;
42
42
  const gchar *home_dir = NULL;
43
43
 
44
 
  if (file == NULL) {
45
 
    printf("[!] Attempt to load a sequence with a NULL filename\n");
46
 
    return NULL;
47
 
  }
 
44
  if (file == NULL)
 
45
    xerror("Attempt to load a sequence with a NULL filename\n");
48
46
 
49
47
  dot = strrchr(file, '.');
50
48
  if ((dot == NULL) || strcasecmp(dot, ".xml")) {
70
68
 
71
69
  doc = xmlParseFile(blah);
72
70
  g_free(blah);
73
 
  if (doc == NULL) {
74
 
    printf("[!] xmlParseFile error\n");
75
 
    return NULL;
76
 
  }
 
71
  if (doc == NULL)
 
72
    xerror("xmlParseFile error\n");
77
73
  
78
74
  sequence_node = xmlDocGetRootElement(doc);
79
75
  if (sequence_node == NULL) {
80
 
    printf("[!] Sequence %s: xmlDocGetRootElement error\n", file);
 
76
    VERBOSE(printf("[!] Sequence %s: xmlDocGetRootElement error\n", file));
81
77
    goto error;
82
78
  }
83
79
 
84
80
  sequence_node = xmlFindElement("sequence", sequence_node);
85
81
  if (sequence_node == NULL) {
86
 
    printf("[!] Sequence %s: no <sequence> found\n", file);
 
82
    VERBOSE(printf("[!] Sequence %s: no <sequence> found\n", file));
87
83
    goto error;
88
84
  }
89
85
 
99
95
 
100
96
  sequence_node = xmlFindElement("auto_colormaps", sequence_node);
101
97
  if (sequence_node == NULL) {
102
 
    printf("[!] Sequence %s: no <auto_colormaps> found\n", file);
 
98
    VERBOSE(printf("[!] Sequence %s: no <auto_colormaps> found\n", file));
103
99
    goto error;
104
100
  }
105
101
  res = xmlGetOptionalLong(doc, sequence_node, &tmp);
127
123
  sequence_node = sequence_node->next;
128
124
  sequence_node = xmlFindElement("auto_pictures", sequence_node);
129
125
  if (sequence_node == NULL) {
130
 
    printf("[!] Sequence %s: no <auto_pictures> found\n", file);
 
126
    VERBOSE(printf("[!] Sequence %s: no <auto_pictures> found\n", file));
131
127
    goto error;
132
128
  }
133
129
  res = xmlGetOptionalLong(doc, sequence_node, &tmp);
147
143
    printf("[i] Need picture: '%s'\n", picture);
148
144
#endif
149
145
    if (pictures == NULL) {
150
 
      if (libbiniou_verbose)
151
 
        printf("[!] No pictures are loaded, won't find '%s'\n", picture);
 
146
      VERBOSE(printf("[!] No pictures are loaded, won't find '%s'\n", picture));
152
147
      xfree(picture);
153
148
      goto error;
154
149
    } else {
155
150
      s->picture_id = Pictures_find(picture);
156
151
      if (s->picture_id == 0) {
157
 
        if (libbiniou_verbose)
158
 
          printf("[!] Picture '%s' not found, using default\n", picture);
 
152
        VERBOSE(printf("[!] Picture '%s' not found, using default\n", picture));
159
153
      }
160
154
      xfree(picture);
161
155
    }
171
165
  /* now, get plugins */
172
166
  plugins_node = xmlFindElement("plugins", sequence_node);
173
167
  if (plugins_node == NULL) {
174
 
    printf("[!] Sequence %s: no <plugins> found\n", file);
 
168
    VERBOSE(printf("[!] Sequence %s: no <plugins> found\n", file));
175
169
    goto error;
176
170
  }
177
171
  plugins_node = plugins_node->xmlChildrenNode;
178
172
  if (plugins_node == NULL) {
179
 
    printf("[!] Sequence %s: no elements in <plugins>\n", file);
 
173
    VERBOSE(printf("[!] Sequence %s: no elements in <plugins>\n", file));
180
174
    goto error;
181
175
  }
182
176
 
251
245
  return s;
252
246
 
253
247
 error:
254
 
  printf("[!] Failed to load sequence from file '%s'\n", file);
 
248
  VERBOSE(printf("[!] Failed to load sequence from file '%s'\n", file));
255
249
 
256
250
  /* Clean up */
257
251
  xmlFreeDoc(doc);