Пример #1
0
static void do_foreach_watcher(watcher_object_t* wo,zhandle_t* zh,
        const char* path,int type,int state)
{
    char *client_path = sub_string(zh, path);
    while(wo!=0){
        wo->watcher(zh,type,state,client_path,wo->context);
        wo=wo->next;
    }    
    free_duplicate_path(client_path, path);
}
Пример #2
0
static void do_foreach_watcher(watcher_object_t* wo,zhandle_t* zh,
        const char* path,int type,int state)
{
    // session event's don't have paths
    const char *client_path =
        (type != ZOO_SESSION_EVENT ? sub_string(zh, path) : path);
    while(wo!=0){
        wo->watcher(zh,type,state,client_path,wo->context);
        wo=wo->next;
    }    
    free_duplicate_path(client_path, path);
}
Пример #3
0
static void do_foreach_watcher(watcher_object_t* wo,zhandle_t* zh,
                               const char* path,int type,int state)
{
    char *client_path = sub_string(zh, path);
    while(wo!=0) {
#ifdef HAVE_LIBRUBY
        if (getenv("RUBY_MRI_VERSION") != NULL)
            ruby_watcher_wrapper(wo->watcher,zh,type,state,client_path,wo->context);
        else
#endif
            wo->watcher(zh,type,state,client_path,wo->context);
        wo=wo->next;
    }
    free_duplicate_path(client_path, path);
}