Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Enumerations | Functions
iiimcfint.h File Reference
#include <threaddef.h>
#include <iiimcf.h>
#include <EIMIL.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IIIMCF_client_conf
struct  IIIMCF_client_env
struct  IIIMCF_handle_rec
struct  IIIMCF_attr_slot
struct  IIIMCF_attr_rec
struct  IIIMCF_text_rec
struct  IIIMCF_lookup_choice_rec
struct  IIIMCF_language_rec
struct  IIIMCF_input_method_rec
struct  IIIMCF_ICAttribute_rec
struct  IIIMCF_auxevent
struct  IIIMCF_event_rec
struct  IIIMCF_component_rec
struct  IIIMCF_downloaded_object_rec
struct  IIIMCF_aux_rec
struct  IIIMCF_context_rec
union  IIIMCF_attr_slot.v
union  IIIMCF_event_rec.v
union  IIIMCF_downloaded_object_rec.v

Defines

#define IIIMCF_MAX_FEEDBACK_NUM   8
#define IIIMCF_IS_CONNECTED(ph)   (((ph)->im_id) >= 0)
#define IIIMCF_IS_IC_INVALID(pc)   (((pc)->ic_id) < 0)
#define IIIMCF_IS_ENABLED(pc, flag)   ((pc)->state_flag & (flag))
#define IIIMCF_IS_STATE_CHANGED(pc, flag)   ((pc)->state_change_flag & (flag))
#define IIIMCF_SET_STATE(pc, flag)   ((pc)->state_flag |= (flag))
#define IIIMCF_SET_STATE_CHANGE(pc, flag)   ((pc)->state_change_flag |= (flag))
#define IIIMCF_RESET_STATE(pc, flag)   ((pc)->state_flag &= (~(flag)))
#define IIIMCF_RESET_STATE_CHANGE(pc, flag)   ((pc)->state_change_flag &= (~(flag)))
#define IIIMCF_IS_BROADCASTING(pc)   IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_BROADCASTING)
#define IIIMCF_IS_PREEDIT_IN_PROGRESS(pc)   (((pc)->preedit_text.len) > 0 ? 1 : 0)
#define IIIMCF_IS_VALID_TEXT(pt)   ((pt)->pv_mtext)
#define IIIMCF_IS_VALID_LOOKUP_CHOICE(pl)   (((pl)->size) > 0)
#define IIIMCF_IS_STATIC_EVENT_FLOW(ph)   ((ph)->num_on_keys == 0)
#define IIIMCF_IS_KEYEVENT_EQUAL(X, Y)
#define IIIMCF_LOCK_HANDLE(ph)   iiimcf_lock_handle(ph);
#define IIIMCF_UNLOCK_HANDLE(ph)   iiimcf_unlock_handle(ph);

Typedefs

typedef struct IIIMCF_client_env
typedef struct IIIMCF_client_conf
typedef struct IIIMCF_handle_rec
typedef struct IIIMCF_context_rec
typedef struct IIIMCF_version_rec
typedef struct IIIMCF_attr_rec
typedef struct IIIMCF_text_rec
typedef struct IIIMCF_text_property_value_rec
typedef struct IIIMCF_lookup_choice_rec
typedef struct IIIMCF_language_rec
typedef struct IIIMCF_input_method_rec
typedef struct IIIMCF_event_rec
typedef struct IIIMCF_component_rec
typedef struct IIIMCF_downloaded_object_rec
typedef struct IIIMCF_aux_rec
typedef struct IIIMCF_ICAttribute_rec

Enumerations

enum  IIIMCF_PROTOCOL_VERSION_MASK { IIIMCF_VERSION_FLAGS_CATEGORY_MASK = 0x00FF, IIIMCF_VERSION_FLAGS_ITEM_MASK = 0xFF00, IIIMCF_VERSION_FLAGS_MASK }
enum  IIIMCF_CONTEXT_STATE_FLAGS {
  IIIMCF_CONTEXT_PREEDIT_ENABLED = (1 << 0), IIIMCF_CONTEXT_LOOKUP_CHOICE_ENABLED = (1 << 1), IIIMCF_CONTEXT_STATUS_ENABLED = (1 << 2), IIIMCF_CONTEXT_COMMITTED_TEXT_ENABLED = (1 << 3),
  IIIMCF_CONTEXT_AUTOMATIC_TRIGGER_NOTIFY = (1 << 4), IIIMCF_CONTEXT_CONVERSION_MODE = (1 << 5), IIIMCF_CONTEXT_BROADCASTING = (1 << 6)
}
enum  IIIMCF_attr_type { IIIMCF_ATTR_TYPE_NONE = 0, IIIMCF_ATTR_TYPE_STRING, IIIMCF_ATTR_TYPE_INTEGER, IIIMCF_ATTR_TYPE_POINTER }

Functions

