Re: [Vala] Allowable to add user data to callback?
- From: Luca Bruno <lethalman88 gmail com>
- To: bsquared <bwcode4u gmail com>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Allowable to add user data to callback?
- Date: Sun, 21 Aug 2011 10:02:38 +0200
On Sat, Aug 20, 2011 at 04:25:17PM -0700, bsquared wrote:
void pa_state_cb(pa_context *c, void *userdata) {
pa_context_state_t state;
int *pa_ready = userdata;
state = pa_context_get_state(c);
switch (state) {
// There are just here for reference
case PA_CONTEXT_UNCONNECTED:
case PA_CONTEXT_CONNECTING:
case PA_CONTEXT_AUTHORIZING:
case PA_CONTEXT_SETTING_NAME:
default:
break;
case PA_CONTEXT_FAILED:
case PA_CONTEXT_TERMINATED:
*pa_ready = 2;
break;
case PA_CONTEXT_READY:
*pa_ready = 1;
break;
}
}
Something like the_method (() => { pa_state_cb (ctx, pa_ready); });
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]