Back to index

im-sdk  12.3.91
Functions
SunIMPub.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int open_ns (iml_desktop_t *desktop, int ns_id, char *path, int oflag, mode_t mode, int *ns_errno)
int read_ns (iml_desktop_t *desktop, int ns_id, void *ptr, size_t size, int *ns_errno)
int write_ns (iml_desktop_t *desktop, int ns_id, void *ptr, size_t size, int *ns_errno)
int update_supported_langlist_for_le (iml_desktop_t *desktop, IMLEName *lename, IMLocale *locales, int nsl)
int switch_le_profile (iml_session_t *s, int le_profile_id, IMLEName *lename)
int close_ns (iml_desktop_t *desktop, int ns_id, int *ns_errno)
char ** opendir_ns (iml_desktop_t *desktop, int ns_id, char *dirname, int *nitems, int *pns_id, int ***d_reclen, int *ns_errno)
int closedir_ns (iml_desktop_t *desktop, int ns_id, int *ns_errno)
int mkdir_ns (iml_desktop_t *desktop, int ns_id, char *path, mode_t mode, int *ns_errno)
int rmdir_ns (iml_desktop_t *desktop, int ns_id, char *path, int *ns_errno)
int symlink_ns (iml_desktop_t *desktop, int ns_id, char *dpath, char *spath, int *ns_errno)
int stat_ns (iml_desktop_t *desktop, int ns_id, char *path, struct stat *stat_buf, int *ns_errno)
int lstat_ns (iml_desktop_t *desktop, int ns_id, char *path, struct stat *stat_buf, int *ns_errno)
int fstat_ns (iml_desktop_t *desktop, int ns_id, struct stat *stat_buf, int *ns_errno)
int creat_ns (iml_desktop_t *desktop, int ns_id, char *path, mode_t mode, int *ns_errno)
off_t lseek_ns (iml_desktop_t *desktop, int ns_id, off_t offset, int whence, int *ns_errno)
int unlink_ns (iml_desktop_t *desktop, int ns_id, char *path, int *ns_errno)
int rename_ns (iml_desktop_t *desktop, int ns_id, char *old_name, char *new_name, int *ns_errno)
int fcntl_ns (iml_desktop_t *desktop, int ns_id, int cmd, int arg, int *ns_errno)
int truncate_ns (iml_desktop_t *desktop, int ns_id, char *path, off_t length, int *ns_errno)
int ftruncate_ns (iml_desktop_t *desktop, int ns_id, off_t length, int *ns_errno)
iml_instiml_execute_iml_wrapper (iml_session_t *s, iml_inst **rrv)
iml_if_tif_OpenIF (const char *if_path, const char *if_name, const char *locale, Bool call_openif)
void if_CloseIF (iml_if_t *iml_if, Bool call_closeif)
Bool if_GetIFValues (iml_if_t *, IMArgList, int)
Bool if_SetIFValues (iml_if_t *, IMArgList, int)
iml_session_tif_CreateSC (iml_if_t *, IMArgList, int)
Bool if_DestroySC (iml_session_t *)
Bool if_DestroySC_WithoutDesktopDestruction (iml_session_t *)
Bool if_GetSCValues (iml_session_t *, IMArgList, int)
Bool if_SetSCValues (iml_session_t *, IMArgList, int)
void if_SendEvent (iml_session_t *, IMInputEvent *)
void if_SendEvent_AuxGet (iml_session_t *, IMInputEvent *)
IMTextif_ResetSC (iml_session_t *)
void if_SetSCFocus (iml_session_t *)
void if_UnsetSCFocus (iml_session_t *)
void sunim_slot_manager_init ()
iml_session_timl_construct_session (iml_desktop_t *, IMArgList, int)
iml_desktop_tnew_user (iml_if_t *If, const char *user_name, const char *host_name, const char *display_id)
void del_user (iml_desktop_t *desktop)
void add_session_to_desktop (iml_session_t *s)
iml_instiml_duplicate_inst (iml_inst *pinst)
void iml_delete_inst (iml_inst *pinst)
int IMText_duplicate2 (IMText *pdest, IMText *psrc)
IMTextIMText_duplicate (IMText *psrc)
void IMText_delete2 (IMText *ptext)
void IMText_delete (IMText *ptext)

Function Documentation

Definition at line 1736 of file SunIM.c.

int close_ns ( iml_desktop_t desktop,
int  ns_id,
int *  ns_errno 
)