IIIMP_card16iiimcf_make_string (const IIIMP_card16 *str, int len)
int iiimcf_string_length (const IIIMP_card16 *str)
IIIMP_card16iiimcf_duplicate_string (const IIIMP_card16 *str)
void iiimcf_lock_handle (IIIMCF_handle_rec *ph)
void iiimcf_unlock_handle (IIIMCF_handle_rec *ph)
IIIMF_status iiimcf_register_trigger_keys (IIIMCF_handle_rec *ph, IIIMP_message *pmes)
IIIMF_status iiimcf_register_hotkeys (IIIMCF_handle_rec *ph, IIIMP_message *pmes)
IIIMF_status iiimcf_file_operation (IIIMCF_handle_rec *ph, IIIMP_message *pmes)
IIIMF_status iiimcf_open (IIIMCF_handle_rec *ph, IIIMP_open *po)
IIIMF_status iiimcf_read (IIIMCF_handle_rec *ph, IIIMP_read *pr)
IIIMF_status iiimcf_write (IIIMCF_handle_rec *ph, IIIMP_write *pw)
IIIMF_status iiimcf_seek (IIIMCF_handle_rec *ph, IIIMP_seek *ps)
IIIMF_status iiimcf_close (IIIMCF_handle_rec *ph, IIIMP_close *pc)
IIIMF_status iiimcf_opendir (IIIMCF_handle_rec *ph, IIIMP_opendir *pod)
IIIMF_status iiimcf_closedir (IIIMCF_handle_rec *ph, IIIMP_closedir *pcd)
IIIMF_status iiimcf_mkdir (IIIMCF_handle_rec *ph, IIIMP_mkdir *pm)
IIIMF_status iiimcf_rmdir (IIIMCF_handle_rec *ph, IIIMP_rmdir *pr)
IIIMF_status iiimcf_symlink (IIIMCF_handle_rec *ph, IIIMP_symlink *ps)
IIIMF_status iiimcf_stat (IIIMCF_handle_rec *ph, IIIMP_stat *ps)
IIIMF_status iiimcf_lstat (IIIMCF_handle_rec *ph, IIIMP_lstat *pl)
IIIMF_status iiimcf_fstat (IIIMCF_handle_rec *ph, IIIMP_fstat *pf)
IIIMF_status iiimcf_creat (IIIMCF_handle_rec *ph, IIIMP_creat *pc)
IIIMF_status iiimcf_lseek (IIIMCF_handle_rec *ph, IIIMP_lseek *pl)
IIIMF_status iiimcf_unlink (IIIMCF_handle_rec *ph, IIIMP_unlink *pu)
IIIMF_status iiimcf_rename (IIIMCF_handle_rec *ph, IIIMP_rename *pr)
IIIMF_status iiimcf_fcntl (IIIMCF_handle_rec *ph, IIIMP_fcntl *pf)
IIIMF_status iiimcf_truncate (IIIMCF_handle_rec *ph, IIIMP_truncate *pt)
IIIMF_status iiimcf_ftruncate (IIIMCF_handle_rec *ph, IIIMP_ftruncate *pf)
IIIMF_status iiimcf_setimvalues (IIIMCF_handle_rec *ph, IIIMP_message *pmes)
IIIMF_status iiimcf_connect (IIIMCF_handle_rec *ph)
IIIMF_status iiimcf_send_message (IIIMCF_handle_rec *ph, IIIMP_message *pmes, int deletep)
IIIMF_status iiimcf_receive_message (IIIMCF_handle_rec *ph, IIIMP_message **ppmes)
void iiimcf_unregister_langs (int n, IIIMCF_language_rec **ppl)
void check_pathname (char *p)
IIIMF_status iiimcf_unregister_input_method_list (int n, IIIMCF_input_method_rec **ppi)
IIIMF_status iiimcf_register_input_method_list (IIIMCF_handle_rec *ph, IIIMP_inputmethod_descriptor *piiimp_imlist)
IIIMF_status iiimcf_commit_string (IIIMCF_context_rec *pc, IIIMP_message *pstr)
IIIMCF_context_reciiimcf_lookup_context (IIIMCF_handle_rec *ph, IIIMP_card16 ic_id)
IIIMF_status iiimcf_cleanup_context (IIIMCF_handle_rec *ph, int destroyp)
IIIMF_status iiimcf_enable_context (IIIMCF_context_rec *pc)
IIIMF_status iiimcf_store_event (IIIMCF_context_rec *pc, IIIMCF_event_rec *pe)
IIIMCF_event_reciiimcf_get_event (IIIMCF_context_rec *pc, int removep)
IIIMCF_event_reciiimcf_make_event (IIIMCF_event_type type)
IIIMF_status iiimcf_store_simple_event (IIIMCF_context_rec *pc, IIIMCF_event_type type)
IIIMF_status iiimcf_delete_event_storage (IIIMCF_context_rec *pc)
IIIMF_status iiimcf_receive_forwarded_event (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_broadcast_event (IIIMCF_context_rec *pc, IIIMCF_event_rec *pe)
IIIMF_status iiimcf_lookup_choice_start (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_update_lookup_choice (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_process_lookup_choice (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_lookup_choice_done (IIIMCF_context_rec *pc)
void iiimcf_destruct_lookup_choice (IIIMCF_lookup_choice_rec *pl)
IIIMF_status iiimcf_process_message (IIIMCF_handle_rec *ph, IIIMP_message *pmes)
IIIMF_status iiimcf_wait_message (IIIMCF_handle_rec *ph, IIIMCF_context_rec *pc, int opcode, IIIMP_message **ppmes)
IIIMF_status iiimcf_request_message (IIIMCF_handle_rec *ph, IIIMP_message *pmes, IIIMCF_context_rec *pc, int opcode, IIIMP_message **ppmes)
IIIMF_status iiimcf_toggle_preedit (IIIMCF_context_rec *pc, int flag)
IIIMF_status iiimcf_update_preedit (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_toggle_status (IIIMCF_context_rec *pc, int flag)
IIIMF_status iiimcf_update_status (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_receive_trigger_notify (IIIMCF_context_rec *pc, int flag)
IIIMF_status iiimcf_receive_hotkey_notify (IIIMCF_context_rec *pc)
IIIMF_status iiimcf_process_trigger_keyevent (IIIMCF_context_rec *pc, IIIMCF_keyevent *pkev)
IIIMF_status iiimcf_forward_trigger_notify (IIIMCF_context_rec *pc, int flag)
IIIMF_status iiimcf_process_hotkey_keyevent (IIIMCF_context_rec *pc, IIIMCF_keyevent *pkev)
IIIMF_status iiimcf_forward_hotkey_notify (IIIMCF_context_rec *pc, int hotkey_id, int ikev)
IIIMF_status iiimcf_enable_aux (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_update_aux_draw (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_disable_aux (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_forward_aux_setvalues (IIIMCF_context_rec *pc, IIIMCF_event_rec *pe)
IIIMF_status iiimcf_forward_aux_getvalues (IIIMCF_context_rec *pc, IIIMCF_event_rec *pe)
void iiimcf_delete_all_aux_data (IIIMCF_context_rec *pc)
void iiimcf_delete_aux_event (IIIMCF_event_rec *pe)
IIIMF_status iiimcf_destruct_text (IIIMCF_text_rec *pt)
IIIMF_status iiimcf_construct_text_from_UTF8 (const unsigned char *pstr, IIIMCF_text_rec *pt)
IIIMF_status iiimcf_convert_iiimp_string_to_text (IIIMP_string *pstr, IIIMCF_text_rec *pt)
IIIMF_status iiimcf_convert_iiimp_text_to_text (IIIMP_text *ptext, IIIMCF_text_rec *pt)
IIIMF_status iiimcf_convert_iiimp_contents_to_text (IIIMP_contents *pcon, IIIMCF_text_rec *pt)
IIIMF_status iiimcf_update_text_by_preedit_draw (IIIMCF_text_rec *pbase, IIIMP_message *pmes)
IIIMF_status iiimcf_append_contents_to_text (IIIMCF_text_rec *pbase, IIIMP_contents *pcon)
EIMIL_valueEIMIL_construct_mtext_from_iiimp_text (IIIMP_text *pimt)
EIMIL_valueEIMIL_construct_mtext_from_iiimp_string (IIIMP_string *pstr)
EIMIL_valueEIMIL_construct_mtext_from_iiimp_contents (IIIMP_contents *pimc)
int EIMIL_update_mtext_by_preedit_draw_message (EIMIL_value *pbase, IIIMP_message *pmes, EIMIL_value **ppv_result)
IIIMF_status iiimcf_register_predefined_components (IIIMCF_handle_rec *ph)
void iiimcf_delete_all_components (IIIMCF_handle_rec *ph)
void iiimcf_delete_all_downloaded_objects (IIIMCF_handle_rec *ph)
IIIMF_status iiimcf_create_client_env (IIIMCF_attr attr, IIIMCF_client_env **ppenv)
IIIMF_status iiimcf_delete_client_env (IIIMCF_client_env *penv)
IIIMF_status iiimcf_create_im_connect_message (IIIMCF_handle_rec *ph, IIIMP_message **ppmes)
IIIMF_status iiimcf_create_client_descriptor_message (IIIMCF_handle_rec *ph, IIIMP_message **ppmes)

Class Documentation

struct IIIMCF_client_conf

Definition at line 34 of file iiimcfint.h.

Collaboration diagram for IIIMCF_client_conf:
Class Members
char * ca_file
char * ca_path
char * cert_file
char * cert_key
IIIMCF_client_conf * next
char * server_node
char * service
int use_tls
struct IIIMCF_client_env

Definition at line 45 of file iiimcfint.h.

Collaboration diagram for IIIMCF_client_env:
Class Members
char * home_dir
char * node
char * os_arch
char * os_name
char * os_version
char * password
IIIMCF_client_conf * pconf
char * type
char * user_name
char * X_display_name
char * X_server_vendor
struct IIIMCF_handle_rec

Definition at line 73 of file iiimcfint.h.

Collaboration diagram for IIIMCF_handle_rec:
Class Members
int context_table_size
int curr_profile_id
int curr_scope
IIIMP_data_s * data_s
int disable_automatic_connection_restoration
int im_id
int num_input_methods
int num_langs
int num_of_hkprofiles
int num_of_ns
int num_of_nsl
int num_off_keys
int num_on_keys
int object_descriptor_size
IIIMCF_client_conf * pconf
IIIMCF_downloaded_object_rec * pdownloaded_objs
IIIMCF_client_env * penv
IIIMCF_hotkey_profile * phk_profile
IIIMCF_ns * pns
IIIMCF_ns_listener * pnsl
IIIMCF_object_descriptor * pobjdesc
IIIMCF_keyevent * poff_keys
IIIMCF_keyevent * pon_keys
IIIMCF_context_rec ** ppcontext_table
IIIMCF_input_method_rec ** ppinput_methods
IIIMCF_language_rec ** pplangs
IIIMCF_component_rec * proot_component
IIIMF_stream * pstream
int server_protocol_version
THREAD_SYNC_OBJECT so
int thread_lock_count
THREAD_ID_OBJECT thread_owner_id
struct IIIMCF_attr_slot

Definition at line 140 of file iiimcfint.h.

Class Members
int idx
enum IIIMCF_attr_type union
IIIMCF_attr_slot
v
struct IIIMCF_attr_rec

Definition at line 150 of file iiimcfint.h.

Collaboration diagram for IIIMCF_attr_rec:
Class Members
int nprops
IIIMCF_attr_slot * pslots
struct IIIMCF_text_rec

Definition at line 156 of file iiimcfint.h.

Collaboration diagram for IIIMCF_text_rec:
Class Members
int len
IIIMP_card32 pfeedback_ids
IIIMP_card32 pfeedbacks
IIIMP_card16 * pu16
EIMIL_value * pv_mtext
int updated
struct IIIMCF_lookup_choice_rec

Definition at line 172 of file iiimcfint.h.

Collaboration diagram for IIIMCF_lookup_choice_rec:
Class Members
int choices_per_window
int cols
int direction
int enabled_range_end
int enabled_range_start
int idx_current
int idx_first
int idx_last
int label_owner
int masterp
IIIMCF_text_rec * pcandidates
int * pflags
IIIMCF_text_rec * plabels
int rows
int size
IIIMCF_text_rec title
struct IIIMCF_language_rec

Definition at line 192 of file iiimcfint.h.

Class Members
IIIMP_card16 * hrn
char * lang_id
struct IIIMCF_input_method_rec

Definition at line 197 of file iiimcfint.h.

Collaboration diagram for IIIMCF_input_method_rec:
Class Members
IIIMP_card16 * domain
IIIMP_card16 * hrn
int id
IIIMP_card16 * imname
int num_imeinfos
int num_langs
IIIMCF_imeinfo_rec ** ppimeinfos
IIIMCF_language_rec ** pplangs
struct IIIMCF_ICAttribute_rec

Definition at line 208 of file iiimcfint.h.

Class Members
IIIMP_card16 * imname
int imname_len
char * lang_id
struct IIIMCF_auxevent

Definition at line 214 of file iiimcfint.h.

Class Members
IIIMP_card32 index
IIIMP_card16 * name
int num_intvals
int num_strvals
IIIMP_card32 * pintvals
IIIMP_card16 ** pstrs
struct IIIMCF_event_rec

Definition at line 223 of file iiimcfint.h.

Class Members
int state
IIIMCF_event_type type
union IIIMCF_event_rec v
struct IIIMCF_component_rec

Definition at line 233 of file iiimcfint.h.

Collaboration diagram for IIIMCF_component_rec:
Class Members
IIIMCF_attr attr
IIIMCF_component_interface func
char * name
IIIMCF_component_rec * pchild
IIIMCF_handle_rec * ph
IIIMCF_component_rec * pnext
IIIMCF_component_rec * pparent
IIIMCF_component_rec * pprev
struct IIIMCF_downloaded_object_rec

Definition at line 244 of file iiimcfint.h.

Collaboration diagram for IIIMCF_downloaded_object_rec:
Class Members
IIIMCF_downloaded_object_rec * pnext
const IIIMCF_object_descriptor * pod
union IIIMCF_downloaded_object_rec v
struct IIIMCF_aux_rec

Definition at line 253 of file iiimcfint.h.

Collaboration diagram for IIIMCF_aux_rec:
Class Members
IIIMP_card32 index
int mode
IIIMP_card16 * name
int num_intvals
int num_strvals
IIIMP_card32 * pintvals
IIIMCF_aux_rec * pnext
IIIMP_card16 ** pstrs
struct IIIMCF_context_rec

Definition at line 267 of file iiimcfint.h.

Collaboration diagram for IIIMCF_context_rec:
Class Members
IIIMCF_attr attr
IIIMCF_text_rec committed_text
int evqueue_size
int ic_id
IIIMCF_ICAttribute_rec icattr
IIIMCF_lookup_choice_rec lookup_choice
IIIMCF_aux_rec * paux
IIIMCF_component_rec * pcurrent_component
IIIMCF_handle_rec * ph
IIIMCF_context_rec * pnext
IIIMCF_event_rec ** ppev_con
IIIMCF_event_rec ** ppev_pro
IIIMCF_event_rec ** ppevqueue
int preedit_caret_position
IIIMCF_text_rec preedit_text
int state_change_flag
int state_flag
IIIMCF_text_rec status_text
union IIIMCF_attr_slot.v

Definition at line 143 of file iiimcfint.h.

Class Members
int number
void * ptr
const char * str
union IIIMCF_event_rec.v

Definition at line 225 of file iiimcfint.h.

Class Members
IIIMCF_keyevent keyevent
int number
IIIMCF_auxevent * pauxevent
union IIIMCF_downloaded_object_rec.v

Definition at line 247 of file iiimcfint.h.

Class Members
IIIMP_card8 * pbin
IIIMP_card16 * str

Define Documentation

Definition at line 318 of file iiimcfint.h.

#define IIIMCF_IS_CONNECTED (   ph)    (((ph)->im_id) >= 0)

Definition at line 310 of file iiimcfint.h.

#define IIIMCF_IS_ENABLED (   pc,
  flag 
)    ((pc)->state_flag & (flag))

Definition at line 312 of file iiimcfint.h.

#define IIIMCF_IS_IC_INVALID (   pc)    (((pc)->ic_id) < 0)

Definition at line 311 of file iiimcfint.h.

#define IIIMCF_IS_KEYEVENT_EQUAL (   X,
 
)
Value:
(((X).keycode == (Y).keycode) \
                                        /* && ((X).keychar == (Y).keychar) */ \
                                        && ((X).modifier == (Y).modifier))

Definition at line 325 of file iiimcfint.h.

#define IIIMCF_IS_PREEDIT_IN_PROGRESS (   pc)    (((pc)->preedit_text.len) > 0 ? 1 : 0)

Definition at line 319 of file iiimcfint.h.

#define IIIMCF_IS_STATE_CHANGED (   pc,
  flag 
)    ((pc)->state_change_flag & (flag))

Definition at line 313 of file iiimcfint.h.

#define IIIMCF_IS_STATIC_EVENT_FLOW (   ph)    ((ph)->num_on_keys == 0)

Definition at line 323 of file iiimcfint.h.

#define IIIMCF_IS_VALID_LOOKUP_CHOICE (   pl)    (((pl)->size) > 0)

Definition at line 321 of file iiimcfint.h.

#define IIIMCF_IS_VALID_TEXT (   pt)    ((pt)->pv_mtext)

Definition at line 320 of file iiimcfint.h.

#define IIIMCF_LOCK_HANDLE (   ph)    iiimcf_lock_handle(ph);

Definition at line 329 of file iiimcfint.h.

#define IIIMCF_MAX_FEEDBACK_NUM   8

Definition at line 155 of file iiimcfint.h.

#define IIIMCF_RESET_STATE (   pc,
  flag 
)    ((pc)->state_flag &= (~(flag)))

Definition at line 316 of file iiimcfint.h.

#define IIIMCF_RESET_STATE_CHANGE (   pc,
  flag 
)    ((pc)->state_change_flag &= (~(flag)))

Definition at line 317 of file iiimcfint.h.

#define IIIMCF_SET_STATE (   pc,
  flag 
)    ((pc)->state_flag |= (flag))

Definition at line 314 of file iiimcfint.h.

#define IIIMCF_SET_STATE_CHANGE (   pc,
  flag 
)    ((pc)->state_change_flag |= (flag))

Definition at line 315 of file iiimcfint.h.

#define IIIMCF_UNLOCK_HANDLE (   ph)    iiimcf_unlock_handle(ph);

Definition at line 330 of file iiimcfint.h.


Typedef Documentation

typedef struct IIIMCF_attr_rec

Definition at line 21 of file iiimcfint.h.

typedef struct IIIMCF_aux_rec

Definition at line 30 of file iiimcfint.h.

typedef struct IIIMCF_client_conf

Definition at line 16 of file iiimcfint.h.

typedef struct IIIMCF_client_env

Definition at line 15 of file iiimcfint.h.

typedef struct IIIMCF_component_rec

Definition at line 28 of file iiimcfint.h.

typedef struct IIIMCF_context_rec

Definition at line 19 of file iiimcfint.h.

Definition at line 29 of file iiimcfint.h.

typedef struct IIIMCF_event_rec

Definition at line 27 of file iiimcfint.h.

typedef struct IIIMCF_handle_rec

Definition at line 18 of file iiimcfint.h.

typedef struct IIIMCF_ICAttribute_rec

Definition at line 32 of file iiimcfint.h.

typedef struct IIIMCF_input_method_rec

Definition at line 26 of file iiimcfint.h.

typedef struct IIIMCF_language_rec

Definition at line 25 of file iiimcfint.h.

typedef struct IIIMCF_lookup_choice_rec

Definition at line 24 of file iiimcfint.h.

Definition at line 23 of file iiimcfint.h.

typedef struct IIIMCF_text_rec

Definition at line 22 of file iiimcfint.h.

typedef struct IIIMCF_version_rec

Definition at line 20 of file iiimcfint.h.


Enumeration Type Documentation

Enumerator:
IIIMCF_ATTR_TYPE_NONE 
IIIMCF_ATTR_TYPE_STRING 
IIIMCF_ATTR_TYPE_INTEGER 
IIIMCF_ATTR_TYPE_POINTER 

Definition at line 133 of file iiimcfint.h.

Enumerator:
IIIMCF_CONTEXT_PREEDIT_ENABLED 
IIIMCF_CONTEXT_LOOKUP_CHOICE_ENABLED 
IIIMCF_CONTEXT_STATUS_ENABLED 
IIIMCF_CONTEXT_COMMITTED_TEXT_ENABLED 
IIIMCF_CONTEXT_AUTOMATIC_TRIGGER_NOTIFY 
IIIMCF_CONTEXT_CONVERSION_MODE 
IIIMCF_CONTEXT_BROADCASTING 

Definition at line 123 of file iiimcfint.h.

Enumerator:
IIIMCF_VERSION_FLAGS_CATEGORY_MASK 
IIIMCF_VERSION_FLAGS_ITEM_MASK 
IIIMCF_VERSION_FLAGS_MASK 

Definition at line 66 of file iiimcfint.h.


Function Documentation

void check_pathname ( char *  p)

Definition at line 975 of file iiimcf.c.

{
    char *q;
    int index = 0;

    while (*p) {
        if ((q = (strstr(p, "../")))) {
            index = p - q;
            if (index < 0)
                index = -index;
            strcpy(p+index, p+index+3);
        } else if ((q = (strstr(p, "//")))) {
            index = p - q;
            if (index < 0)
                index = -index;
            strcpy(p+index, p+index+1);
        } else if ((q = (strstr(p, "./")))) {
            index = p - q;
            if (index < 0)
                index = -index;
            strcpy(p+index, p+index+2);
        } else {
            break ;
        }
    }
    return;
}

Here is the caller graph for this function:

Definition at line 133 of file IIIMPEIMIL.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 124 of file IIIMPEIMIL.c.

{
    return EIMIL_construct_mtext_from_UTF16(pstr->len,
                                       pstr->ptr);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 50 of file IIIMPEIMIL.c.

{
    int i, idx;
    EIMIL_value *pv_mtext;
    EIMIL_mtext *pm;
    {
       int cur_fid0_val, cur_fid0_st;
       int len;
       int buflen = EIMIL_IIIMP_INIT_BUFFER_SIZE;
       UTF16 *pstrh, *pstr;
       IIIMP_char_with_feedback *pcwf;
       IIIMP_feedback_attr_list *pfal;
       IIIMP_feedback_attr *pfa;

       len = 0;
       pstrh = pstr = (UTF16*) malloc(buflen * sizeof(UTF16));
       if (!pstrh) return NULL;

       /* string */
       for (pcwf = pimt->char_with_feedback;
            pcwf; pcwf = pcwf->next) {
           if (len >= buflen) {
              buflen *= 2;
              pstr = (UTF16*) realloc(pstrh, buflen * sizeof(UTF16));
              if (!pstr) {
                  free(pstrh);
                  return NULL;
              }
              pstrh = pstr;
              pstr += len;
           }
           *pstr++ = pcwf->code;
           len++;
       }
       pv_mtext = EIMIL_construct_mtext_from_UTF16(len, pstrh);
       if (!pv_mtext) return NULL;
       free(pstrh);
       pm = &pv_mtext->v.mtext;

       /* feedback */
       cur_fid0_val = 0;
       cur_fid0_st = 0;
       idx = 0;
       for (pcwf = pimt->char_with_feedback;
            pcwf; pcwf = pcwf->next, idx++) {
           pfal = pcwf->feedback_attr;
           pfa = pfal->ptr;
           for (i = 0; i < pfal->count; i++) {
              if (pfa->id == 0) {
                  if (cur_fid0_val != pfa->feedback) {
                     if (cur_fid0_val != 0) {
                         if (!set_feedback_prop(pm, cur_fid0_val, cur_fid0_st, idx))
                            return NULL;
                     }
                     cur_fid0_st = idx;
                     cur_fid0_val = pfa->feedback;
                  }
                  break;
              }
           }
       }
       if (cur_fid0_val != 0) {
           if (!set_feedback_prop(pm, cur_fid0_val, cur_fid0_st, idx))
              return NULL;
       }
    }
    /* TOOD: annotation!!! */

    return pv_mtext;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int EIMIL_update_mtext_by_preedit_draw_message ( EIMIL_value pbase,
IIIMP_message pmes,
EIMIL_value **  ppv_result 
)

Definition at line 147 of file IIIMPEIMIL.c.

{
    EIMIL_mtext *pm;
    ASSERT(pbase->type == EIMIL_TYPE_MTEXT);
    pm = &pbase->v.mtext;

    if (pmes->opcode == IM_PREEDIT_DRAW) {
       int i, n = 0;
       EIMIL_value *pvs[3];
       IIIMP_preedit_draw_v *pimd = &pmes->v.preedit_draw;
       int st, end;

       st = pimd->change_first;
       end = st + pimd->change_length;

       if (st > 0) {
           pvs[n++] = EIMIL_mtext_substr(pbase, 0, st);
       }
       if (pimd->preedit) {
           pvs[n++] = EIMIL_construct_mtext_from_iiimp_contents(pimd->preedit);
       }
       if (end < pm->len) {
           pvs[n++] = EIMIL_mtext_substr(pbase, end, pm->len);
       }

       if (n > 0) {
           *ppv_result = EIMIL_mtext_concat(n, pvs);
       } else {
           *ppv_result = NULL;
       }
       for (i = 0; i < n; i++) {
           EIMIL_RMREF(*pvs[i]);
       }
    } else {
       return 0;
    }

    return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 280 of file text.c.

{
    if (!pbase->pv_mtext) {
       return iiimcf_convert_iiimp_contents_to_text(pcon, pbase);
    } else {
       EIMIL_value *pvs[2];
       EIMIL_value *pv;

       pvs[0] = pbase->pv_mtext;
       pvs[1] = EIMIL_construct_mtext_from_iiimp_contents(pcon);
       if (!pvs[1]) return IIIMF_STATUS_MALLOC;
       pv = EIMIL_mtext_concat(2, pvs);
       if (!pv) {
           EIMIL_destruct_value(pvs[1]);
           return IIIMF_STATUS_MALLOC;
       }
       EIMIL_destruct_value(pbase->pv_mtext);
       pbase->pv_mtext = pv;
       pbase->updated = 0;
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 310 of file event.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 261 of file context.c.

{
    IIIMF_status st1, st2;
    IIIMCF_context_rec **ppc, *pc, *pc2;
    int i;

    st2 = IIIMF_STATUS_SUCCESS;
    for (ppc = ph->ppcontext_table, i = 0;
        i < ph->context_table_size;
        ppc++, i++) {
       for (pc = *ppc; pc; pc = pc2) {
           pc2 = pc->pnext;
           if (destroyp) {
              st1 = iiimcf_destroy_context(pc);
           } else {
              st1 = invalidate_context(pc);
           }
           if (st1 != IIIMF_STATUS_SUCCESS) st2 = st1;
       }
    }

    return st2;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 301 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_close_reply *iclr;
    IIIMP_message *preply;
    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pc->ns_id) {
           if ((ret = close(ph->pns[i].nsc_fd)) < 0) {
                iclr = iiimp_close_reply_new(ph->data_s, ret, errno);
                preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CLOSE_REPLY, iclr);
              return iiimcf_send_message(ph, preply, 1);
            }
       }
    } 
    iclr = iiimp_close_reply_new(ph->data_s, pc->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CLOSE_REPLY, iclr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 417 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_closedir_reply *pcdr;
    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
        if (ph->pns[i].ns_id == pcd->ns_id) {
            if ((ret = closedir(ph->pns[i].nsc_dirp)) < 0) {
                pcdr = iiimp_closedir_reply_new(ph->data_s, ret, errno);
                preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CLOSEDIR_REPLY, pcdr);
              return iiimcf_send_message(ph, preply, 1);
            }
        }
    }
    pcdr = iiimp_closedir_reply_new(ph->data_s, pcd->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CLOSEDIR_REPLY, pcdr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 9 of file commit.c.

{
    IIIMF_status st;
    IIIMP_contents *pcon = pmes->v.commit_string.contents;

    ASSERT(pmes->opcode == IM_COMMIT_STRING);

    if (IIIMCF_IS_STATE_CHANGED(pc, IIIMCF_STATE_COMMIT_REQUIRED)) {
       /* In the same session, the server sends IM_COMMIT_STRING more than
          once.  We should simply concatenate the commit string.  */
       st = iiimcf_append_contents_to_text(&pc->committed_text, pcon);
       if (st != IIIMF_STATUS_SUCCESS) return st;
       IIIMCF_SET_STATE(pc, IIIMCF_CONTEXT_COMMITTED_TEXT_ENABLED);
    } else {
       /* First commit since the last session is initiated.  */
       st = iiimcf_convert_iiimp_contents_to_text(pcon, &pc->committed_text);
       if (st != IIIMF_STATUS_SUCCESS) return st;
       IIIMCF_SET_STATE(pc, IIIMCF_CONTEXT_COMMITTED_TEXT_ENABLED);
       IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_COMMIT_REQUIRED);
       st = iiimcf_store_simple_event(pc, IIIMCF_EVENT_TYPE_UI_COMMIT);
    }

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 476 of file iiimcf.c.

{
    IIIMF_status st = IIIMF_STATUS_SUCCESS;
    IIIMP_message *pmes;

    if (!ph->data_s) ph->data_s = iiimp_data_s_new();
    if (!ph->data_s) return IIIMF_STATUS_MALLOC;

    if (!ph->pstream) {
        IIIMCF_client_conf *pconf;
        if (ph->pconf) {
            pconf = ph->pconf;
            ph->pconf = NULL;
        } else {
            pconf = ph->penv->pconf;
        }
        for ( ; pconf; pconf = pconf->next) {
            /* use TLS */
            if (pconf->use_tls) {
                /* check whther libiiimp is compiled with TLS support */
                st = iiimf_tls_supported();
                if (st != IIIMF_STATUS_SUCCESS) continue;

                st = iiimf_connect_tls_stream(pconf->server_node ? pconf->server_node : NODE_DEFAULT,
                                              pconf->service ? pconf->service : TLS_DEFAULT,
                                              IIIMCF_DEFAULT_TIMEOUT,
                                              &ph->pstream);
                if (st != IIIMF_STATUS_SUCCESS) continue;

                /* TODO*/
                iiimf_tls_set_certificate(ph->pstream,
                                          pconf->cert_file,
                                          pconf->cert_key,
                                          pconf->ca_file,
                                          pconf->ca_path);
            } else {
               st = iiimf_connect_socket_stream(pconf->server_node ? pconf->server_node : NODE_DEFAULT,
                                             pconf->service ? pconf->service : SERVICE_DEFAULT,
                                            IIIMCF_DEFAULT_TIMEOUT,
                                           &ph->pstream);
            }

            if (st == IIIMF_STATUS_SUCCESS) {
                /* set current configuration to IIIMCF_handle */
                ph->pconf = pconf;
                break;
            }
        }
    }
    if (st != IIIMF_STATUS_SUCCESS) {
        /* finally try to connect to 127.0.0.1:9010 */
        st = iiimf_connect_socket_stream(NODE_DEFAULT, SERVICE_DEFAULT,
                                         IIIMCF_DEFAULT_TIMEOUT,
                                         &ph->pstream);
    }
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimcf_create_im_connect_message(ph, &pmes);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimf_stream_send(ph->pstream, ph->data_s, pmes);
    iiimp_message_delete(ph->data_s, pmes);
    if (st != IIIMF_STATUS_SUCCESS) goto reconnect;

    st = iiimcf_wait_message(ph, NULL, IM_CONNECT_REPLY, &pmes);
    if (st != IIIMF_STATUS_SUCCESS) {
        if (pmes) iiimp_message_delete(ph->data_s, pmes);
        goto reconnect;
    }

    ph->im_id = pmes->im_id;
    st = iiimp_data_s_limit_protocol_version(ph->data_s,
                                        ph->server_protocol_version);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    st = iiimcf_register_langs(ph, pmes->v.connect_reply.language);
    iiimp_message_delete(ph->data_s, pmes);

    /* send CLIENTDESCRIPTOR */
    st = iiimcf_create_client_descriptor_message(ph, &pmes);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimf_stream_send(ph->pstream, ph->data_s, pmes);
    iiimp_message_delete(ph->data_s, pmes);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    st = iiimcf_wait_message(ph, NULL, IM_SETIMVALUES_REPLY, NULL);

    return st;

reconnect:
    /* 
     * in this case, iiimcf connects iiimsf successfully,
     * but iiimsf refuses the connection.
     *
     * so, try to next iiimsf if any.
     */
    if (!ph->pconf) return st;
    if (ph->pconf->next) {
        /* first, destroy current stream */
        iiimcf_delete_stream(ph);
        /* ph->pconf store current configuration */
        ph->pconf = ph->pconf->next;
        return iiimcf_connect(ph);
    }
    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_construct_text_from_UTF8 ( const unsigned char *  pstr,
IIIMCF_text_rec pt 
)

Definition at line 166 of file text.c.

{
    EIMIL_value *pv_mtext;

    if (pt->pv_mtext) EIMIL_destruct_value(pt->pv_mtext);
    pt->pv_mtext = NULL;
    pt->updated = 0;
    if (!pstr) {
       pt->pv_mtext = NULL;
       return IIIMF_STATUS_SUCCESS;
    }
    pv_mtext = EIMIL_construct_mtext_from_UTF8(pstr);
    if (!pv_mtext) {
       return IIIMF_STATUS_MALLOC;
    }
    pt->pv_mtext = pv_mtext;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 241 of file text.c.

{
    if (pcon->type == IIIMP_CONTENTS_TEXT) {
       return iiimcf_convert_iiimp_text_to_text(pcon->value.text, pt);
    } else if (pcon->type == IIIMP_CONTENTS_STRING) {
       return iiimcf_convert_iiimp_string_to_text(pcon->value.string, pt);
    } else {
       return IIIMF_STATUS_ARGUMENT;
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 190 of file text.c.

{
    EIMIL_value *pv_mtext;

    if (pt->pv_mtext) EIMIL_destruct_value(pt->pv_mtext);
    pt->pv_mtext = NULL;
    pt->updated = 0;
    if (pstr->len == 0) {
       pt->pv_mtext = NULL;
       return IIIMF_STATUS_SUCCESS;
    }
    pv_mtext = EIMIL_construct_mtext_from_iiimp_string(pstr);
    if (!pv_mtext) {
       return IIIMF_STATUS_MALLOC;
    }
    pt->pv_mtext = pv_mtext;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 214 of file text.c.

{
    EIMIL_value *pv_mtext;

    if (ptext == NULL)
      return IIIMF_STATUS_FAIL;
    if (pt->pv_mtext) EIMIL_destruct_value(pt->pv_mtext);
    pt->pv_mtext = NULL;
    pt->updated = 0;
    if (!ptext->char_with_feedback) {
       pt->pv_mtext = NULL;
       return IIIMF_STATUS_SUCCESS;
    }
    pv_mtext = EIMIL_construct_mtext_from_iiimp_text(ptext);
    if (!pv_mtext) {
       return IIIMF_STATUS_MALLOC;
    }
    pt->pv_mtext = pv_mtext;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 730 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_creat_reply *pcr;
    char path[PATH_MAX];
    char *dirname;
    errno = 0;

    dirname = (char *)calloc((pc->path->len + 1), sizeof(char));
    for (i=0; i<pc->path->len; i++) {
        dirname[i] = pc->path->ptr[i];
    }
    dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    snprintf(path, sizeof(path), "%s",dirname);
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
       snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = creat(path, pc->mode)) < 0) {
        pcr = iiimp_creat_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CREAT_REPLY, pcr);
        return iiimcf_send_message(ph, preply, 1);
    }
    pcr = iiimp_creat_reply_new(ph->data_s, pc->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_CREAT_REPLY, pcr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1054 of file clientenv.c.

{
    IIIMF_status st;
    IIIMCF_client_env *penv = ph->penv;
    IIIMP_message *pmes;
    IIIMP_imattribute *pimattr;
    IIIMP_client_descriptor *cdesc;
    IIIMP_string *type, *os_name, *os_arch, *os_ver;
    IIIMP_string *X_display_name, *X_server_vendor;

    pmes = NULL;
    pimattr = NULL;
    cdesc = NULL;
    type = os_name = os_arch = os_ver = NULL;
    X_display_name = X_server_vendor = NULL;

    st = iiimf_data_string_ascii_new(ph->data_s, penv->type, &type);
    if (st != IIIMF_STATUS_SUCCESS) goto error;
    st = iiimf_data_string_ascii_new(ph->data_s, penv->os_name, &os_name);
    if (st != IIIMF_STATUS_SUCCESS) goto error;
    st = iiimf_data_string_ascii_new(ph->data_s, penv->os_arch, &os_arch);
    if (st != IIIMF_STATUS_SUCCESS) goto error;
    st = iiimf_data_string_ascii_new(ph->data_s, penv->os_version, &os_ver);
    if (st != IIIMF_STATUS_SUCCESS) goto error;

    if (penv->X_display_name) {
       st = iiimf_data_string_ascii_new(ph->data_s,
                                    penv->X_display_name,
                                    &X_display_name);
       if (st != IIIMF_STATUS_SUCCESS) goto error;
    }
    if (penv->X_server_vendor) {
       st = iiimf_data_string_ascii_new(ph->data_s,
                                    penv->X_server_vendor,
                                    &X_server_vendor);
       if (st != IIIMF_STATUS_SUCCESS) goto error;
    }

    cdesc = iiimp_client_descriptor_new(ph->data_s,
                                   type, os_name, os_arch, os_ver,
                                   X_display_name, X_server_vendor);
    if (!cdesc) goto error;

    pimattr = iiimp_imattribute_client_descriptor_new(ph->data_s,
                                                IIIMP_IMATTRIBUTE_CLIENT_DESCRIPTOR,
                                                0, cdesc);
    if (!pimattr) goto error;

    pmes = iiimp_setimvalues_new(ph->data_s, ph->im_id, pimattr);
    if (!pmes) goto error;

    *ppmes = pmes;

    return IIIMF_STATUS_SUCCESS;

error:
    if (type) iiimp_string_delete(ph->data_s, type);
    if (os_name) iiimp_string_delete(ph->data_s, os_name);
    if (os_arch) iiimp_string_delete(ph->data_s, os_arch);
    if (os_ver) iiimp_string_delete(ph->data_s, os_ver);
    if (X_display_name) iiimp_string_delete(ph->data_s, X_display_name);
    if (X_server_vendor) iiimp_string_delete(ph->data_s, X_server_vendor);
    if (cdesc) iiimp_client_descriptor_delete(ph->data_s, cdesc);
    if (pimattr) iiimp_imattribute_delete(ph->data_s, pimattr);

    return IIIMF_STATUS_MALLOC;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 783 of file clientenv.c.

{
    IIIMCF_client_env *penv;
    IIIMCF_client_conf *pconf;
    IIIMF_status st;
    const char *server_node, *service, *user_name, *password;
    const char *clientname, *x_display_name, *x_server_vendor;

    server_node = service = user_name = password = NULL;
    clientname = x_display_name = x_server_vendor = NULL;

    penv = (IIIMCF_client_env *)malloc(sizeof (IIIMCF_client_env));
    if (!penv) return IIIMF_STATUS_MALLOC;
    memset(penv, 0, sizeof(*penv));

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_SERVER_ADDRESS,
                                  &server_node);

    if (st != IIIMF_STATUS_SUCCESS && st != IIIMF_STATUS_NO_ATTR_VALUE) goto error;

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_SERVER_SERVICE,
                                  &service);
    if (st != IIIMF_STATUS_SUCCESS && st != IIIMF_STATUS_NO_ATTR_VALUE) goto error;

    if (server_node || service) {
        penv->pconf = iiimcf_client_config_new(server_node ? strdup(server_node) : NULL,
                                              service ?  strdup(service) : NULL);
        if (!penv->pconf) goto memory_error;
    }


    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_USERNAME,
                                  &user_name);
    if (st == IIIMF_STATUS_SUCCESS) {
       penv->user_name = strdup(user_name);
       if (!penv->user_name) goto memory_error;
    } else if (st != IIIMF_STATUS_NO_ATTR_VALUE) {
       goto error;
    }
    {
       struct passwd *pwd;
       /* TODO!  Use penv->user_name to check the
          home directory. */
       if ((pwd = getpwuid(geteuid()))) {
           if (!penv->user_name)
              penv->user_name = strdup(pwd->pw_name);
           if (!penv->user_name) goto memory_error;
           penv->home_dir = strdup(pwd->pw_dir);
           if (!penv->home_dir) goto memory_error;
       }
    }
    /* We still fail to get user_name, set "Unknown" with force.  */
    if (!penv->user_name) {
       penv->user_name = strdup("Unknown");
       if (!penv->user_name) goto memory_error;
    }

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_PASSWORD,
                                  &password);
    if (st == IIIMF_STATUS_SUCCESS) {
       penv->password = strdup(password);
       if (!penv->password) goto memory_error;
    } else if (st == IIIMF_STATUS_NO_ATTR_VALUE) {
       st = iiimcf_client_auth_password(penv);
       if ((st != IIIMF_STATUS_SUCCESS)
           && (st != IIIMF_STATUS_CONFIG))
           goto error;
    } else {
       goto error;
    }

    if (!server_node && !service) {
       st = iiimcf_client_environ_server(penv);
       if (st != IIIMF_STATUS_SUCCESS) {
           st = iiimcf_client_file_server(penv);
           if (st != IIIMF_STATUS_SUCCESS) {
              st = iiimcf_client_file_compat_server(penv);
           }
       }
    }
    if (!penv->pconf) {
        /* 
         * we don't have any pconfiguration.
         * prepare default one.
         */
        int node_len;
        char *tmp_node;

        /* 
         * first try to /tmp/.iiimp-unix-${USERNAME}/
         */
       node_len = strlen("/tmp/.iiimp-unix-") + strlen(penv->user_name);
        tmp_node = malloc(node_len + 1);
        if (!tmp_node) goto memory_error;
        snprintf(tmp_node, node_len + 1, "/tmp/.iiimp-unix-%s", penv->user_name);
        tmp_node[node_len] = '\0';

       if (IIIMF_STATUS_SUCCESS != dir_valid(tmp_node, geteuid())) {
           /* 
            * try /tmp/.iiimp-unix-${USERNAME}-xxxxxxxx/
            */
           free(tmp_node);
           tmp_node = NULL;
           st = iiimcf_alternate_unix_domain_socket_file_dir(penv, &tmp_node);
       }

       if (NULL != tmp_node) {
           penv->pconf = iiimcf_client_config_new(tmp_node, NULL);
           if (!penv->pconf) {
              free(tmp_node);
              goto memory_error;
           }
       }

        /* 
         * second try to $SOCKETDIR/.iiimp-unix/
         */
        tmp_node = strdup(SOCKETDIR "/.iiimp-unix");
        if (!tmp_node) goto memory_error;
       pconf = iiimcf_client_config_new(tmp_node, NULL);
        if (NULL == pconf) {
            free(tmp_node);
            goto memory_error;
        }

       if (NULL == penv->pconf) {
           penv->pconf = pconf;
       } else {
           penv->pconf->next = pconf;
       }
    }

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_CLIENT_TYPE,
                                  &clientname);
    if (st == IIIMF_STATUS_SUCCESS) {
       penv->type = strdup(clientname);
    } else if (st == IIIMF_STATUS_NO_ATTR_VALUE) {
       penv->type = strdup(CLIENT_TYPE);
    } else {
       goto error;
    }
    if (!penv->type) goto memory_error;

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_CLIENT_X_DISPLAY_NAME,
                                  &x_display_name);
    if (st == IIIMF_STATUS_SUCCESS) {
       penv->X_display_name = strdup(x_display_name);
       if (!penv->X_display_name) goto memory_error;
    } else if (st != IIIMF_STATUS_NO_ATTR_VALUE) {
       goto error;
    }

    st = iiimcf_attr_get_string_value(attr,
                                  IIIMCF_ATTR_CLIENT_X_SERVER_VENDOR,
                                  &x_server_vendor);
    if (st == IIIMF_STATUS_SUCCESS) {
       penv->X_server_vendor = strdup(x_server_vendor);
       if (!penv->X_server_vendor) goto memory_error;
    } else if (st != IIIMF_STATUS_NO_ATTR_VALUE) {
       goto error;
    }

    {
       struct utsname name;
       if (-1 != uname(&name)) {
           penv->node = strdup(name.nodename);
           if (!penv->node) goto memory_error;
           penv->os_name = strdup(name.sysname);
           if (!penv->os_name) goto memory_error;
           penv->os_version = strdup(name.release);
           if (!penv->os_version) goto memory_error;
       }
    }

    st = iiimcf_client_os_arch(penv);
    if ((st != IIIMF_STATUS_SUCCESS)
       && (st != IIIMF_STATUS_CONFIG))
       goto error;

    *ppenv = penv;

    return IIIMF_STATUS_SUCCESS;

memory_error:
    st = IIIMF_STATUS_MALLOC;
error:
    iiimcf_delete_client_env(penv);
    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1004 of file clientenv.c.

{
    int len;
    char *user;
    IIIMF_status st;
    IIIMP_message *pmes;
    IIIMP_string *pim_user;
    IIIMCF_client_env *penv = ph->penv;

    len = strlen(penv->user_name);
    if (penv->node) len += strlen(penv->node);
    if (penv->X_display_name) len += strlen(penv->X_display_name);
    else len += 4;
    if (penv->password) len += strlen(penv->password);
    user = (char*) malloc(sizeof(char) * (len + 1 + 1 + 1)); /* for @, #, and \0. */
    if (!user) return IIIMF_STATUS_MALLOC;
    strcpy(user, penv->user_name);
    if (penv->node) {
       strcat(user, "@");
       strcat(user, penv->node);
        /* printf("penv->X_display_name [%s]\n", penv->X_display_name); */
        if (penv->X_display_name) {
         strcat(user, penv->X_display_name);
        } else {
         penv->X_display_name = strdup(":0.0");
         strcat(user, ":0.0");
        }
    }
    if (penv->password) {
       strcat(user, "#");
       strcat(user, penv->password);
    }
    st = iiimf_data_string_ascii_new(ph->data_s, user, &pim_user);
    free(user);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    pmes = iiimp_connect_new(ph->data_s, pim_user, NULL);
    if (!pmes) {
       iiimp_string_delete(ph->data_s, pim_user);
       return IIIMF_STATUS_MALLOC;
    }

    *ppmes = pmes;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 455 of file aux.c.

{
    int i, n;
    IIIMCF_aux_rec *pa, *pa2;
    IIIMP_card16 **pstrs;

    for (pa = pc->paux; pa; pa = pa2) {
       pa2 = pa->pnext;
       if (pa->name) free(pa->name);
       if (pa->pintvals) free(pa->pintvals);
       n = pa->num_strvals;
       pstrs = pa->pstrs;
       if (pstrs) {
           for (i = 0; i < n; i++, pstrs++) {
              if (*pstrs) free(*pstrs);
           }
           free(pa->pstrs);
       }
       free(pa);
    }
}

Here is the caller graph for this function:

Definition at line 280 of file component.c.

{
    IIIMCF_component_rec *pcom, *pcom2;

    pcom = ph->proot_component;
    while (pcom) {
       pcom2 = pcom->pnext;
       iiimcf_unregister_component(pcom);
       pcom = pcom2;
    }
    ph->proot_component = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file object.c.

{
    IIIMCF_downloaded_object_rec *po, *po2;

    for (po = ph->pdownloaded_objs; po; po = po2) {
       po2 = po->pnext;
       switch (po->pod->predefined_id) {
         case IIIMP_IMATTRIBUTE_BINARY_GUI_OBJECT:
         case IIIMP_IMATTRIBUTE_BINARY_LIGHT_WEIGHT_ENGINE_OBJECT:
         case IIIMP_IMATTRIBUTE_SCRIPT_GUI_OBJECT:
         case IIIMP_IMATTRIBUTE_SCRIPT_LIGHT_WEIGHT_ENGINE_OBJECT:
          if (po->v.str) free(po->v.str);
          break;
       }
       free(po);
    }
    
    return;
}

Here is the caller graph for this function:

Definition at line 480 of file aux.c.

{
    IIIMCF_auxevent *pae = pe->v.pauxevent;

    if (pae) {
       if (pae->name) free(pae->name);
       if (pae->pintvals) free(pae->pintvals);
       if (pae->pstrs) {
           int i;
           for (i = 0; i < pae->num_strvals; i++) {
              if (pae->pstrs[i]) free(pae->pstrs[i]);
           }
           free(pae->pstrs);
       }
       free(pae);
    }
}

Here is the caller graph for this function:

Definition at line 983 of file clientenv.c.

{
    if (penv->user_name) free(penv->user_name);
    if (penv->password) free(penv->password);
    if (penv->home_dir) free(penv->home_dir);
    if (penv->node) free(penv->node);
    if (penv->type) free(penv->type);
    if (penv->os_name) free(penv->os_name);
    if (penv->os_arch) free(penv->os_arch);
    if (penv->os_version) free(penv->os_version);
    if (penv->X_display_name) free(penv->X_display_name);
    if (penv->X_server_vendor) free(penv->X_server_vendor);
    if (penv->pconf)  iiimcf_client_config_free(penv->pconf);

    free(penv);
    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 254 of file event.c.

{
    int i;
    IIIMCF_event_rec **ppe;

    if (pc->ppevqueue) {
       for (ppe = pc->ppevqueue, i = 0; i < pc->evqueue_size; i++, ppe++) {
           if (*ppe) delete_event(*ppe);
       }
       free(pc->ppevqueue);
       pc->ppevqueue = pc->ppev_pro = pc->ppev_con = NULL;
       pc->evqueue_size = 0;
    }
#ifdef IIIMCF_EVENT_STACK
    if (pc->ppevstack) {
       for (ppe = ppevstack; ppe < pc->ppev_sp; ppe++) {
           if (*ppe) delete_event(*ppe);
       }
       free(pc->ppevstack);
       pc->ppevstack = pc->ppev_sp = NULL;
       pc->evstack_size = 0;
    }
#endif

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 294 of file lookup_choice.c.

{
    int i;
    IIIMCF_text_rec *plabels, *pcands;

    iiimcf_destruct_text(&pl->title);
    plabels = pl->plabels;
    pcands = pl->pcandidates;
    for (i = 0; i < pl->size; i++, plabels++, pcands++) {
       iiimcf_destruct_text(plabels);
       iiimcf_destruct_text(pcands);
    }
    free(pl->plabels);
    free(pl->pcandidates);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 115 of file text.c.

{
    if (pt->pu16) free(pt->pu16);
    if (pt->pv_mtext) EIMIL_destruct_value(pt->pv_mtext);
    memset(pt, 0, sizeof(*pt));

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 173 of file aux.c.

{
    IIIMCF_aux_rec *pa;
    IIIMP_aux_done_v *pimad;
    IIIMCF_event_rec *pe;

    ASSERT(pmes->opcode == IM_AUX_DONE);
    pimad = &pmes->v.aux_done;


    pa = create_aux_rec(pc,
                     pimad->input_method_name->len,
                     pimad->input_method_name->ptr,
                     pimad->class_index);
    if (!pa) return IIIMF_STATUS_MALLOC;
    pa->mode = 0;

    pe = create_aux_event(IIIMCF_EVENT_TYPE_AUX_DONE, pa);
    if (!pe) return IIIMF_STATUS_MALLOC;

    return iiimcf_store_event(pc, pe);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 66 of file iiimcf.c.

{
    if (!str) return NULL;
    return iiimcf_make_string(str, iiimcf_string_length(str));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 33 of file aux.c.

{
    IIIMCF_aux_rec *pa;
    IIIMP_aux_start_v *pimas;
    IIIMCF_event_rec *pe;

    ASSERT(pmes->opcode == IM_AUX_START);
    pimas = &pmes->v.aux_start;


    pa = create_aux_rec(pc,
                     pimas->input_method_name->len,
                     pimas->input_method_name->ptr,
                     pimas->class_index);
    if (!pa) return IIIMF_STATUS_MALLOC;
    pa->mode = 1;

    pe = create_aux_event(IIIMCF_EVENT_TYPE_AUX_START, pa);
    if (!pe) return IIIMF_STATUS_MALLOC;

    return iiimcf_store_event(pc, pe);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 331 of file context.c.

{
    IIIMF_status st;
    IIIMP_message *pmes = NULL;
    IIIMCF_handle_rec *ph = pc->ph;
    IIIMP_icattribute *picattr;

    st = create_iiimp_icattr(pc, &picattr);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    pmes = iiimp_createic_new(ph->data_s, ph->im_id, picattr);
    st = iiimcf_request_message(ph, pmes, NULL, IM_CREATEIC_REPLY, &pmes);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    pc->ic_id = pmes->ic_id;
    iiimp_message_delete(ph->data_s, pmes);
    st = add_context(ph, pc);

    /* restore conversion mode */
    if (IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_CONVERSION_MODE)) {
       st = iiimcf_forward_trigger_notify(pc, 1);
       if (st != IIIMF_STATUS_SUCCESS) {
           IIIMCF_RESET_STATE(pc, IIIMCF_CONTEXT_CONVERSION_MODE);
           return st;
       }
    }

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 888 of file iiimcf_file_operation.c.

{
    int i, ret = 0;
    IIIMP_message *preply;
    IIIMP_fcntl_reply *pfr;
    errno = 0;
    
    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pf->ns_id) {
           if ((ret = fcntl(ph->pns[i].nsc_fd, pf->cmd, pf->arg)) < 0) {
              pfr = iiimp_fcntl_reply_new(ph->data_s, pf->ns_id, errno, ret);
              preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, pfr);
              return iiimcf_send_message(ph, preply, 1);
           }
           break;
       }
    }
    pfr = iiimp_fcntl_reply_new(ph->data_s, pf->ns_id, errno, ret);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, pfr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 394 of file aux.c.

{
    IIIMF_status st;
    IIIMCF_handle_rec *ph = pc->ph;
    IIIMP_data_s *pds = ph->data_s;
    IIIMCF_auxevent *pae = pe->v.pauxevent;
    IIIMP_string *pimname, *pimstrs;
    IIIMP_card32_list *pimc32l;
    IIIMP_message *pmes;
    IIIMP_message *prepmes;

    pimname = NULL;
    pimc32l = NULL;
    pimstrs = NULL;

    pimname = iiimp_string_new(pds, iiimcf_string_length(pae->name), pae->name);
    if (!pimname) return IIIMF_STATUS_MALLOC;
    pimc32l = iiimp_card32_list_new(pds, pae->num_intvals, pae->pintvals);
    if (!pimc32l) goto memory_error;
    {
       int i;
       IIIMP_card16 **pstr;
       IIIMP_string *pimstr;

       for (i = 0, pstr = (pae->pstrs + pae->num_strvals - 1);
            i < pae->num_strvals;
            i++, pstr--) {
           pimstr = iiimp_string_new(pds, iiimcf_string_length(*pstr), *pstr);
           if (!pimstr) goto memory_error;
           pimstr->next = pimstrs;
           pimstrs = pimstr;
       }
    }
    pmes = iiimp_aux_getvalues_new(pds, ph->im_id, pc->ic_id,
                               pae->index, pimname, pimc32l,
                               pimstrs);
    if (!pmes) goto memory_error;

    prepmes = NULL;
    st = iiimcf_request_message(ph, pmes, pc, IM_AUX_GETVALUES_REPLY, &prepmes);

    if (prepmes)
    {
       st = iiimcf_update_aux_getvaluesreply(pc, prepmes);
       iiimp_message_delete(ph->data_s, prepmes);
    }

    return st;

memory_error:
    if (pimname) iiimp_string_delete(pds, pimname);
    if (pimc32l) iiimp_card32_list_delete(pds, pimc32l);
    if (pimstrs) iiimp_string_list_delete(pds, pimstrs);

    return IIIMF_STATUS_MALLOC;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 341 of file aux.c.

{
    IIIMF_status st;
    IIIMCF_handle_rec *ph = pc->ph;
    IIIMP_data_s *pds = ph->data_s;
    IIIMCF_auxevent *pae = pe->v.pauxevent;
    IIIMP_string *pimname, *pimstrs;
    IIIMP_card32_list *pimc32l;
    IIIMP_message *pmes;

    pimname = NULL;
    pimc32l = NULL;
    pimstrs = NULL;

    pimname = iiimp_string_new(pds, iiimcf_string_length(pae->name), pae->name);
    if (!pimname) return IIIMF_STATUS_MALLOC;
    pimc32l = iiimp_card32_list_new(pds, pae->num_intvals, pae->pintvals);
    if (!pimc32l) goto memory_error;
    {
       int i;
       IIIMP_card16 **pstr;
       IIIMP_string *pimstr;

       for (i = 0, pstr = (pae->pstrs + pae->num_strvals - 1);
            i < pae->num_strvals;
            i++, pstr--) {
           pimstr = iiimp_string_new(pds, iiimcf_string_length(*pstr), *pstr);
           if (!pimstr) goto memory_error;
           pimstr->next = pimstrs;
           pimstrs = pimstr;
       }
    }
    pmes = iiimp_aux_setvalues_new(pds, ph->im_id, pc->ic_id,
                               pae->index, pimname, pimc32l,
                               pimstrs);
    if (!pmes) goto memory_error;

    st = iiimcf_request_message(ph, pmes, pc, IM_AUX_SETVALUES_REPLY, NULL);

    return st;

memory_error:
    if (pimname) iiimp_string_delete(pds, pimname);
    if (pimc32l) iiimp_card32_list_delete(pds, pimc32l);
    if (pimstrs) iiimp_string_list_delete(pds, pimstrs);

    return IIIMF_STATUS_MALLOC;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_forward_hotkey_notify ( IIIMCF_context_rec pc,
int  hotkey_id,
int  ikev 
)

Definition at line 73 of file trigger.c.

{
    IIIMF_status st;
    IIIMCF_handle_rec *ph = pc->ph;
    IIIMP_data_s *pds = ph->data_s;
    IIIMP_message *pmes;

    pmes = iiimp_hotkey_notify_new(pds, ph->im_id, pc->ic_id, hotkey_id, ikev);
    if (!pmes) {
       return IIIMF_STATUS_MALLOC;
    }

    st = iiimcf_receive_hotkey_notify(pc);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimcf_request_message(ph, pmes, pc, IM_HOTKEY_NOTIFY_REPLY, NULL);

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 49 of file trigger.c.

{
    IIIMF_status st;
    IIIMCF_handle_rec *ph = pc->ph;
    IIIMP_data_s *pds = ph->data_s;
    IIIMP_message *pmes;

    pmes = iiimp_trigger_notify_new(pds, ph->im_id, pc->ic_id, flag ? 0 : 1);
    if (!pmes) {
       return IIIMF_STATUS_MALLOC;
    }

    st = iiimcf_receive_trigger_notify(pc, flag);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    st = iiimcf_request_message(ph, pmes, pc, IM_TRIGGER_NOTIFY_REPLY, NULL);

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 686 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_fstat_reply *pfr;
    struct stat buf;
    iiimp_stat_struct *im_buf;
    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pf->ns_id) {
           if ((ret = fstat(ph->pns[i].nsc_fd, &buf)) < 0) {
              pfr = iiimp_fstat_reply_new(ph->data_s, ret, errno, (iiimp_stat_struct *)NULL);
              preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_FSTAT_REPLY, pfr);
              return iiimcf_send_message(ph, preply, 1);
           } 
           im_buf = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));
           im_buf->s_mode = buf.st_mode;
           im_buf->s_nlink = buf.st_nlink;
           im_buf->s_uid = buf.st_uid;
           im_buf->s_gid = buf.st_gid;
           im_buf->s_atime = buf.st_atime;
           im_buf->s_mtime = buf.st_mtime;
           im_buf->s_ctime = buf.st_ctime;
           im_buf->s_blksize = buf.st_blksize;
    
           im_buf->s_dev = buf.st_dev;
           im_buf->s_rdev = buf.st_rdev;
           im_buf->s_ino = buf.st_ino;
           im_buf->s_size = buf.st_size;
           im_buf->s_blocks = buf.st_blocks;
    
           pfr = iiimp_fstat_reply_new(ph->data_s, pf->ns_id, errno, im_buf);
           preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_FSTAT_REPLY, pfr);
           return iiimcf_send_message(ph, preply, 1);
       }
    }
    return IIIMF_STATUS_FAIL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 951 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_ftruncate_reply *pfr;
    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pf->ns_id) {
           if ((ret = ftruncate(ph->pns[i].nsc_fd, pf->length)) < 0) {
              pfr = iiimp_ftruncate_reply_new(ph->data_s, ret, errno);
              preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_FTRUNCATE_REPLY, pfr);
              return iiimcf_send_message(ph, preply, 1);
           }
           pfr = iiimp_ftruncate_reply_new(ph->data_s, ret, errno);
           preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_FTRUNCATE_REPLY, pfr);
           return iiimcf_send_message(ph, preply, 1);
       }
    }
    return IIIMF_STATUS_FAIL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 135 of file event.c.

{
    IIIMCF_event_rec *pe;

    if (pc->ppev_con == pc->ppev_pro) return NULL;

    pe = *pc->ppev_con;

    if (removep) {
       *pc->ppev_con = NULL;
       if (pc->ppev_con == (pc->ppevqueue + pc->evqueue_size - 1))
           pc->ppev_con = pc->ppevqueue;
       else
           pc->ppev_con++;
    }

    return pe;
}

Here is the caller graph for this function:

Definition at line 75 of file iiimcf.c.

{
    THREAD_ID_OBJECT tid;

    THREAD_SET_CURRENT_ID(tid);
    if ((ph->thread_lock_count == 0)
       || (!THREAD_ID_EQUAL(ph->thread_owner_id, tid))) {
       LOCK_SYNC_OBJECT(ph->so);
       ASSERT(ph->thread_lock_count == 0);
       ph->thread_owner_id = tid;
    }
    ph->thread_lock_count++;
}

Definition at line 38 of file lookup_choice.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 12 of file lookup_choice.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 20 of file context.c.

{
    int i;
    IIIMCF_context_rec *pc;
    IIIMCF_context_rec **pptbl;

    pptbl = ph->ppcontext_table;
    i = ic_id % ph->context_table_size;

    for (pc = pptbl[i]; pc; pc = pc->pnext) {
       if (pc->ic_id == ic_id) return pc;
    }

    return NULL;
}

Here is the caller graph for this function:

Definition at line 768 of file iiimcf_file_operation.c.

{
    int i;
    off_t pos = (off_t) -1;
    IIIMP_message *preply;
    IIIMP_lseek_reply *plr;
    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pl->ns_id) {
           pos = lseek(ph->pns[i].nsc_fd, pl->offset, pl->whence);
            if (pos < 0) {
              plr = iiimp_lseek_reply_new(ph->data_s, pl->ns_id, errno, pos);
              preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_LSEEK_REPLY, plr);
              return iiimcf_send_message(ph, preply, 1);
            }
           break;
       }
    }
    plr = iiimp_lseek_reply_new(ph->data_s, pl->ns_id, errno, pos);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_LSEEK_REPLY, plr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 627 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_lstat_reply *plr;
    char path[PATH_MAX];
    char *dirname;
    struct stat buf;
    iiimp_stat_struct *im_buf;
    errno = 0;

    dirname = (char *)calloc((pl->path->len + 1), sizeof(char));

    for (i=0; i<pl->path->len; i++) {
        dirname[i] = pl->path->ptr[i];
    }
    dirname[i] = '\0';

    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
        snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = lstat(path, &buf)) < 0) {
        plr = iiimp_lstat_reply_new(ph->data_s, ret, errno, (iiimp_stat_struct *)NULL);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_LSTAT_REPLY, plr);
        return iiimcf_send_message(ph, preply, 1);
    }

    im_buf = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));

    im_buf->s_mode = buf.st_mode;
    im_buf->s_nlink = buf.st_nlink;
    im_buf->s_uid = buf.st_uid;
    im_buf->s_gid = buf.st_gid;
    im_buf->s_atime = buf.st_atime;
    im_buf->s_mtime = buf.st_mtime;
    im_buf->s_ctime = buf.st_ctime;
    im_buf->s_blksize = buf.st_blksize;

    im_buf->s_dev = buf.st_dev;
    im_buf->s_rdev = buf.st_rdev;
    im_buf->s_ino = buf.st_ino;
    im_buf->s_size = buf.st_size;
    im_buf->s_blocks = buf.st_blocks;

    plr = iiimp_lstat_reply_new(ph->data_s, pl->ns_id, errno, im_buf);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_LSTAT_REPLY, plr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMCF_event_rec* iiimcf_make_event ( IIIMCF_event_type  type)

