Mercurial > hg > fxanalyse
comparison data-provider.c @ 239:ec81395bf08d
Solve name collisions and other problems caused by including Windows headers
author | Daniele Nicolodi <daniele.nicolodi@obspm.fr> |
---|---|
date | Thu, 12 Feb 2015 19:13:55 +0100 |
parents | 97112b45b838 |
children |
comparison
equal
deleted
inserted
replaced
238:78fdba868884 | 239:ec81395bf08d |
---|---|
9 static char messages[DATA_PROVIDER_MSGLEN][DATA_PROVIDER_MSGNUM]; | 9 static char messages[DATA_PROVIDER_MSGLEN][DATA_PROVIDER_MSGNUM]; |
10 static unsigned int messageid = 0; | 10 static unsigned int messageid = 0; |
11 | 11 |
12 | 12 |
13 /* message callback */ | 13 /* message callback */ |
14 void CVICALLBACK MessageCB (void *msg) | 14 static void CVICALLBACK send_message_callback(void *msg) |
15 { | 15 { |
16 if (msg != NULL) | 16 if (msg != NULL) |
17 logmessage(INFO, msg); | 17 logmessage(INFO, msg); |
18 } | 18 } |
19 | 19 |
20 | 20 |
21 void SendMessage(int threadId, const char *frmt, ...) | 21 void send_message(int thread, const char *frmt, ...) |
22 { | 22 { |
23 /* message buffer */ | 23 /* message buffer */ |
24 char *message = messages[messageid++ % DATA_PROVIDER_MSGNUM]; | 24 char *message = messages[messageid++ % DATA_PROVIDER_MSGNUM]; |
25 | 25 |
26 /* format message */ | 26 /* format message */ |
28 va_start(args, frmt); | 28 va_start(args, frmt); |
29 vsnprintf(message, DATA_PROVIDER_MSGLEN - 1, frmt, args); | 29 vsnprintf(message, DATA_PROVIDER_MSGLEN - 1, frmt, args); |
30 va_end(args); | 30 va_end(args); |
31 | 31 |
32 /* signal main thread */ | 32 /* signal main thread */ |
33 PostDeferredCallToThread(MessageCB, message, threadId); | 33 PostDeferredCallToThread(send_message_callback, message, thread); |
34 } | 34 } |
35 | 35 |