Definition at line 1187 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_close *iiimp_close;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_close = iiimp_close_new(xims->get_iiimptrans()->get_data_s(),
                                  ns_id);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(), xims->get_im_id(), IIIMP_FILE_OPERATION_TYPE_CLOSE, iiimp_close);
    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_CLOSE_REPLY) {
       IIIMP_close_reply *p = (IIIMP_close_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int closedir_ns ( iml_desktop_t desktop,
int  ns_id,
int *  ns_errno 
)

Definition at line 1297 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_closedir *iiimp_closedir;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_closedir = iiimp_closedir_new(xims->get_iiimptrans()->get_data_s(),
                                        ns_id);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_CLOSEDIR,
                                       iiimp_closedir);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }
    
    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_CLOSEDIR_REPLY) {
       IIIMP_closedir_reply *p = (IIIMP_closedir_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int creat_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
mode_t  mode,
int *  ns_errno 
)

Definition at line 1762 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_creat *iiimp_creat;
    IIIMP_utf8string *iiimp_fname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_fname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                       (strlen(path) + 1),
                                   (const IIIMP_card8 *)path);
    if (!iiimp_fname) return -1;

    iiimp_creat = iiimp_creat_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id, mode, iiimp_fname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_CREAT,
                                       iiimp_creat);
    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_CREAT_REPLY) {
       IIIMP_creat_reply *p = (IIIMP_creat_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void del_user ( iml_desktop_t desktop)

Definition at line 631 of file SunIM.c.

{
    iml_if_t *If = desktop->If;
    iml_desktop_list p, *prev;
    for (prev = &If->desktop_list; (p = *prev) != 0; prev = &p->next) {
        if (strcmp(p->user_name, desktop->user_name) == 0 &&
           strcmp(p->host_name, desktop->host_name) == 0 &&
           strcmp(p->display_id, desktop->display_id) == 0) {
#ifdef DEBUG
            printf("LE %s: %s@%s is deleted\n", If->if_name, p->user_name, p->host_name);
#endif
            *prev = p->next;
            free(p->user_name);
            free(p->host_name);
            free(p->display_id);
            free(p);
            If->desktop_count--;
            break;
        }
        if (p->next == NULL) {
            break;
        }
    }
}
int fcntl_ns ( iml_desktop_t desktop,
int  ns_id,
int  cmd,
int  arg,
int *  ns_errno 
)

Definition at line 1974 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_fcntl *iiimp_fcntl;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_fcntl = iiimp_fcntl_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id, cmd, arg);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_FCNTL,
                                       iiimp_fcntl);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_FCNTL_REPLY) {
       IIIMP_fcntl_reply *p = (IIIMP_fcntl_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->return_value;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int fstat_ns ( iml_desktop_t desktop,
int  ns_id,
struct stat *  stat_buf,
int *  ns_errno 
)

Definition at line 1652 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_fstat *iiimp_fstat;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_fstat = iiimp_fstat_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_FSTAT,
                                       iiimp_fstat);
    if(!xims->send(send_message, true)) return -1;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_FSTAT_REPLY) {
       IIIMP_fstat_reply *p = (IIIMP_fstat_reply *)receive_message->v.file_operation_reply.value;
       if (p->ns_id < 0) {
           return p->ns_id;
       }

       (*buf).st_mode = p->stat_buf->s_mode;
       (*buf).st_nlink = p->stat_buf->s_nlink;
       (*buf).st_uid = p->stat_buf->s_uid;
       (*buf).st_gid = p->stat_buf->s_gid;
       (*buf).st_atime = p->stat_buf->s_atime;
       (*buf).st_mtime = p->stat_buf->s_mtime;
       (*buf).st_ctime = p->stat_buf->s_ctime;
       (*buf).st_blksize = p->stat_buf->s_blksize;
       (*buf).st_dev = p->stat_buf->s_dev;
       (*buf).st_rdev = p->stat_buf->s_rdev;
       (*buf).st_ino = p->stat_buf->s_ino;
       (*buf).st_size = p->stat_buf->s_size;
       (*buf).st_blocks = p->stat_buf->s_blocks;

       *ns_errno =  p->ns_errno;
       return p->ns_id;
    }

    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ftruncate_ns ( iml_desktop_t desktop,
int  ns_id,
off_t  length,
int *  ns_errno 
)

Definition at line 1716 of file IIIMP_IMState.cpp.