Definition at line 223 of file event.c.

{
    IIIMCF_event_rec *pe;

    pe = (IIIMCF_event_rec*) malloc(sizeof(*pe));
    if (!pe) return NULL;

    memset(pe, 0, sizeof(*pe));
    pe->type = type;

    return pe;
}

Here is the caller graph for this function:

IIIMP_card16* iiimcf_make_string ( const IIIMP_card16 str,
int  len 
)

Definition at line 39 of file iiimcf.c.

{
    IIIMP_card16 *pu16;

    pu16 = (IIIMP_card16*) malloc(sizeof(*pu16) * (len + 1));
    if (!pu16) return NULL;
    if (len > 0)
       memcpy(pu16, str, sizeof(*pu16) * len);
    pu16[len] = 0;

    return pu16;
}

Here is the caller graph for this function:

Definition at line 442 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_mkdir_reply *pmr;
    char path[PATH_MAX];
    char *dirname;
    errno = 0;

    dirname = (char *)calloc((pm->path->len + 1), sizeof(char));
    for (i=0; i<pm->path->len; i++) {
        dirname[i] = pm->path->ptr[i];
    }
    dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
       snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = mkdir(path, pm->mode)) < 0) {
       pmr = iiimp_mkdir_reply_new(ph->data_s, ret, errno); 
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_MKDIR_REPLY, pmr);
       return iiimcf_send_message(ph, preply, 1);
    }
    pmr = iiimp_mkdir_reply_new(ph->data_s, pm->ns_id, errno); 
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_MKDIR_REPLY, pmr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 197 of file iiimcf_file_operation.c.

