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

« back to all changes in this revision

Viewing changes to src/plugin.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
 *
51
51
        
52
52
  if (p->handle == NULL) {
53
53
    error = dlerror();
54
 
    fprintf(stderr, "[!] Failed to load plugin '%s': %s\n",
55
 
            p->name, error);
 
54
    VERBOSE(fprintf(stderr, "[!] Failed to load plugin '%s': %s\n", p->name, error));
56
55
    xfree(p->name);
57
56
    xfree(p->file);
58
57
    xfree(p);
59
58
 
60
59
    return NULL;
61
60
  } else {
62
 
    if (libbiniou_verbose)
63
 
      printf("[p] Loading plugin '%s'", p->name);
 
61
    VERBOSE(printf("[p] Loading plugin '%s'", p->name));
64
62
  }
65
63
  fflush(stdout);
66
64
 
148
146
 
149
147
  dlclose(p->handle);
150
148
 
151
 
  if (libbiniou_verbose)
152
 
    printf("done.\n");
 
149
  VERBOSE(printf("done.\n"));
153
150
}
154
151
 
155
152
 
192
189
  assert(p != NULL);
193
190
  Plugin_unload(p);
194
191
  Plugin_load(p);
195
 
  if (libbiniou_verbose)
196
 
    printf("[p] Reloaded plugin '%s'\n", p->name);
 
192
  VERBOSE(printf("[p] Reloaded plugin '%s'\n", p->name));
197
193
}
198
194
 
199
195
 
203
199
  assert(p != NULL);
204
200
 
205
201
  if (p->create != NULL) {
206
 
    if (libbiniou_verbose)
207
 
      printf("[+] Initializing plugin %s\n", p->name);
 
202
    VERBOSE(printf("[+] Initializing plugin %s\n", p->name));
208
203
    p->create(context);
209
204
  }
210
205
 
211
206
  if (p->jthread != NULL) {
212
207
    pthread_create(&p->thread, NULL, p->jthread, (void *)context);
213
 
    if (libbiniou_verbose)
214
 
      printf("[p] Launched thread %s\n", p->name);
 
208
    VERBOSE(printf("[p] Launched thread %s\n", p->name));
215
209
  }
216
210
}
217
211