{               
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_ftruncate *iiimp_ftruncate;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;
    
    if (xims == NULL)
       return -1;
    iiimp_ftruncate = iiimp_ftruncate_new(xims->get_iiimptrans()->get_data_s(),    
                                     ns_id, length);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_FTRUNCATE,
                                       iiimp_ftruncate);

    if(!xims->send(send_message, true)) return -1;
    
    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
            if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
                LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
                break;
            } else {
                xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
            }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_FTRUNCATE_REPLY) {
       IIIMP_ftruncate_reply *p = (IIIMP_ftruncate_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void if_CloseIF ( iml_if_t iml_if,
Bool  call_closeif 
)

Definition at line 238 of file SunIM.c.

{
    if(call_openif == True) {
        If->ifm->if_CloseIF(If);
    }

    if (If->m_wrapper) {
        free (If->m_wrapper);
    }
    if (If->m) {
        free(If->m);
    }
    if (If->locale) {
        free(If->locale);
    }
    if (If->if_name) {
        free(If->if_name);
    }
    if (If->ifpath_name) {
        free(If->ifpath_name);
    }

    close_le_module(If->dl_module);

    free(If);
}
iml_session_t* if_CreateSC ( iml_if_t ,
IMArgList  ,
int   
)

Definition at line 304 of file SunIM.c.

{
    iml_session_t *s = NULL;
    Bool ret;
    IMArg *p = args;
    int i;
    
    iml_desktop_t *desktop = (iml_desktop_t *) 0;
    
    char *user_name = (char *) 0;
    char *host_name = (char *) 0;
    char *display_id = (char *) 0;
    
    for (i = 0; i < n_args; i++, p++) {
        if (p->id == UI_USER_NAME) {
            user_name = p->value;
        } else if (p->id == UI_HOST_NAME) {
            host_name = p->value;
        } else if (p->id == UI_DISPLAY_ID) {
            display_id = p->value;
        }
    }
    
    if (!user_name || !host_name || !display_id) {
        return NULL;
    }
    SUNIM_LOCK(desktop_mutex);
    desktop = find_user(If, user_name, host_name, display_id);
    if (!desktop) {
        desktop = new_user(If, user_name, host_name, display_id);
        ret = If->ifm->if_OpenDesktop(desktop, args, n_args);
        if (ret == False) {
            del_user(desktop);
           SUNIM_UNLOCK(desktop_mutex);
            return NULL;
        }
        /* Initialize the listener_id and listener_count */
        desktop->listener_id = 0;
        desktop->listener_count = 0;
    }
    /*
     * All LE specific remote file loading and hotkey registration 
     * has to be completed before unlocking desktop, if each connection
     * is assigned to one thread. If each user is assigned to one thread
     * locking is not needed.
     */
    SUNIM_UNLOCK(desktop_mutex);
    s = iml_construct_session(desktop, args, n_args);
    
    if (s) {
        add_session_to_desktop(s);
    }
    return s;
}

Definition at line 422 of file SunIM.c.

{
    if (s) {
        Bool ret;
        iml_desktop_t *desktop = s->desktop;
       iml_if_t *iml_if = s->If;

        ret = if_DestroySC_WithoutDesktopDestruction(s);
        if (!desktop->session_list) {
            iml_if->ifm->if_CloseDesktop(desktop);
            del_user(desktop);
        }
        return ret;
    }
    return False;
}

Definition at line 364 of file SunIM.c.

{
    if (s) {
       int i;
        Bool ret;
       IMFeedbackList *flist;
        
        ret = s->If->ifm->if_DestroySC(s);
        
        s->If->m->iml_delete(s);
        s->If->m->iml_delete2(s);
        
        remove_session_from_desktop(s);
        
        if (s->status_cache.text && s->status_cache.text->text.utf_chars) {
            free((char *) s->status_cache.text->text.utf_chars);
       }
        if (s->status_cache.text && s->status_cache.text->feedback) {
           for(i=0;i<DEFAULTStatusCacheSize;i++){
              flist=&s->status_cache.text->feedback[i];
              if(flist){
                  free(flist->feedbacks);
              }
           }
           free(s->status_cache.text->feedback);
       }

        if (s->status_cache.text) {
            free((char *) s->status_cache.text);
       }

        if (s->PreEditTextInfo.text && s->PreEditTextInfo.text->text.utf_chars) {
            free((char *) s->PreEditTextInfo.text->text.utf_chars);
       }
        if (s->PreEditTextInfo.text && s->PreEditTextInfo.text->feedback) {
           for(i=0;i<s->PreEditTextBufferSize;i++){
              flist=&s->PreEditTextInfo.text->feedback[i];
              if(flist){
                  free(flist->feedbacks);
              }
           }
           free(s->PreEditTextInfo.text->feedback);
        }

        if (s->PreEditTextInfo.text) {
            free((char *) s->PreEditTextInfo.text);
       }
        
        free(s);
        
        return ret;
    }
    return False;
}
Bool if_GetIFValues ( iml_if_t ,
IMArgList  ,
int   
)

Definition at line 269 of file SunIM.c.

{
    if (If) {
        return If->ifm->if_GetIFValues(If, args, n_args);
    }
    return False;
}
Bool if_GetSCValues ( iml_session_t ,
IMArgList  ,
int   
)

Definition at line 457 of file SunIM.c.

{
    if (s) {
       Bool ret=s->If->ifm->if_GetSCValues(s, args, n_args);
        s->If->m->iml_delete(s);
        return ret;
    }
    return False;
}
iml_if_t* if_OpenIF ( const char *  if_path,
const char *  if_name,
const char *  locale,
Bool  call_openif 
)

Definition at line 201 of file SunIM.c.

{
    iml_if_t *If;
    If = (iml_if_t *) calloc(1, sizeof(iml_if_t));
    If->hkm = (IMHotkeyManagerStruct *) 0;
    if (NULL != getenv("IIIMD_NSFIO_OLD")) {
       If->nsc_get_function = nsc_GetFunction;
    } else {
       extern void * fop_get_function(const char *);
       If->nsc_get_function = fop_get_function;
    }
    If->hkc_get_function = hkc_GetFunction;
    If->updateSupportedLocales = updateSupportedLocales;
    If->switchLEProfile = switchLEProfile;

    if (if_configure(If, if_path, if_name, if_locale, call_openif) == False) {
        if (If->locale) {
            free(If->locale);
        }
        if (If->if_name) {
            free(If->if_name);
        }
        if (If->ifpath_name) {
            free(If->ifpath_name);
        }
        free(If);
        If = NULL;
    }
    return If;
}

Definition at line 472 of file SunIM.c.

{
    IMText *prs = NULL;
    if (s) {
        s->If->m->iml_delete(s);
        prs = s->If->ifm->if_ResetSC(s);
       if(!prs){
           s->If->m->iml_delete(s);
       }
    }
    return prs;
}
void if_SendEvent ( iml_session_t ,
IMInputEvent  
)

Definition at line 525 of file SunIM.c.

{
    if (s) {
        s->If->ifm->if_SendEvent(s, e);
        s->If->m->iml_delete(s);
    }
    return;
}

Definition at line 538 of file SunIM.c.

{
    if (s) {
        s->If->ifm->if_SendEvent(s, e);
        /* DON'T CALL s->If->m->iml_delete(s) HERE! */
    }
    return;
}
Bool if_SetIFValues ( iml_if_t ,
IMArgList  ,
int   
)

Definition at line 282 of file SunIM.c.

{
    if (If) {
        return If->ifm->if_SetIFValues(If, args, n_args);
    }
    return False;
}

Definition at line 488 of file SunIM.c.

{
    iml_inst *rv = NULL;
    iml_inst *lp;
    if (s) {
        if (s->status_cache.text->char_length) {
            lp = s->If->m->iml_make_status_start_inst(s);
            s->If->m->iml_link_inst_tail(&rv, lp);
            lp = s->If->m->iml_make_status_draw_inst(s, s->status_cache.text);
            s->If->m->iml_link_inst_tail(&rv, lp);
            lp = s->If->m->iml_execute(s, &rv);
        }
        s->If->ifm->if_SetSCFocus(s);
        s->If->m->iml_delete(s);
    }
    return;
}
Bool if_SetSCValues ( iml_session_t ,
IMArgList  ,
int   
)

Definition at line 442 of file SunIM.c.

{
    if (s) {
        Bool ret = s->If->ifm->if_SetSCValues(s, args, n_args);
        s->If->m->iml_delete(s);
        return ret;
    }
    return False;
}

Definition at line 509 of file SunIM.c.

{
    iml_inst *lp;

    if (s) {
        lp = s->If->m->iml_make_status_done_inst(s);
        s->If->m->iml_execute(s, &lp);
        s->If->ifm->if_UnsetSCFocus(s);
        s->If->m->iml_delete(s);
    }
    return;
}

Definition at line 555 of file SunIM.c.

{
    iml_if_t *If = desktop->If;
    iml_session_t *s;
    int i;
    Bool ret;
    
    s = (iml_session_t *) calloc(1, sizeof(iml_session_t));
    s->desktop = desktop;
    s->If = If;
    s->next = NULL;

#ifdef ENABLE_EIMIL
    if (If->eh != EIMIL_VOID_HANDLE)
       EIMIL_duplicate_handle(&s->eh, If->eh);
#endif

    if ((ret=If->ifm->if_CreateSC(s, args, num_args)) == False){
        free(s);
        return NULL;
    }

    s->status_cache.text = (IMText *) calloc(1, sizeof(IMText));
    s->status_cache.text->encoding = UTF16_CODESET;
    s->status_cache.text->feedback = (IMFeedbackList *) calloc(1, sizeof(IMFeedbackList) * DEFAULTStatusCacheSize);
    s->status_cache.text->text.utf_chars = (UTFCHAR *) calloc(1, sizeof(UTFCHAR) * DEFAULTStatusCacheSize);
    s->status_cache.text->char_length = 0;
    s->status_cache.text->count_annotations = 0;
    s->status_cache.text->annotations = NULL;
    for (i = 0; i < DEFAULTStatusCacheSize; i++) {
        IMFeedbackList *fbl = &s->status_cache.text->feedback[i];
        fbl->feedbacks = (IMFeedback *) calloc(1, sizeof(IMFeedback)*DEFAULTFeedbackSize);
    }

    s->PreEditTextInfo.text = (IMText *) calloc(1, sizeof(IMText));
    s->PreEditTextInfo.text->encoding = UTF16_CODESET;
    s->PreEditTextInfo.text->text.utf_chars = (UTFCHAR *) calloc(1, sizeof(UTFCHAR) * DEFAULTPreEditTextBufferSize);
    s->PreEditTextInfo.text->feedback = (IMFeedbackList *) calloc(1, sizeof(IMFeedbackList) * DEFAULTPreEditAttrBufferSize);
    for (i = 0; i < DEFAULTPreEditTextBufferSize; i++) {
        IMFeedbackList *fbl = &s->PreEditTextInfo.text->feedback[i];
        fbl->feedbacks = (IMFeedback *) calloc(1, sizeof(IMFeedback)*DEFAULTFeedbackSize);
    }

    s->PreEditTextBufferSize = DEFAULTPreEditTextBufferSize;
    s->PreEditAttrBufferSize = DEFAULTPreEditAttrBufferSize;

    return (iml_session_t *) s;
}
void iml_delete_inst ( iml_inst pinst)

Definition at line 409 of file IMLSubr.c.

{
    int op = pinst->opcode & ~IMM_CB_RESULT_REQUIRED;

    switch (op) {
      case IMM_COMMIT:
      case IMM_RESET_RETURN:
       imli_delete_operand_imtext(pinst);
       return;
      case IMM_PREEDIT_DRAW:
       imli_delete_preedit_draw(pinst);
       return;
      case IMM_STATUS_DRAW:
       imli_delete_status_draw(pinst);
       return;
      case IMM_LOOKUP_DRAW:
       imli_delete_lookup_draw(pinst);
       return;
      case IMM_AUX_START_2:
      case IMM_AUX_DONE_2:
       imli_delete_aux_basic(pinst);
       return;
      case IMM_AUX_DRAW_2:
       imli_delete_aux_draw(pinst);
       return;
      case IMM_KEYPRESS:
      case IMM_LOOKUP_PROCESS:
      case IMM_LOOKUP_START:
      case IMM_SET_STATUS:
      default:
       imli_delete_short(pinst);
       return;
    }

    /* notreached */
    return;
}

Definition at line 274 of file IMLSubr.c.

{
    int op = pinst->opcode & ~IMM_CB_RESULT_REQUIRED;

    switch (op) {
      case IMM_KEYPRESS:
       return imli_duplicate_keypress(pinst);
      case IMM_COMMIT:
      case IMM_RESET_RETURN:
       return imli_duplicate_operand_imtext(pinst);
      case IMM_SET_STATUS:
       return imli_duplicate_set_status(pinst);
      case IMM_PREEDIT_DRAW:
       return imli_duplicate_preedit_draw(pinst);
      case IMM_STATUS_DRAW:
       return imli_duplicate_status_draw(pinst);
      case IMM_LOOKUP_START:
       return imli_duplicate_lookup_start(pinst);
      case IMM_LOOKUP_DRAW:
       return imli_duplicate_lookup_draw(pinst);
      case IMM_LOOKUP_PROCESS:
       return imli_duplicate_lookup_process(pinst);
      case IMM_AUX_START_2:
      case IMM_AUX_DONE_2:
       return  imli_duplicate_aux_basic(pinst);
      case IMM_AUX_DRAW_2:
       return imli_duplicate_aux_draw(pinst);
      case IMM_NS_LISTENER:
       return imli_duplicate_ns_listener(pinst);
      default:
       return imli_duplicate_short(pinst);
    }

    /* notreached */
    return NULL;
}

Definition at line 662 of file LE.cpp.

{
    IMLExec *pimlex = (IMLExec*) s->SessionContext;

#ifdef DEBUG
    {
       int op;
       iml_inst *pcur;

       for (pcur = *rrv; pcur != (iml_inst*)0; pcur = pcur->next) {
           op = pcur->opcode & ~IMM_CB_RESULT_REQUIRED;
           if (!pimlex)
              LOG_DEBUG("Missing IML inst. (%d)", op);
           else
              LOG_DEBUG("Issuing IML inst. (%d)", op);
       }
    }
#endif

    if (!pimlex) return NULL;
    return pimlex->push_insts(rrv);
}
void IMText_delete ( IMText ptext)

Definition at line 606 of file IMLSubr.c.

{
    IMText_delete2(ptext);
    free(ptext);
}
void IMText_delete2 ( IMText ptext)

Definition at line 569 of file IMLSubr.c.

{
    int i, j;

    if (ptext->text.utf_chars)
       free(ptext->text.utf_chars);

    if (ptext->feedback) {
       IMFeedbackList *pfbl = ptext->feedback;
       for (i = 0;
            i < ptext->char_length;
            i++, pfbl++) {
           if (pfbl->feedbacks) free(pfbl->feedbacks);
       }
       free(ptext->feedback);
    }

    if (ptext->annotations) {
       IMAnnotation *pima = ptext->annotations;
       for (i = 0;
            i < ptext->count_annotations;
            i++, pima++) {
           IMAnnotationValue *pimav = pima->values;
           for (j = 0;
               j < pima->num_values;
               j++, pimav++) {
              if (pimav->value) free(pimav->value);
           }
           if (pima->values) free(pima->values);
       }
       free(ptext->annotations);
    }
}

Definition at line 551 of file IMLSubr.c.

{
    IMText *pdest;

    if (!psrc) return NULL;

    pdest = (IMText*) malloc(sizeof(IMText));
    if (!pdest) return NULL;
    if (!IMText_duplicate2(pdest, psrc)) {
       free(pdest);
       return NULL;
    }
    return pdest;
}
int IMText_duplicate2 ( IMText pdest,
IMText psrc 
)

Definition at line 454 of file IMLSubr.c.

{
    int i, j;
    IMFeedbackList *pfbl;
    IMFeedbackList *pfbls;

    *pdest = *psrc;
    pdest->text.utf_chars = NULL;
    pdest->feedback = NULL;
    pdest->annotations = NULL;

    if (psrc->char_length > 0) {
       if (psrc->text.utf_chars) {
           UTFCHAR *pu = (UTFCHAR*) malloc(sizeof(UTFCHAR)
                                       * psrc->char_length);
           if (!pu) {
              IMText_delete2(pdest);
              return 0;
           }
           memcpy(pu, psrc->text.utf_chars, sizeof(UTFCHAR) * psrc->char_length);
           pdest->text.utf_chars = pu;
       }

       if (psrc->feedback) {
           pfbl = (IMFeedbackList*) malloc(sizeof(IMFeedbackList)
                                       * psrc->char_length);
           if (!pfbl) {
              IMText_delete2(pdest);
              return 0;
           }
           memset(pfbl, 0, sizeof(IMFeedbackList) * psrc->char_length);
           pdest->feedback = pfbl;

           pfbls = psrc->feedback;
           for (i = 0;
               i < psrc->char_length;
               i++, pfbl++, pfbls++) {
              if (pfbls->count_feedbacks > 0) {
                  pfbl->feedbacks = (IMFeedback*) malloc(sizeof(IMFeedback) * pfbls->count_feedbacks);
                  if (!pfbl->feedbacks) {
                     IMText_delete2(pdest);
                     return 0;
                  }
                  memcpy(pfbl->feedbacks, pfbls->feedbacks,
                        sizeof(IMFeedback) * pfbls->count_feedbacks);
                  pfbl->count_feedbacks = pfbls->count_feedbacks;
              }
           }
       }
    }

    if (psrc->count_annotations > 0) {
       IMAnnotation *pima, *pimas;
       IMAnnotationValue *pimavs;

       pima = (IMAnnotation*) malloc(sizeof(IMAnnotation)
                                  * psrc->count_annotations);
       if (!pima) {
           IMText_delete2(pdest);
           return 0;
       }
       memset(pima, 0, sizeof(IMAnnotation) * psrc->count_annotations);
       pdest->annotations = pima;
       pimas = psrc->annotations;
       for (i = 0;
            i < psrc->count_annotations;
            i++, pima++, pimas++) {
           IMAnnotationValue *pimav = (IMAnnotationValue*) malloc(sizeof(IMAnnotationValue)
                                                           * pimas->num_values);
           if (!pimav) {
              IMText_delete2(pdest);
              return 0;
           }
           memset(pimav, 0, sizeof(IMAnnotationValue) * pimas->num_values);
           *pima = *pimas;
           pima->values = pimav;
           pimavs = pimas->values;
           for (j = 0;
               j < pimas->num_values;
               j++, pimav++, pimavs++) {
              *pimav = *pimavs;
              pimav->value = malloc(pimav->len);
              if (!pimav->value) {
                  IMText_delete2(pdest);
                  return 0;
              }
              memcpy(pimav->value, pimavs->value, pimav->len);
           }
       }
    }

    return 1;
}
off_t lseek_ns ( iml_desktop_t desktop,
int  ns_id,
off_t  offset,
int  whence,
int *  ns_errno 
)

Definition at line 1814 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_lseek *iiimp_lseek;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_lseek = iiimp_lseek_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id, offset, whence);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_LSEEK,
                                       iiimp_lseek);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_LSEEK) {
       IIIMP_lseek_reply *p = (IIIMP_lseek_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->offset;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int lstat_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
struct stat *  stat_buf,
int *  ns_errno 
)

Definition at line 1580 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_lstat *iiimp_lstat;
    IIIMP_utf8string *iiimp_dirname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_dirname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                         (strlen(path) + 1),
                                         (const IIIMP_card8 *)path);
    if (!iiimp_dirname) return -1;

    iiimp_lstat = iiimp_lstat_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id, iiimp_dirname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_LSTAT,
                                       iiimp_lstat);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_LSTAT_REPLY) {
       IIIMP_lstat_reply *p = (IIIMP_lstat_reply *)receive_message->v.file_operation_reply.value;
       if (p->ns_id < 0) {
           return p->ns_id;
       }

       (*buf).st_mode = p->stat_buf->s_mode;
       (*buf).st_nlink = p->stat_buf->s_nlink;
       (*buf).st_uid = p->stat_buf->s_uid;
       (*buf).st_gid = p->stat_buf->s_gid;
       (*buf).st_atime = p->stat_buf->s_atime;
       (*buf).st_mtime = p->stat_buf->s_mtime;
       (*buf).st_ctime = p->stat_buf->s_ctime;
       (*buf).st_blksize = p->stat_buf->s_blksize;
       (*buf).st_dev = p->stat_buf->s_dev;
       (*buf).st_rdev = p->stat_buf->s_rdev;
       (*buf).st_ino = p->stat_buf->s_ino;
       (*buf).st_size = p->stat_buf->s_size;
       (*buf).st_blocks = p->stat_buf->s_blocks;

       *ns_errno =  p->ns_errno;
       return p->ns_id;
    }

    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int mkdir_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