{
    IIIMF_status st_r = IIIMF_STATUS_SUCCESS;
    IIIMP_open_reply *por;
    IIIMP_message *preply;
    int ns_count;
    char path[PATH_MAX];
    int i;

    errno = 0;

    ns_count = ph->num_of_ns;

    if (!ns_count) {
       ph->pns = (IIIMCF_ns *) calloc(10, sizeof(IIIMCF_ns));
    } else if (ns_count > 10) {
       ph->pns = (IIIMCF_ns *) realloc((IIIMCF_ns *)ph->pns, (ns_count + 1) * sizeof(IIIMCF_ns));
    }
    if (!ph->pns) return IIIMF_STATUS_MALLOC;

    ph->pns[ns_count].ns_id = po->ns_id;

    ph->pns[ns_count].filename = (char *) calloc((po->filename->len + 1), sizeof(char));
    for(i=0; i<po->filename->len; i++) {
       ph->pns[ns_count].filename[i] = po->filename->ptr[i];
    }
    ph->pns[ns_count].filename[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(ph->pns[ns_count].filename, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, ph->pns[ns_count].filename);
    } else {
       snprintf(path, sizeof(path), "%s",ph->pns[ns_count].filename);
    }
    check_pathname(path);

    ph->pns[ns_count].nsc_fd = open(path, po->flags);
    if (ph->pns[ns_count].nsc_fd < 0) {
        por = iiimp_open_reply_new(ph->data_s, ph->pns[ns_count].nsc_fd, errno);
       preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_OPEN_REPLY, por); 
       st_r = iiimcf_send_message(ph, preply, 1);
       return st_r; 
    }
    ph->num_of_ns = ns_count + 1;

    por = iiimp_open_reply_new(ph->data_s, po->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_OPEN_REPLY, por); 
    st_r = iiimcf_send_message(ph, preply, 1);

    return st_r;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 326 of file iiimcf_file_operation.c.

