What's the best way to collect debug messages for logging to file in one go on exit.
I was thinking of a queue. Would this be the correct solution, could anyone suggest an easy to understand...
Type: Posts; User: robi
What's the best way to collect debug messages for logging to file in one go on exit.
I was thinking of a queue. Would this be the correct solution, could anyone suggest an easy to understand...
Example string
"carrier,froute,rate,gateway/frout/635369#[email protected]"
How to find match to "gateway" then copy to the end of the string.
The result string I would want to extract...
How can I check a string contains a series of characters.
For example,
How to check this string
"Monday/sunday_Thursday-tuesday"
For "sunday"
Let me try to explain a bit further. is it possible to put further code inside the function pointer prototype to printf out the name of the called function each time it does a lookup
yes it is function pointer prototype - I didnt know what is was called. What I really need is to log the functions that are called by the function pointer.
Now that you have shown me the proper...
.
void (*const state_table [5][8]) () = {
{ answer, nothing, nothing, nothing, nothing, nothing, nothing, nothing}, /* procedures for state 0 */
{ nothing, play, end, nothing,...
That solved it. Thanks
yes, I am compiling on linux
"
time_t epoch;
struct tm tm;
if (strptime("2011-10-23 08:46:10", "%Y-%m-%d %H:%M:%S", &tm) != NULL) {
epoch = mktime(&tm);
} else {
// Handle error
}
How can a string such as "527.0000" be converted to integer 527
I did it wrong
{ nothing}, {nothing},
Correct is like this
{ nothing, nothing},
enum states { STATE_1, STATE_2, STATE_3, STATE_4, STATE_5, STATE_6, STATE_7, STATE_8, STATE_8, MAX_STATES } current_state;
enum events { EVENT_1, EVENT_2, MAX_EVENTS } new_event;
void...
Where I would run a query like below and the results is only 1 row how would I access the the individual data fields
SELECT state, batch FROM stock WHERE serialnum = '444'
state, batch
1 , ...
Thanks for explaining with further info
enum states { STATE_1, STATE_2, STATE_3 MAX_STATES } current_state;
enum events { EVENT_1, MAX_EVENTS } new_event;
void action_s1_e1 (struct call_info_s *p);
void action_s2_e1...
ok thanks for that. Line 11 was the key aspect. In that case I am going to have to find out how to prototype enums. I start a new thread
_Is it possible to use a global struct and if so is it good practice
struct call_info_s
{
char *ddi;
char *caller_id;
esl_handle_t *global_handle;
...
Wow. That was it. I would never have guessed that
enum states { CALL_INIT, AUTHENTICATE, CARDLOOKUP, GETDEST, RATING, ROUTING, PLACECALL, LIVECALL, MAX_STATES } current_state;
enum events { EVENT_1, MAX_EVENTS } new_event;
void...
What exactly does
for (;;) mean and if its just a infinite loop whats the difference between while(1)
snprintf(logline, sizeof logline, "%s%s%s", ":id:", call_info->id, logstr);
sorry, I missed up in pasting the code it should be "%s%s%s".
I have now tried with -> operator but it is still...
typedef struct call_info_t
{
char id[20];
} *call_info;
void cs_logging(char *logstr)
{
char logline[50];