mode_t  mode,
int *  ns_errno 
)

Definition at line 1342 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_mkdir *iiimp_mkdir;
    IIIMP_utf8string *iiimp_dirname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_dirname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                         (strlen(path) + 1),
                                         (const IIIMP_card8 *)path);
    if (!iiimp_dirname) return -1;

    iiimp_mkdir = iiimp_mkdir_new(xims->get_iiimptrans()->get_data_s(),
                              ns_id, mode, iiimp_dirname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_MKDIR,
                                       iiimp_mkdir);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_MKDIR_REPLY) {
       IIIMP_mkdir_reply *p = (IIIMP_mkdir_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

iml_desktop_t* new_user ( iml_if_t If,
const char *  user_name,
const char *  host_name,
const char *  display_id 
)

Definition at line 1691 of file SunIM.c.

{
    iml_desktop_t *p = (iml_desktop_t *) calloc(1, sizeof(iml_desktop_t));

    p->addListenerToDesktop = add_listener_to_desktop;
    p->lookupListenerFromDesktop = lookup_listener_from_desktop;
    p->deleteListenerFromDesktop = delete_listener_from_desktop;

    p->user_name = strdup(user_name);
    p->host_name = strdup(host_name);
    p->display_id = strdup(display_id);
    p->next = If->desktop_list;
    p->If = If;
    If->desktop_list = p;
    If->desktop_count++;
#ifdef DEBUG
    printf("LE %s: %s@%s is entered\n", If->if_name, user_name, host_name);
#endif
    return (iml_desktop_t *) p;
}
int open_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
int  oflag,
mode_t  mode,
int *  ns_errno 
)

Definition at line 974 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_open *iiimp_open;
    IIIMP_utf8string *iiimp_fname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_fname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                   (strlen(path) + 1),
                                   (const IIIMP_card8 *)path);
    if (!iiimp_fname) return -1;

    iiimp_open = iiimp_open_new(xims->get_iiimptrans()->get_data_s(),
                            ns_id,
                            mode,
                            iiimp_fname);

    send_message = iiimp_file_operation_new(
       xims->get_iiimptrans()->get_data_s(),
       xims->get_im_id(),
       IIIMP_FILE_OPERATION_TYPE_OPEN,
       iiimp_open);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_OPEN_REPLY) {
       IIIMP_open_reply *p = (IIIMP_open_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char** opendir_ns ( iml_desktop_t desktop,
int  ns_id,
char *  dirname,
int *  nitems,
int *  pns_id,
int ***  d_reclen,
int *  ns_errno 
)

Definition at line 1228 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_opendir *iiimp_opendir;
    IIIMP_utf8string *iiimp_dirname;
    char **d_name;
    unsigned int i,j;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return NULL;
    iiimp_dirname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                         (strlen(path) + 1),
                                         (const IIIMP_card8 *)path);
    if (!iiimp_dirname) return (char **)NULL;

    iiimp_opendir = iiimp_opendir_new(xims->get_iiimptrans()->get_data_s(),
                                      ns_id, iiimp_dirname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(), xims->get_im_id(), IIIMP_FILE_OPERATION_TYPE_OPENDIR, iiimp_opendir);

    if(!xims->send(send_message, true)) return (char **)NULL;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_OPENDIR_REPLY) {
       IIIMP_opendir_reply *por = (IIIMP_opendir_reply *)receive_message->v.file_operation_reply.value;
       *nitems = por->nitems;
       *pns_id = por->ns_id;
       *ns_errno = por->ns_errno;
       if (*nitems > 0) {
           IIIMP_utf8string *p = por->d_name;
           d_name = (char **) calloc (*nitems, (sizeof (char *)));
           *d_reclen = (int **) calloc(*nitems, sizeof(int *));
           for (i=0; NULL != p; p=p->next, i++) {
              d_name[i] = (char *) calloc((p->len + 1), sizeof(char));
              (*d_reclen)[i] = (int *) calloc(1, sizeof(int));
              (*d_reclen)[i] = (int *) p->len;
              for (j=0; j<p->len; j++) {
                  d_name[i][j] = p->ptr[j];
              }
           }
           return d_name;
       }
    }
    return (char **)NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int read_ns ( iml_desktop_t desktop,
int  ns_id,
void *  ptr,
size_t  size,
int *  ns_errno 
)