{
    int i, ns_count, nitems, data_len;
    IIIMP_message *preply;
    IIIMP_opendir_reply *podr;
    char path[PATH_MAX];
    char buf[PATH_MAX];
    struct dirent *entry;
    IIIMP_utf8string *pstart, *pcurr, *pstr;
    char *to_utf8;
    size_t to_len;
    char *encoding;
    errno = 0;

    pstart = pcurr = pstr = NULL;

    ns_count = ph->num_of_ns;

    if (!ns_count) {
        ph->pns = (IIIMCF_ns *) calloc(10, sizeof(IIIMCF_ns));
    } else if (ns_count > 10) {
        ph->pns = (IIIMCF_ns *) realloc((IIIMCF_ns *)ph->pns, (ns_count + 1) * sizeof(IIIMCF_ns));
    }
    if (!ph->pns) return IIIMF_STATUS_MALLOC;

    ph->pns[ns_count].ns_id = pod->ns_id;

    ph->pns[ns_count].dirname = (char *) calloc((pod->dirname->len + 1), sizeof(char));
    for (i=0; i<pod->dirname->len; i++) {
        ph->pns[ns_count].dirname[i] = pod->dirname->ptr[i];
    }
    ph->pns[ns_count].dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(ph->pns[ns_count].dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, ph->pns[ns_count].dirname);
    } else {
       snprintf(path, sizeof(path), "%s",ph->pns[ns_count].dirname);
    }
    check_pathname(path);

    ph->pns[ns_count].nsc_dirp = (DIR *)NULL;
    ph->pns[ns_count].nsc_dirp = opendir(path);
    if (ph->pns[ns_count].nsc_dirp == NULL) {
       podr = iiimp_opendir_reply_new(ph->data_s, 0, errno, 0, NULL);
       preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_OPENDIR_REPLY, podr);
       return iiimcf_send_message(ph, preply, 1);
    }   
    i = 0;
    if (current_locale == NULL) {
       current_locale = (char *)strdup(setlocale(LC_CTYPE, NULL));
    }
    encoding = nl_langinfo(CODESET);
    if (!strcasecmp(encoding, "UTF-8") || !strcasecmp(encoding, "UTF8")) {
       skip_native_to_utf8_conv = True;
    }

    while ((entry = readdir(ph->pns[ns_count].nsc_dirp)) != NULL) {
       if (skip_native_to_utf8_conv) {
           (void) memset((char *)buf, '\0', sizeof(buf));
           snprintf(buf, sizeof(buf), "%s",entry->d_name);
           pstr = iiimp_utf8string_new(ph->data_s, entry->d_reclen, buf);
       }else {
           to_utf8 = (char *)calloc(1, sizeof(buf));
           to_len = PATH_MAX;
           (void) memset((char *)buf, '\0', sizeof(buf));
           snprintf(buf, sizeof(buf), "%s",entry->d_name);
           iiimcf_convert_NativeToUTF8(encoding, buf, entry->d_reclen, &to_utf8, &to_len);
           data_len = PATH_MAX - to_len;
           pstr = iiimp_utf8string_new(ph->data_s, data_len, to_utf8);
           free(to_utf8);
       }
       if (!pstr) {
           podr = iiimp_opendir_reply_new(ph->data_s, pod->ns_id, errno, 0, NULL);
           preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_OPENDIR_REPLY, podr);
           return iiimcf_send_message(ph, preply, 1);
       }
       if (!pstart) pstart = pstr;
       else pcurr->next = pstr;
       pcurr = pstr;
       i++;
    }
    nitems = i;
    podr = iiimp_opendir_reply_new(ph->data_s, pod->ns_id, errno, nitems, pstart);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_OPENDIR_REPLY, podr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 130 of file trigger.c.

{
    int found, i, j, k, m, n, hotkey_id, sflag, aflag, ikev;
    IIIMCF_keyevent *pkevl;
    IIIMF_status st = IIIMF_STATUS_SUCCESS;

    /* some older version of IIIMSF sends protocol version 3,
     * but not supported hotkey.
     */
    if (!pc->ph->phk_profile || pc->ph->curr_profile_id == -1)
      return iiimcf_process_trigger_keyevent(pc, pkev);

    k = 0;
    found = 0;
    while (k < pc->ph->num_of_hkprofiles) {
      if (pc->ph->phk_profile[k].profile_id == pc->ph->curr_profile_id) {
       found = 1;
       break;
      }
      k++;
    }
    if (found == 0)
      /* no valid hotkey profile is found, so use trigger key event */
      return iiimcf_process_trigger_keyevent(pc, pkev);

    m = pc->ph->phk_profile[k].num_hotkeys;
    for (i = 0; i < m; i++) {
       pkevl = pc->ph->phk_profile[k].phot_keys[i].keys;
       n = pc->ph->phk_profile[k].phot_keys[i].nkeys;
       for (j = 0; j < n; j++, pkevl++) {
           if (IIIMCF_IS_KEYEVENT_EQUAL(*pkev, *pkevl)) {
              hotkey_id = pc->ph->phk_profile[k].phot_keys[i].hotkey_id;
              sflag = pc->ph->phk_profile[k].phot_keys[i].state_flag;
              aflag = pc->ph->phk_profile[k].phot_keys[i].action_flag;
              ikev = j;
  
              if (IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_CONVERSION_MODE)) { /* Event Forwarding ON */
                  if (!sflag && !aflag) { 
                     st = iiimcf_forward_trigger_notify(pc, 0);
                     return st;
                  } else if (!sflag && aflag) {
                     IIIMCF_SET_STATE(pc, IIIMCF_CONTEXT_CONVERSION_MODE);
                     IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_CONVERSION_MODE_CHANGED);
                     st = iiimcf_forward_hotkey_notify(pc, hotkey_id, ikev);
                     return st;
                  } else {
                     return IIIMF_STATUS_NOT_TRIGGER_KEY;
                  }
              } else { /* Event Forwarding OFF */
                  if (!sflag) { /* if HOTKEY is valid */
                     if (aflag) { /* Action flag is Forward ON */
                         IIIMCF_SET_STATE(pc, IIIMCF_CONTEXT_CONVERSION_MODE);
                         IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_CONVERSION_MODE_CHANGED);
                         st = iiimcf_forward_hotkey_notify(pc, hotkey_id, ikev);
                         return st;
                     }
                  }
              } 
           }
       }
    }
    /* If it is not a HOTKEY */
    st = iiimcf_process_trigger_keyevent(pc, pkev);
    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 135 of file lookup_choice.c.

{
    IIIMCF_lookup_choice_rec *pl = &pc->lookup_choice;
    IIIMP_lookup_choice_process_v *plcp = &pmes->v.lookup_choice_process;
    ASSERT(pmes->opcode == IM_LOOKUP_CHOICE_PROCESS);

    if (plcp->type == IM_LOOKUP_CHOICE_PROCESS_INDEX) {
       int ridx, ridx_o;

       if (!((plcp->value >= pl->idx_first) || (plcp->value <= pl->idx_last)))
           return IIIMF_STATUS_SUCCESS;  /* Invalid index.  Simply ignore it. */
       ridx = plcp->value - pl->idx_first;
       if (ridx >= pl->size) 
           return IIIMF_STATUS_SUCCESS;  /* Invalid index.  Simply ignore it. */
       ridx_o = pl->idx_current - pl->idx_first;
       if ((ridx_o >= 0) && (ridx_o < pl->size)) {
           pl->pflags[ridx_o] &= ~IIIMCF_LOOKUP_CHOICE_SELECTED_ITEM;
       }
       pl->pflags[ridx] |= IIIMCF_LOOKUP_CHOICE_SELECTED_ITEM;
       pl->idx_current = ridx;
    } else if (plcp->type == IM_LOOKUP_CHOICE_PROCESS_PAGE) {
       int st = pl->enabled_range_start;
       int end = pl->enabled_range_end;
       switch (plcp->value) {
         case IM_LOOKUP_CHOICE_PROCESS_PAGE_NEXT_PAGE:
          st += pl->choices_per_window;
          if (st >= pl->size) return IIIMF_STATUS_SUCCESS; /* ignore */
          end += pl->choices_per_window;
          break;
         case IM_LOOKUP_CHOICE_PROCESS_PAGE_PREV_PAGE:
          st -= pl->choices_per_window;
          end -= pl->choices_per_window;
          if (end <= 0) return IIIMF_STATUS_SUCCESS; /* ignore */
          break;
         case IM_LOOKUP_CHOICE_PROCESS_PAGE_FIRST_PAGE:
          st = 0;
          end = pl->choices_per_window;
          break;
         case IM_LOOKUP_CHOICE_PROCESS_PAGE_LAST_PAGE:
          st = pl->size - pl->choices_per_window;
          end = pl->size;
          break;
         default:
          return IIIMF_STATUS_SUCCESS;
       }

       if (st < 0) st = 0;
       else if (st >= pl->size) st = pl->size - 1;

       if (end < 0) end = 0;
       else if (end < st) end = st;
       else if (end > pl->size) end = pl->size;

       pl->enabled_range_start = st;
       pl->enabled_range_end = end;
    } else {
       return IIIMF_STATUS_SUCCESS;
    }
    
    IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_LOOKUP_CHOICE_CHANGED);

    return iiimcf_store_simple_event(pc, IIIMCF_EVENT_TYPE_UI_LOOKUP_CHOICE_CHANGE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 86 of file message.c.

{
    IIIMF_status st = IIIMF_STATUS_SUCCESS;
    IIIMF_status st_r = IIIMF_STATUS_SUCCESS;
    IIIMP_message *preply;
    IIIMCF_context_rec *pc;

    if (pmes->ic_id >= 0) {
       pc = iiimcf_lookup_context(ph, pmes->ic_id);
       if (!pc) {
            iiimp_message_delete(ph->data_s, pmes);
            return IIIMF_STATUS_IC_INVALID;
        }
    } else {
       pc = NULL;
    }
    switch (pmes->opcode) {
      case IM_CONNECT_REPLY:
       if (ph->im_id >= 0)
          return IIIMF_STATUS_SEQUENCE_STATE;
       ph->im_id = pmes->im_id;
       break;

      case IM_PROTOCOL_VERSION:
       ph->server_protocol_version = pmes->v.protocol_version.number;
       ph->num_of_hkprofiles = 0;
       ph->num_of_ns = 0;
       ph->num_of_nsl = 0;
       ph->curr_profile_id = -1;
       break;

      case IM_REGISTER_TRIGGER_KEYS:
       st = iiimcf_register_trigger_keys(ph, pmes);
       break;

      case IM_REGISTER_HOTKEYS:
       st = iiimcf_register_hotkeys(ph, pmes);
       break;

      case IM_TRIGGER_NOTIFY:
       if (pmes->v.trigger_notify.flag == 0)
          st = iiimcf_receive_trigger_notify(pc, 1);
       else
          st = iiimcf_receive_trigger_notify(pc, 0);

       preply = iiimp_trigger_notify_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_HOTKEY_NOTIFY:
       st = iiimcf_receive_hotkey_notify(pc);

       preply = iiimp_hotkey_notify_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_HOTKEY_STATE_NOTIFY:
       if (pmes->v.hotkey_state_notify.current_state_flag) {
           st = iiimcf_receive_trigger_notify(pc, 1);
       } else {
           st = iiimcf_receive_trigger_notify(pc, 0);
       }

       /*
        preply = iiimp_hotkey_state_notify_reply_new(ph->data_s, ph->im_id, pc->ic_id);
        st_r = iiimcf_reply_message(ph, preply);
       */
       break;

      case IM_SELECT_HOTKEY_PROFILE:
       ph->curr_scope = pmes->v.select_hotkey_profile.scope;
       ph->curr_profile_id = pmes->v.select_hotkey_profile.profile_id;

       /* maybe we sould reply this message */
       break;

      case IM_FILE_OPERATION:
       st = iiimcf_perform_file_operation(ph, pmes);
       break;

      case IM_FORWARD_EVENT:
       st = iiimcf_receive_forwarded_event(pc, pmes);
       preply = iiimp_forward_event_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_FORWARD_EVENT_WITH_OPERATIONS:
       st_r = iiimcf_reply_to_foward_event_with_operations(pc, pmes);
       break;

      case IM_PREEDIT_START:
       st = iiimcf_toggle_preedit(pc, 1);
       preply = iiimp_preedit_start_reply_new(ph->data_s, ph->im_id, pc->ic_id, -1);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_PREEDIT_DRAW:
       st = iiimcf_update_preedit(pc, pmes);
       preply = iiimp_preedit_draw_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_PREEDIT_DONE:
       st = iiimcf_toggle_preedit(pc, 0);
       preply = iiimp_preedit_done_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_STATUS_START:
       st = iiimcf_toggle_status(pc, 1);
       preply = iiimp_status_start_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_STATUS_DRAW:
       st = iiimcf_update_status(pc, pmes);
       preply = iiimp_status_draw_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_STATUS_DONE:
       st = iiimcf_toggle_status(pc, 0);
       preply = iiimp_status_done_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_LOOKUP_CHOICE_START:
       st = iiimcf_lookup_choice_start(pc, pmes);
       preply = iiimp_lookup_choice_start_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_LOOKUP_CHOICE_DRAW:
       st = iiimcf_update_lookup_choice(pc, pmes);
       preply = iiimp_lookup_choice_draw_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_LOOKUP_CHOICE_PROCESS:
       st = iiimcf_process_lookup_choice(pc, pmes);
       preply = iiimp_lookup_choice_process_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
      case IM_LOOKUP_CHOICE_DONE:
       st = iiimcf_lookup_choice_done(pc);
       preply = iiimp_lookup_choice_done_reply_new(ph->data_s, ph->im_id, pc->ic_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;

      case IM_AUX_START:
       st = iiimcf_enable_aux(pc, pmes);
       st_r = iiimcf_reply_aux_message(ph, pmes);
       break;
      case IM_AUX_DRAW:
       st = iiimcf_update_aux_draw(pc, pmes);
       st_r = iiimcf_reply_aux_message(ph, pmes);
       break;
      case IM_AUX_DONE:
       st = iiimcf_disable_aux(pc, pmes);
       st_r = iiimcf_reply_aux_message(ph, pmes);
       break;

      case IM_COMMIT_STRING:
       st = iiimcf_commit_string(pc, pmes);
       break;

      case IM_SETIMVALUES:
       st = iiimcf_setimvalues(ph, pmes);
       preply = iiimp_setimvalues_reply_new(ph->data_s, ph->im_id);
       st_r = iiimcf_reply_message(ph, preply);
       break;
    }

    iiimp_message_delete(ph->data_s, pmes);
    if (st_r != IIIMF_STATUS_SUCCESS) return st_r;

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file trigger.c.

{
    int i, n;
    IIIMCF_keyevent *pkevl;
    IIIMF_status st = IIIMF_STATUS_SUCCESS;

    if (IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_CONVERSION_MODE)) {
       n = pc->ph->num_off_keys;
       pkevl = pc->ph->poff_keys;
       for (i = 0; i < n; i++, pkevl++) {
           if (IIIMCF_IS_KEYEVENT_EQUAL(*pkev, *pkevl)) {
              st = iiimcf_forward_trigger_notify(pc, 0);
              return st;
           }
       }
    } else {
       n = pc->ph->num_on_keys;
       pkevl = pc->ph->pon_keys;
       for (i = 0; i < n; i++, pkevl++) {
           if (IIIMCF_IS_KEYEVENT_EQUAL(*pkev, *pkevl)) {
              st = iiimcf_forward_trigger_notify(pc, 1);
              return st;
           }
       }
    }
    return IIIMF_STATUS_NOT_TRIGGER_KEY;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 252 of file iiimcf_file_operation.c.

{
    IIIMP_read_reply *prr;
    IIIMP_message *preply;
    int i;
    void *ptr;
    int nread = -1;

    errno = 0;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pr->ns_id) {
           ptr = (char *) calloc(pr->size + 1, sizeof(char));
           nread = read(ph->pns[i].nsc_fd, ptr, pr->size);
            prr = iiimp_read_reply_new(ph->data_s, pr->ns_id, nread, errno, ptr); 
           preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_READ_REPLY, prr);
           return iiimcf_send_message(ph, preply, 1);
       }
    } 
    return IIIMF_STATUS_FAIL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 545 of file event.c.

{
    IIIMF_status st;
    IIIMP_contents *pcon = pmes->v.forward_event.contents;
    ASSERT(pmes->opcode == IM_FORWARD_EVENT);

    switch (pcon->type) {
      case IIIMP_CONTENTS_KEYEVENT:
      {
         int i, n;
         IIIMCF_event_rec *pev;
         IIIMCF_keyevent kev;
         IIIMP_keyevent_list *pkl = pcon->value.keyevent_list;
         IIIMP_keyevent *pimkev = pkl->keyevent;
         
         n = pkl->count;
         for (i = 0; i < n; i++, pimkev++) {
             kev.keycode = pimkev->keycode;
             kev.keychar = pimkev->keychar;
             kev.modifier = pimkev->modifier;
             kev.time_stamp = pimkev->time_stamp;
             st = iiimcf_create_keyevent(&kev, (IIIMCF_event*) &pev);
             if (st != IIIMF_STATUS_SUCCESS) return st;
             st = iiimcf_store_event(pc, pev);
             if (st != IIIMF_STATUS_SUCCESS) {
                    delete_event(pev);
                    return st;
             }
         }
      }

      case IIIMP_CONTENTS_STRING:
      case IIIMP_CONTENTS_TEXT:
       /* currently ignore */
       break;
      default:
       abort();
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 36 of file trigger.c.

{
    IIIMCF_event event;
    IIIMF_status st;

    st = iiimcf_create_hotkey_notify_event(&event);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    return iiimcf_store_event(pc, (IIIMCF_event_rec*) event);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 657 of file iiimcf.c.

{
    IIIMF_status st;

    st = iiimf_stream_receive(ph->pstream, ph->data_s, ppmes);

    if (st == IIIMF_STATUS_SUCCESS) {
       if ((ph->im_id >= 0) && ((*ppmes)->im_id != ph->im_id)) {
           iiimp_message_delete(ph->data_s, *ppmes);
           *ppmes = NULL;
           return IIIMF_STATUS_IM_INVALID;
       }
       return IIIMF_STATUS_SUCCESS;
    }

    if ((st == IIIMF_STATUS_CONNECTION_CLOSED)
       || (st == IIIMF_STATUS_STREAM_RECEIVE)) {
       iiimcf_hungup(ph);
    }

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 8 of file trigger.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 270 of file iiimcf.c.

{
    int i, j, n, n_hkp, n_hotkeys;
    HOTKEY_LIST *hklist;
    IIIMCF_hotkey *hk;
    IIIMCF_keyevent *pkev;
    IIIMP_keyevent *pimk;

    IIIMP_register_hotkeys_v *pimrk = &pmes->v.register_hotkeys;

    ASSERT(pmes->opcode == IM_REGISTER_HOTKEYS);

    n_hkp = ph->num_of_hkprofiles;
    hklist = pimrk->hotkeys;
    n_hotkeys = pimrk->hotkeys->count;

    if (!n_hkp) {
      ph->phk_profile = (IIIMCF_hotkey_profile *) malloc(10 * sizeof(IIIMCF_hotkey_profile));
      memset(ph->phk_profile, 0, 10 * sizeof(IIIMCF_hotkey_profile));
    } else if (n_hkp > 10) {
      ph->phk_profile = (IIIMCF_hotkey_profile *) realloc((IIIMCF_hotkey_profile *)ph->phk_profile, (n_hkp + 1) * sizeof(IIIMCF_hotkey_profile));
    }
    if (!ph->phk_profile) return IIIMF_STATUS_MALLOC;
    ph->phk_profile[n_hkp].scope = pimrk->scope;
    ph->phk_profile[n_hkp].profile_id = pimrk->profile_id;

    if (n_hotkeys > 0) {
       hk = (IIIMCF_hotkey *) malloc(sizeof(IIIMCF_hotkey) * n_hotkeys);
       if (!hk) return IIIMF_STATUS_MALLOC;
        ph->phk_profile[n_hkp].phot_keys = hk;

       for(i=0; i<n_hotkeys; i++) {
           IIIMP_string *label = hklist->hotkey[i].label;
           char *pc;
           IIIMP_card16 *pu;

           hk[i].hotkey_id = hklist->hotkey[i].hotkeyctrl.hotkey_id;
           hk[i].state_flag = hklist->hotkey[i].hotkeyctrl.state_flag;
           hk[i].action_flag = hklist->hotkey[i].hotkeyctrl.action_flag;

           /* copy label from IIIMP_string* to char* */
           hk[i].hotkey_label = (char *)malloc (label->len + 1);
           memset (hk[i].hotkey_label, 0, label->len + 1);
           for (j = 0, pu = label->ptr, pc = hk[i].hotkey_label; j < label->len; ++j)
             *pc++ = (*pu++ & 0x7f);

           n = hklist->hotkey[i].hotkeylist->count;
           if (n > 0) {
              pkev = (IIIMCF_keyevent*) malloc(sizeof(IIIMCF_keyevent) * n);
              if (!pkev) return IIIMF_STATUS_MALLOC;

              hk[i].keys = pkev;
              pimk = hklist->hotkey[i].hotkeylist->keyevent;
              for (j = 0; j < n; j++, pkev++, pimk++) {
                  pkev->keycode = pimk->keycode;
                  pkev->keychar = pimk->keychar;
                  pkev->modifier = pimk->modifier;
                  pkev->time_stamp = pimk->time_stamp;
              }
              hk[i].nkeys = j;
           }
       }
        ph->phk_profile[n_hkp].num_hotkeys = n_hotkeys;
    }
    ph->num_of_hkprofiles = n_hkp + 1; 
    return IIIMF_STATUS_SUCCESS;
}

Here is the caller graph for this function:

Definition at line 183 of file input-method.c.

{
    IIIMF_status st;
    int i, n;
    IIIMP_inputmethod_descriptor *pimd;
    IIIMCF_input_method_rec **ppi, *pi;

    iiimcf_unregister_input_method_list(ph->num_input_methods,
                                   ph->ppinput_methods);

    ph->ppinput_methods = NULL;
    ph->num_input_methods = 0;

    for (n = 0, pimd = piiimp_imlist; pimd; pimd = pimd->next) n++;

    ppi = (IIIMCF_input_method_rec**) malloc(sizeof(*ppi) * n);
    if (!ppi) return IIIMF_STATUS_MALLOC;
    memset(ppi, 0, sizeof(*ppi) * n);

    for (i = 0, pimd = piiimp_imlist;
        i < n; i++, pimd = pimd->next) {
       pi = (IIIMCF_input_method_rec*) malloc(sizeof(*pi));
       if (!pi) {
           iiimcf_unregister_input_method_list(n, ppi);
           return IIIMF_STATUS_MALLOC;
       }
       memset(pi, 0, sizeof(*pi));
       ppi[i] = pi;
       pi->id = pimd->id;
       pi->imname = iiimcf_make_string(pimd->idname->ptr, pimd->idname->len);
       pi->hrn = iiimcf_make_string(pimd->hrn->ptr, pimd->hrn->len);
       pi->domain = iiimcf_make_string(pimd->rdun->ptr, pimd->rdun->len);
       if ((!pi->imname) || (!pi->hrn)) {
           iiimcf_unregister_input_method_list(n, ppi);
           return IIIMF_STATUS_MALLOC;
       }
       st = iiimcf_register_input_method_langs(pimd->language,
                                          &pi->num_langs,
                                          &pi->pplangs);
       if (st != IIIMF_STATUS_SUCCESS) {
           iiimcf_unregister_input_method_list(n, ppi);
           return st;
       }
        st = iiimcf_register_input_method_imeinfos(pimd->imeinfo,
                                                &pi->num_imeinfos,
                                                &pi->ppimeinfos);
        if (st != IIIMF_STATUS_SUCCESS) {
            iiimcf_unregister_input_method_list(n, ppi);
            return st;
        }
    }

    ph->num_input_methods = n;
    ph->ppinput_methods = ppi;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 272 of file component.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 212 of file iiimcf.c.

{
    int i, n;
    IIIMP_keyevent_list *pimkl;
    IIIMP_keyevent *pimk;
    IIIMCF_keyevent *pkev;
    IIIMP_register_trigger_keys_v *pimrk = &pmes->v.register_trigger_keys;
    ASSERT(pmes->opcode == IM_REGISTER_TRIGGER_KEYS);

    pimkl = pimrk->trigger_on;
    n = pimkl->count;
    if (n > 0) {
       pkev = (IIIMCF_keyevent*) malloc(sizeof(IIIMCF_keyevent) * n);
       if (!pkev) return IIIMF_STATUS_MALLOC;

       if (ph->pon_keys) free(ph->pon_keys);
       ph->pon_keys = pkev;
       pimk = pimkl->keyevent;
       for (i = 0; i < n; i++, pkev++, pimk++) {
           pkev->keycode = pimk->keycode;
           pkev->keychar = pimk->keychar;
           pkev->modifier = pimk->modifier;
           pkev->time_stamp = pimk->time_stamp;
       }

       ph->num_on_keys = i;
    }

    pimkl = pimrk->trigger_off;
    n = pimkl->count;
    if (n > 0) {
       pkev = (IIIMCF_keyevent*) malloc(sizeof(IIIMCF_keyevent) * n);
       if (!pkev) {
           if (ph->pon_keys) free(ph->pon_keys);
           ph->num_on_keys = 0;
           return IIIMF_STATUS_MALLOC;
       }

       if (ph->poff_keys) free(ph->poff_keys);
       ph->poff_keys = pkev;
       pimk = pimkl->keyevent;
       for (i = 0; i < n; i++, pkev++, pimk++) {
           pkev->keycode = pimk->keycode;
           pkev->keychar = pimk->keychar;
           pkev->modifier = pimk->modifier;
           pkev->time_stamp = pimk->time_stamp;
       }

       ph->num_off_keys = i;
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the caller graph for this function:

Definition at line 833 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_rename_reply *prr;
    char old_buf[PATH_MAX];
    char new_buf[PATH_MAX];
    char *old_name;
    char *new_name;
    errno = 0;

    old_name = (char *)calloc((pr->old_name->len + 1), sizeof(char));
    for (i=0; i<pr->old_name->len; i++) {
        old_name[i] = pr->old_name->ptr[i];
    }
    old_name[i] = '\0';
    (void) memset((char *)old_buf, '\0', sizeof(old_buf));
    if (strstr(old_name, ".iiim")) {
       snprintf(old_buf, sizeof(old_buf), "%s/%s",ph->penv->home_dir, old_name);
    } else {
       snprintf(old_buf, sizeof(old_buf), "%s",old_name);
    }
    check_pathname(old_buf);

    new_name = (char *)calloc((pr->new_name->len + 1), sizeof(char));
    for (i=0; i<pr->new_name->len; i++) {
        new_name[i] = pr->new_name->ptr[i];
    }
    new_name[i] = '\0';
    (void) memset((char *)new_buf, '\0', sizeof(new_buf));
    snprintf(new_buf, sizeof(new_buf), "%s",new_name);
    if (strstr(new_name, ".iiim")) {
       snprintf(new_buf, sizeof(new_buf), "%s/%s",ph->penv->home_dir, new_name);
    } else {
       snprintf(new_buf, sizeof(new_buf), "%s",new_name);
    }
    check_pathname(new_buf);
    free(old_name);
    free(new_name);

    if ((ret = rename(old_buf, new_buf)) < 0) {
        prr = iiimp_rename_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, prr);
        return iiimcf_send_message(ph, preply, 1);
    }

    prr = iiimp_rename_reply_new(ph->data_s, pr->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, prr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_request_message ( IIIMCF_handle_rec ph,
IIIMP_message pmes,
IIIMCF_context_rec pc,
int  opcode,
IIIMP_message **  ppmes 
)

Definition at line 316 of file message.c.

{
    IIIMF_status st;

    IIIMCF_LOCK_HANDLE(ph);

    /* By other threads, IC may be invalidated.
       So check it first because valid IC is indispensable
       for reply message.  */
    if (pc && IIIMCF_IS_IC_INVALID(pc)) {
        iiimp_message_delete(ph->data_s, pmes);
       IIIMCF_UNLOCK_HANDLE(ph);
       return IIIMF_STATUS_IC_INVALID;
    }

    if (!IIIMCF_IS_CONNECTED(ph)) {
       if (ph->disable_automatic_connection_restoration) {
            iiimp_message_delete(ph->data_s, pmes);
            IIIMCF_UNLOCK_HANDLE(ph);
           return IIIMF_STATUS_CONNECTION_CLOSED;
        }

       st = iiimcf_connect(ph);
       if (st != IIIMF_STATUS_SUCCESS) {
            iiimp_message_delete(ph->data_s, pmes);
           IIIMCF_UNLOCK_HANDLE(ph);
           return st;
       }
    }

    st = iiimcf_send_message(ph, pmes, 1);
    if (st == IIIMF_STATUS_SUCCESS) {
       st = iiimcf_wait_message(ph, NULL, opcode, ppmes);
    }
    IIIMCF_UNLOCK_HANDLE(ph);

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 479 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_rmdir_reply *prr;
    char path[PATH_MAX];
    char *dirname;
    errno = 0;

    dirname = (char *)calloc((pr->path->len + 1), sizeof(char));
    for (i=0; i<pr->path->len; i++) {
        dirname[i] = pr->path->ptr[i];
    }
    dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
       snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);
    
    if ((ret = rmdir(path)) < 0) {
        prr = iiimp_rmdir_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RMDIR_REPLY, prr);
        return iiimcf_send_message(ph, preply, 1);
    }
    prr = iiimp_rmdir_reply_new(ph->data_s, pr->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RMDIR_REPLY, prr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_send_message ( IIIMCF_handle_rec ph,
IIIMP_message pmes,
int  deletep 
)

Definition at line 634 of file iiimcf.c.

{
    IIIMF_status st;

    st = iiimf_stream_send(ph->pstream, ph->data_s, pmes);
    if (deletep) iiimp_message_delete(ph->data_s, pmes);

    if (st == IIIMF_STATUS_SUCCESS)
       return IIIMF_STATUS_SUCCESS;

    if ((st == IIIMF_STATUS_CONNECTION_CLOSED)
       || (st == IIIMF_STATUS_STREAM_SEND)) {
       iiimcf_hungup(ph);
    }

    return st;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 402 of file iiimcf.c.

{
    IIIMF_status st;
    IIIMP_imattribute *pimattrs;
    ASSERT(pmes->opcode == IM_SETIMVALUES);

    for (pimattrs = pmes->v.setimvalues.attr_list;
        pimattrs;
        pimattrs = pimattrs->next) {
       switch (pimattrs->id_pre) {
         case IIIMP_IMATTRIBUTE_INPUT_METHOD_LIST:
          st = iiimcf_register_input_method_list(ph, pimattrs->value.inputmethod_descriptor);
          if (st != IIIMF_STATUS_SUCCESS) return st;
          break;

         case IIIMP_IMATTRIBUTE_OBJECT_DESCRIPTOR_LIST:
          st = iiimcf_register_object_descriptor_list(ph, pimattrs->value.object_descriptor);
          if (st != IIIMF_STATUS_SUCCESS) return st;
          break;

         default:
          /* simply ignore */
          break;
       }
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 569 of file iiimcf_file_operation.c.

{   
    int i, ret;
    IIIMP_message *preply;
    IIIMP_stat_reply *psr;
    char path[PATH_MAX];
    char *dirname; 
    struct stat buf;
    iiimp_stat_struct *im_buf;
    errno = 0;
    
    dirname = (char *)calloc((ps->path->len + 1), sizeof(char));

    for (i=0; i<ps->path->len; i++) {
        dirname[i] = ps->path->ptr[i];
    }
    dirname[i] = '\0';

    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
        snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = stat(path, &buf)) < 0) {
        psr = iiimp_stat_reply_new(ph->data_s, ret, errno, (iiimp_stat_struct *)NULL);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_STAT_REPLY, psr);
        return iiimcf_send_message(ph, preply, 1);
    }
    im_buf = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));

    im_buf->s_mode = buf.st_mode;
    im_buf->s_nlink = buf.st_nlink;
    im_buf->s_uid = buf.st_uid;
    im_buf->s_gid = buf.st_gid;
    im_buf->s_atime = buf.st_atime;
    im_buf->s_mtime = buf.st_mtime;
    im_buf->s_ctime = buf.st_ctime;
    im_buf->s_blksize = buf.st_blksize;

    im_buf->s_dev = buf.st_dev;
    im_buf->s_rdev = buf.st_rdev;
    im_buf->s_ino = buf.st_ino;
    im_buf->s_size = buf.st_size;
    im_buf->s_blocks = buf.st_blocks;

    psr = iiimp_stat_reply_new(ph->data_s, ps->ns_id, errno, im_buf);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_STAT_REPLY, psr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 108 of file event.c.

{
    int size = pc->evqueue_size;

    if ((!pc->ppevqueue)
       || ((pc->ppev_pro + 1) == pc->ppev_con)) {
       if (!expand_event_queue(pc))
           return IIIMF_STATUS_MALLOC;
    }
    *pc->ppev_pro = pe;
    pc->ppev_pro++;
    if (pc->ppev_pro == pc->ppevqueue + size) {
       if (pc->ppev_con == pc->ppevqueue) {
           if (!expand_event_queue(pc))
              return IIIMF_STATUS_MALLOC;
       } else {
           pc->ppev_pro = pc->ppevqueue;
       }
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_store_simple_event ( IIIMCF_context_rec pc,
IIIMCF_event_type  type 
)

Definition at line 239 of file event.c.

{
    IIIMCF_event_rec *pe;

    pe = iiimcf_make_event(type);
    if (!pe) return IIIMF_STATUS_MALLOC;

    return iiimcf_store_event(pc, pe);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiimcf_string_length ( const IIIMP_card16 str)

Definition at line 56 of file iiimcf.c.

{
    int i;
    for (i = 0; *str; str++) i++;
    return i;
}

Here is the caller graph for this function:

Definition at line 516 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_symlink_reply *psr;
    char dest_path[PATH_MAX];
    char src_path[PATH_MAX];
    char *dest;
    char *src;
    errno = 0;

    dest = (char *)calloc((ps->dest->len + 1), sizeof(char));
    for (i=0; i<ps->dest->len; i++) {
        dest[i] = ps->dest->ptr[i];
    }
    dest[i] = '\0';
    (void) memset((char *)dest_path, '\0', sizeof(dest_path));
    if (strstr(dest, ".iiim")) {
       snprintf(dest_path, sizeof(dest_path), "%s/%s",ph->penv->home_dir, dest);
    } else {
       snprintf(dest_path, sizeof(dest_path), "%s",dest);
    }
    check_pathname(dest_path);

    src = (char *)calloc((ps->src->len + 1), sizeof(char));
    for (i=0; i<ps->src->len; i++) {
        src[i] = ps->src->ptr[i];
    }
    src[i] = '\0';
    (void) memset((char *)src_path, '\0', sizeof(src_path));
    if (strstr(src, ".iiim")) {
       snprintf(src_path, sizeof(src_path), "%s/%s",ph->penv->home_dir, src);
    } else {
       snprintf(src_path, sizeof(src_path), "%s",src);
    }
    check_pathname(src_path);
    free(dest);
    free(src);

    if ((ret = symlink(dest_path, src_path)) < 0) {
        psr = iiimp_symlink_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_SYMLINK_REPLY, psr);
        return iiimcf_send_message(ph, preply, 1);
    }
    psr = iiimp_symlink_reply_new(ph->data_s, ps->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_SYMLINK_REPLY, psr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 914 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_truncate_reply *ptr;
    char path[PATH_MAX];
    char *dirname;
    errno = 0;

    dirname = (char *)calloc((pt->path->len + 1), sizeof(char));
    for (i=0; i<pt->path->len; i++) {
        dirname[i] = pt->path->ptr[i];
    }
    dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
       snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = truncate(path, pt->length)) < 0) {
        ptr = iiimp_truncate_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, ptr);
        return iiimcf_send_message(ph, preply, 1);
    }
    ptr = iiimp_truncate_reply_new(ph->data_s, ret, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_RENAME_REPLY, ptr);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 796 of file iiimcf_file_operation.c.

{
    int i, ret;
    IIIMP_message *preply;
    IIIMP_unlink_reply *pur;
    char path[PATH_MAX];
    char *dirname;
    errno = 0;

    dirname = (char *)calloc((pu->path->len + 1), sizeof(char));
    for (i=0; i<pu->path->len; i++) {
        dirname[i] = pu->path->ptr[i];
    }
    dirname[i] = '\0';
    (void) memset((char *)path, '\0', sizeof(path));
    if (strstr(dirname, ".iiim")) {
       snprintf(path, sizeof(path), "%s/%s",ph->penv->home_dir, dirname);
    } else {
       snprintf(path, sizeof(path), "%s",dirname);
    }
    check_pathname(path);
    free(dirname);

    if ((ret = unlink(path)) < 0) {
        pur = iiimp_unlink_reply_new(ph->data_s, ret, errno);
        preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_UNLINK_REPLY, pur);
        return iiimcf_send_message(ph, preply, 1);
    }
    pur = iiimp_unlink_reply_new(ph->data_s, pu->ns_id, errno);
    preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_UNLINK_REPLY, pur);
    return iiimcf_send_message(ph, preply, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 92 of file iiimcf.c.

{
    THREAD_ID_OBJECT tid;

    THREAD_SET_CURRENT_ID(tid);

    ASSERT(THREAD_ID_EQUAL(ph->thread_owner_id, tid));
    ASSERT(ph->thread_lock_count > 0);
    ph->thread_lock_count--;
    if (ph->thread_lock_count == 0) {
       UNLOCK_SYNC_OBJECT(ph->so);
    }
}

Definition at line 22 of file input-method.c.

{
    IIIMCF_input_method_rec **pp, *p;
    int i;

    if (!ppi) return IIIMF_STATUS_FAIL;
    for (pp = ppi, i = 0; i < n; i++, pp++) {
       p = *pp;
       if (p) {
           if (p->imname) free(p->imname);
           if (p->hrn) free(p->hrn);
           if (p->domain) free(p->domain);
           if (p->pplangs) iiimcf_unregister_langs(p->num_langs, p->pplangs);
            if (p->ppimeinfos) iiimcf_unregister_imeinfos(p->num_imeinfos, p->ppimeinfos);
           free(p);
       }
    }
    free(ppi);
    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void iiimcf_unregister_langs ( int  n,
IIIMCF_language_rec **  ppl 
)

Definition at line 114 of file iiimcf.c.

{
    IIIMCF_language_rec **pp, *p;
    int i;

    if (!ppl) return;
    for (pp = ppl, i = 0; i < n; i++, pp++) {
       p = *pp;
       if (p) {
           if (p->lang_id) free(p->lang_id);
           if (p->hrn) free(p->hrn);
           free(p);
       }
    }
    free(ppl);
}

Here is the caller graph for this function:

Definition at line 153 of file aux.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 52 of file lookup_choice.c.

{
    int i, nc, nl;
    int flag, *pflags;
    IIIMF_status st;
    IIIMP_text *pimt;
    IIIMCF_text_rec *ptr;
    IIIMCF_lookup_choice_rec *pl = &pc->lookup_choice;
    IIIMP_lookup_choice_draw_v *plcd = &pmes->v.lookup_choice_draw;
    ASSERT(pmes->opcode == IM_LOOKUP_CHOICE_DRAW);

    st = iiimcf_convert_iiimp_text_to_text(plcd->title, &pl->title);
    if (st != IIIMF_STATUS_SUCCESS) return st;
    for (nc = 0, pimt = plcd->choice; pimt; pimt = pimt->next) nc++;

    if (nc > pl->size) {
       int osize = pl->size;
       int inc = nc - osize;

       ptr = (IIIMCF_text_rec*) realloc(pl->pcandidates, sizeof(*ptr) * nc);
       if (!ptr) return IIIMF_STATUS_MALLOC;
       memset(ptr + osize, 0, sizeof(*ptr) * inc);
       pl->pcandidates = ptr;
       ptr = (IIIMCF_text_rec*) realloc(pl->plabels, sizeof(*ptr) * nc);
       if (!ptr) return IIIMF_STATUS_MALLOC;
       memset(ptr + osize, 0, sizeof(*ptr) * inc);
       pl->plabels = ptr;
       pflags = (int*) realloc(pl->pflags, sizeof(*pflags) * nc);
       if (!pflags) return IIIMF_STATUS_MALLOC;
       memset(pflags + osize, 0, sizeof(*pflags) * inc);
       pl->pflags = pflags;
    }
    for (i = plcd->first, ptr = pl->pcandidates, pflags = pl->pflags, pimt = plcd->choice;
        pimt; i++, ptr++, pflags++, pimt = pimt->next) {
       st = iiimcf_convert_iiimp_text_to_text(pimt, ptr);
       if (st != IIIMF_STATUS_SUCCESS) return st;
       flag = IIIMCF_LOOKUP_CHOICE_ITEM_ENABLED;
       if (i == plcd->current)
           flag |= IIIMCF_LOOKUP_CHOICE_SELECTED_ITEM;
       *pflags = flag;
    }
    for (nl = 0, pimt = plcd->index_label; pimt; pimt = pimt->next) nl++;
    if ((pl->masterp != IM_LOOKUP_CHOICE_START_SERVER_IS_MASTER)
       || (nc != nl)) {
       /* make label */
       int endi = plcd->first + nc;

       for (i = plcd->first, ptr = pl->plabels;
            i < endi; i++, ptr++) {
           unsigned char stridx[IIIMCF_LOOKUP_CHOICE_LABEL_INDEX_SIZE_MAX];
           snprintf(stridx, sizeof(stridx), "%d:", i);
           st = iiimcf_construct_text_from_UTF8(stridx, ptr);
       }
    } else {
       for (ptr = pl->plabels, pimt = plcd->index_label;
            pimt; pimt = pimt->next, ptr++) {
           st = iiimcf_convert_iiimp_text_to_text(pimt, ptr);
           if (st != IIIMF_STATUS_SUCCESS) return st;
       }
    }
    pl->idx_first = plcd->first;
    pl->idx_last = plcd->last;
    pl->idx_current = plcd->current;
    pl->enabled_range_start = 0;
    if (pl->masterp == IM_LOOKUP_CHOICE_START_CLIENT_IS_MASTER) {
       if (nc > pl->choices_per_window)
           pl->enabled_range_end = pl->choices_per_window;
       else
           pl->enabled_range_end = nc;
    } else {
       pl->enabled_range_end = nc;
    }
    pl->size = nc;

    IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_LOOKUP_CHOICE_CHANGED);

    return iiimcf_store_simple_event(pc, IIIMCF_EVENT_TYPE_UI_LOOKUP_CHOICE_CHANGE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 28 of file preedit.c.

{
    IIIMF_status st;
    ASSERT(pmes->opcode == IM_PREEDIT_DRAW);

    st = iiimcf_update_text_by_preedit_draw(&pc->preedit_text, pmes);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    /* 
       Strictly speaking, we should not enable status here.
       However, Solaris Chinese LEs never send IM_PREEDIT_START,
       we cannot help enabling preedit by IM_PREEDIT_DRAW as well...
       See iiimcf_update_status() also.
     */
    if (!IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_PREEDIT_ENABLED)) {
       st = iiimcf_toggle_preedit(pc, 1);
       if (st != IIIMF_STATUS_SUCCESS) return st;
    }

    pc->preedit_caret_position = pmes->v.preedit_draw.caret;

    IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_PREEDIT_CHANGED);

    return iiimcf_store_simple_event(pc, IIIMCF_EVENT_TYPE_UI_PREEDIT_CHANGE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 28 of file status.c.

{
    IIIMF_status st;
    IIIMP_contents *pcon = pmes->v.status_draw.status;
    ASSERT(pmes->opcode == IM_STATUS_DRAW);

    st = iiimcf_convert_iiimp_contents_to_text(pcon, &pc->status_text);
    if (st != IIIMF_STATUS_SUCCESS) return st;

    /* 
       Strictly speaking, we should not enable status here.
       However, ATOK/X never send IM_STATUS_START, we cannot
       help enabling status text by IM_STATUS_DRAW as well...
     */
    if (!IIIMCF_IS_ENABLED(pc, IIIMCF_CONTEXT_STATUS_ENABLED)) {
       st = iiimcf_toggle_status(pc, 1);
       if (st != IIIMF_STATUS_SUCCESS) return st;
    }

    IIIMCF_SET_STATE_CHANGE(pc, IIIMCF_STATE_STATUS_CHANGED);

    return iiimcf_store_simple_event(pc, IIIMCF_EVENT_TYPE_UI_STATUS_CHANGE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 258 of file text.c.

{
    if (!pbase->pv_mtext) {
       return iiimcf_convert_iiimp_contents_to_text(pmes->v.preedit_draw.preedit, pbase);
    } else {
       EIMIL_value *pv;

       if (!EIMIL_update_mtext_by_preedit_draw_message(pbase->pv_mtext, pmes, &pv)) {
           iiimcf_destruct_text(pbase);
           return IIIMF_STATUS_MALLOC;
       }
       EIMIL_destruct_value(pbase->pv_mtext);
       pbase->pv_mtext = pv;
       pbase->updated = 0;
    }
    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMF_status iiimcf_wait_message ( IIIMCF_handle_rec ph,
IIIMCF_context_rec pc,
int  opcode,
IIIMP_message **  ppmes 
)

Definition at line 280 of file message.c.

{
    IIIMF_status st;
    IIIMP_message *pmes;

    for (;;) {
       st = iiimcf_receive_message(ph, &pmes);
       if (st != IIIMF_STATUS_SUCCESS) return st;

       if (match_message(ph, pc, opcode, pmes)) {
           if (ppmes) {
              *ppmes = pmes;
           } else {
              iiimp_message_delete(ph->data_s, pmes);
           }
           return IIIMF_STATUS_SUCCESS;
       }

       st = iiimcf_process_message(ph, pmes);
       if (st != IIIMF_STATUS_SUCCESS) return st;
    }

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 278 of file iiimcf_file_operation.c.

{
    int i;
    IIIMP_write_reply *pwr;
    IIIMP_message *preply;
    errno = 0;
    int nwrite = -1;

    for (i=0; i<ph->num_of_ns; i++) {
       if (ph->pns[i].ns_id == pw->ns_id) {
           nwrite = write(ph->pns[i].nsc_fd, pw->object, pw->size);
           pwr = iiimp_write_reply_new(ph->data_s, pw->ns_id, nwrite, errno); 
            preply = iiimp_file_operation_reply_new(ph->data_s, ph->im_id, IIIMP_FILE_OPERATION_TYPE_WRITE_REPLY, pwr);
           return iiimcf_send_message(ph, preply, 1);
       }
    } 
    return IIIMF_STATUS_FAIL;
}

Here is the call graph for this function:

Here is the caller graph for this function: