Search:

Type: Posts; User: robi

Search: Search took 0.01 seconds.

  1. Thread: queue logging

    by robi
    Replies
    4
    Views
    1,130

    queue logging

    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...
  2. Replies
    2
    Views
    940

    Match sub string then copy to the end

    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...
  3. Check to check string for a series of characters

    How can I check a string contains a series of characters.

    For example,

    How to check this string

    "Monday/sunday_Thursday-tuesday"

    For "sunday"
  4. Replies
    6
    Views
    1,453

    Let me try to explain a bit further. is it...

    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
  5. Replies
    6
    Views
    1,453

    yes it is function pointer prototype - I didnt...

    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...
  6. Replies
    6
    Views
    1,453

    get string value from 2d table

    .
    void (*const state_table [5][8]) () = {

    { answer, nothing, nothing, nothing, nothing, nothing, nothing, nothing}, /* procedures for state 0 */
    { nothing, play, end, nothing,...
  7. Replies
    4
    Views
    1,166

    That solved it. Thanks

    That solved it. Thanks
  8. Replies
    4
    Views
    1,166

    yes, I am compiling on linux

    yes, I am compiling on linux
  9. Replies
    4
    Views
    1,166

    datetime string to seconds error

    "
    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
    }
  10. Replies
    2
    Views
    1,510

    bigdecimal string to integer

    How can a string such as "527.0000" be converted to integer 527
  11. Replies
    5
    Views
    1,693

    I did it wrong { nothing}, {nothing}, ...

    I did it wrong


    { nothing}, {nothing},

    Correct is like this


    { nothing, nothing},
  12. Replies
    5
    Views
    1,693

    lookup table mappings

    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...
  13. Replies
    1
    Views
    982

    access mysql data fields

    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 , ...
  14. Thread: Global struct

    by robi
    Replies
    4
    Views
    1,781

    Thanks for explaining with further info

    Thanks for explaining with further info
  15. Replies
    1
    Views
    1,465

    Pass arguments though lookup table

    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...
  16. Thread: Global struct

    by robi
    Replies
    4
    Views
    1,781

    ok thanks for that. Line 11 was the key aspect....

    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
  17. Thread: Global struct

    by robi
    Replies
    4
    Views
    1,781

    Global struct

    _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;
    ...
  18. Thread: enum error

    by robi
    Replies
    2
    Views
    2,345

    Wow. That was it. I would never have guessed that

    Wow. That was it. I would never have guessed that
  19. Thread: enum error

    by robi
    Replies
    2
    Views
    2,345

    enum error

    enum states { CALL_INIT, AUTHENTICATE, CARDLOOKUP, GETDEST, RATING, ROUTING, PLACECALL, LIVECALL, MAX_STATES } current_state;
    enum events { EVENT_1, MAX_EVENTS } new_event;


    void...
  20. Thread: for (;;)

    by robi
    Replies
    6
    Views
    1,247

    for (;;)

    What exactly does
    for (;;) mean and if its just a infinite loop whats the difference between while(1)
  21. Replies
    3
    Views
    1,056

    snprintf(logline, sizeof logline, "%s%s%s",...

    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...
  22. Replies
    3
    Views
    1,056

    Calling struct member error

    typedef struct call_info_t
    {
    char id[20];

    } *call_info;


    void cs_logging(char *logstr)
    {
    char logline[50];
Results 1 to 22 of 22