Definition at line 1031 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_read *iiimp_read;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_read = iiimp_read_new(xims->get_iiimptrans()->get_data_s(), 
                            ns_id, size);
    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_READ,
                                       iiimp_read);
    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
       if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
               xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
       }
    }
    if (!ptr) return -1;

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_READ_REPLY) {
       IIIMP_read_reply *p = (IIIMP_read_reply *)receive_message->v.file_operation_reply.value;
       memcpy((char *)ptr, (char *)p->object, p->size);
       *ns_errno = p->ns_errno;
       return p->size;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int rename_ns ( iml_desktop_t desktop,
int  ns_id,
char *  old_name,
char *  new_name,
int *  ns_errno 
)

Definition at line 1913 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_rename *iiimp_rename;
    IIIMP_utf8string *iiimp_old_name;
    IIIMP_utf8string *iiimp_new_name;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_old_name = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                          (strlen(old_name) + 1),
                                      (const IIIMP_card8 *)old_name);
    if (!iiimp_old_name) return -1;

    iiimp_new_name = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                          (strlen(new_name) + 1),
                                      (const IIIMP_card8 *)new_name);
    if (!iiimp_new_name) return -1;

    iiimp_rename = iiimp_rename_new(xims->get_iiimptrans()->get_data_s(),
                                ns_id, 
                                iiimp_old_name, 
                                iiimp_new_name);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_RENAME,
                                       iiimp_rename);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY) {
       IIIMP_rename_reply *p = (IIIMP_rename_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int rmdir_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
int *  ns_errno 
)

Definition at line 1395 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_rmdir *iiimp_rmdir;
    IIIMP_utf8string *iiimp_dirname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_dirname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                         (strlen(path) + 1),
                                         (const IIIMP_card8 *)path);
    if (!iiimp_dirname) return -1;

    iiimp_rmdir = iiimp_rmdir_new(xims->get_iiimptrans()->get_data_s(),
                                  ns_id, iiimp_dirname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_RMDIR,
                                       iiimp_rmdir);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_RMDIR_REPLY) {
       IIIMP_rmdir_reply *p = (IIIMP_rmdir_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int stat_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
struct stat *  stat_buf,
int *  ns_errno 
)

Definition at line 1508 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_stat *iiimp_stat;
    IIIMP_utf8string *iiimp_dirname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_dirname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                         (strlen(path) + 1),
                                         (const IIIMP_card8 *)path);
    if (!iiimp_dirname) return -1;

    iiimp_stat = iiimp_stat_new(xims->get_iiimptrans()->get_data_s(),
                            ns_id, iiimp_dirname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_STAT,
                                       iiimp_stat);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !! \n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_STAT_REPLY) {
       IIIMP_stat_reply *p = (IIIMP_stat_reply *)receive_message->v.file_operation_reply.value;
       if (p->ns_id < 0) {
           return p->ns_id;
       }

       (*buf).st_mode = p->stat_buf->s_mode;
       (*buf).st_nlink = p->stat_buf->s_nlink;
       (*buf).st_uid = p->stat_buf->s_uid;
       (*buf).st_gid = p->stat_buf->s_gid;
       (*buf).st_atime = p->stat_buf->s_atime;
       (*buf).st_mtime = p->stat_buf->s_mtime;
       (*buf).st_ctime = p->stat_buf->s_ctime;
       (*buf).st_blksize = p->stat_buf->s_blksize;
       (*buf).st_dev = p->stat_buf->s_dev;
       (*buf).st_rdev = p->stat_buf->s_rdev;
       (*buf).st_ino = p->stat_buf->s_ino;
       (*buf).st_size = p->stat_buf->s_size;
       (*buf).st_blocks = p->stat_buf->s_blocks;

       *ns_errno =  p->ns_errno;
       return p->ns_id;
    }

    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1059 of file SunIMSubr.c.

{
#ifdef sun
#elif   WIN32
    if ((memory_block_mutex = CreateMutex(NULL, FALSE, NULL)) == 0) {
        printf("WIN32 Thread: CreateMutex() ERROR\n");
        return;
    }
#else  /* Linux */
#endif
}
int switch_le_profile ( iml_session_t s,
int  le_profile_id,
IMLEName lename 
)

Definition at line 1150 of file IIIMP_IMState.cpp.

{   
    static int num = 0;
    IIIMP_message *send_message;
    ICState *pics = ((IMLExec_ICState *)s->SessionContext)->get_icstate();
    IIIMP_IMState *xims = (IIIMP_IMState *)pics->get_imstate();
    int default_profile_id;
    int profile_id;
    IIIMP_card16 scope_and_profile_id;

    if (xims == NULL) {
       LOG_DEBUG("IIIMP_IMState: xims is NULL \n");
       return false;
    }
    default_profile_id = xims->get_hotkey_profile()->get_default_hotkey_profile_id();
    profile_id = xims->get_hotkey_profile()->get_unique_profile_id(le_profile_id, lename);
    
    if (profile_id < 0) {
       profile_id = default_profile_id;
    }

    LOG_DEBUG("IIIMP_IMState: xims [0x%x], Switching HotkeyProfile [%d]\n", xims, num++);
    LOG_DEBUG("IIIMP_IMState: LE [%s] switching profile to [%d]\n",lename->id, profile_id);

    // Switch to LE's profile
    scope_and_profile_id = (GLOBAL_HOTKEY << 15) | profile_id;
    send_message = iiimp_select_hotkey_profile_new(xims->get_iiimptrans()->get_data_s(), xims->get_im_id(), scope_and_profile_id);
    if (!xims->send(send_message, true)) return false;

    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int symlink_ns ( iml_desktop_t desktop,
int  ns_id,
char *  dpath,
char *  spath,
int *  ns_errno 
)

Definition at line 1447 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_symlink *iiimp_symlink;
    IIIMP_utf8string *iiimp_dname;
    IIIMP_utf8string *iiimp_sname;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_dname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                       (strlen(dpath) + 1),
                                   (const IIIMP_card8 *)dpath);
                               
    if (!iiimp_dname) return -1;

    iiimp_sname = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                       (strlen(spath) + 1),
                                       (const IIIMP_card8 *)spath);
                                   
    if (!iiimp_sname) return -1;

    iiimp_symlink = iiimp_symlink_new(xims->get_iiimptrans()->get_data_s(),
                                      ns_id, iiimp_dname, iiimp_sname);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_SYMLINK,
                                       iiimp_symlink);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_SYMLINK_REPLY) {
       IIIMP_symlink_reply *p = (IIIMP_symlink_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int truncate_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
off_t  length,
int *  ns_errno 
)

Definition at line 2021 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_truncate *iiimp_truncate;
    IIIMP_utf8string *iiimp_path;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_path = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                      (strlen(path) + 1),
                                  (const IIIMP_card8 *)path);
    if (!iiimp_path) return -1;

    iiimp_truncate = iiimp_truncate_new(xims->get_iiimptrans()->get_data_s(),
                                   ns_id, iiimp_path, length);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_TRUNCATE,
                                       iiimp_truncate);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_TRUNCATE_REPLY) {
       IIIMP_truncate_reply *p = (IIIMP_truncate_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int unlink_ns ( iml_desktop_t desktop,
int  ns_id,
char *  path,
int *  ns_errno 
)

Definition at line 1861 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_unlink *iiimp_unlink;
    IIIMP_utf8string *iiimp_path;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_path = iiimp_utf8string_new(xims->get_iiimptrans()->get_data_s(),
                                      (strlen(path) + 1),
                                  (const IIIMP_card8 *)path);
    if (!iiimp_path) return -1;

    iiimp_unlink = iiimp_unlink_new(xims->get_iiimptrans()->get_data_s(),
                                ns_id, iiimp_path);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(),
                                       xims->get_im_id(),
                                       IIIMP_FILE_OPERATION_TYPE_UNLINK,
                                       iiimp_unlink);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
       receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_UNLINK_REPLY) {
       IIIMP_unlink_reply *p = (IIIMP_unlink_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->ns_id;
    }
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int update_supported_langlist_for_le ( iml_desktop_t desktop,
IMLEName lename,
IMLocale locales,
int  nsl 
)

Definition at line 1124 of file IIIMP_IMState.cpp.

{
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);

    if (xims == NULL)
       return false;
    // Update LEMgr's IMDescriptorList

    xims->get_imhandler()->update_imdesclist(lename, locales, nLocales);

    // TODO!! Send the updated IMDescriptorList to Client using IM_SETIMVALUES
    // IIIMP_IMState_Identified *xims_id = new IIIMP_IMState_Identified(xims, xims->get_imhandler(), xims->get_current_protocol_version());
    // xims_id->set_data_to_client();
    // receive_message = xims->get_iiimptrans()->receive();

    return true;
}

Here is the call graph for this function:

int write_ns ( iml_desktop_t desktop,
int  ns_id,
void *  ptr,
size_t  size,
int *  ns_errno 
)

Definition at line 1078 of file IIIMP_IMState.cpp.

{
    IIIMP_message *send_message;
    IIIMP_message *receive_message;
    IIIMP_write *iiimp_write;
    IIIMP_IMState *xims = IIIMP_IMState::get_imstate_from_desktop(desktop);
    *ns_errno = 0;

    if (xims == NULL)
       return -1;
    iiimp_write = iiimp_write_new(xims->get_iiimptrans()->get_data_s(),
                                  ns_id, size, ptr);

    send_message = iiimp_file_operation_new(xims->get_iiimptrans()->get_data_s(), xims->get_im_id(), IIIMP_FILE_OPERATION_TYPE_WRITE, iiimp_write);

    if(!xims->send(send_message, true)) return -1;

    for (;;) {
        receive_message = xims->get_iiimptrans()->receive();
        if (receive_message) {
           if (receive_message->opcode == IM_FILE_OPERATION_REPLY) {
              LOG_DEBUG("Got IM_FILE_OPERATION_REPLY !!\n");
              break;
           } else {
              xims->dispatch(receive_message->im_id, receive_message->ic_id, receive_message);
           }
        }
    }
    if (!ptr) return -1;

    if (receive_message->v.file_operation_reply.type == IIIMP_FILE_OPERATION_TYPE_WRITE_REPLY) {
       IIIMP_write_reply *p = (IIIMP_write_reply *)receive_message->v.file_operation_reply.value;
       *ns_errno = p->ns_errno;
       return p->size;
    }
    
    return -1;
}

Here is the call graph for this function:

Here is the caller graph for this function: