Back to index

im-sdk  12.3.91
Functions
iiimpAuxP.h File Reference
#include <iiimcf.h>
#include "iiimpAux.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void IIimpAuxDownload (IIIMCF_downloaded_object obj)
void IIimpAuxStart (XicCommon ic, IIIMCF_event ev)
void IIimpAuxDraw (XicCommon ic, IIIMCF_event ev)
void IIimpAuxDone (XicCommon ic, IIIMCF_event ev)
void IIimpAuxGetValuesReply (XicCommon ic, IIIMCF_event ev)
void IIimpDestroryAuxData (XicCommon ic)
void IIimpFreeAllAuxData ()
void IIimpAuxSetICFocus (XicCommon ic)
void IIimpAuxUnsetICFocus (XicCommon ic)

Function Documentation

void IIimpAuxDone ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 683 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: done\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: done: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->done(aux,
                              (XPointer) &ac,
                              /* Always set 0! */
                              0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 281 of file iiimpAux.c.

{
    char *aux_file_name;
    char *aux_file_name_buf;
    int       aux_file_name_len;
    char file_name[MAXPATHLEN];
    char *dir_name;
    int       dir_name_len;
    Bool useUnicode = False; /* default */
    IIIMF_status st;
    const IIIMP_card16 *u16filename;

    TRACE_MESSAGE('A', ("iiimpAux: download\n"));

    aux_file_name = NULL;
    aux_file_name_buf = NULL;

    st = iiimcf_get_downloaded_object_filename(obj, &u16filename);
    if (st != IIIMF_STATUS_SUCCESS) return;
    st = IIimpUTF16ToString(u16filename, useUnicode, &aux_file_name);
    if (st != IIIMF_STATUS_SUCCESS) return;
    aux_file_name_buf = aux_file_name;

#if defined(IIIM_AUX_SO_PATH_ENV)
    p = getenv(IIIM_AUX_SO_PATH_ENV);

    if (NULL != p) {
       aux_file_name = p;
    }

    if (NULL == aux_file_name) {
       aux_file_name = "./aux.so";
    }
#endif /* IIIM_AUX_SO_PATH_ENV */

    if (NULL == aux_file_name) {
       return;
    }

    aux_file_name_len = strlen(aux_file_name);

    /*
     * may not start with "/"
     * may not start with "../"
     * may not contain "/../"
     * may not end with "/"
     * may not end with "/."
     * may not end with "/.."
     * may not be ".."
     */

    if (((1 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + 0))) ||
       ((3 <= aux_file_name_len) &&
        ('.' == *(aux_file_name + 0)) &&
        ('.' == *(aux_file_name + 1)) &&
        ('/' == *(aux_file_name + 2))) ||
       (NULL != strstr(aux_file_name, "/../")) ||
       ((1 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((2 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 2)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((3 <= aux_file_name_len) &&
        ('/' == *(aux_file_name + aux_file_name_len - 3)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 2)) &&
        ('.' == *(aux_file_name + aux_file_name_len - 1))) ||
       ((2 == aux_file_name_len) &&
        ('.' == *(aux_file_name + 0)) &&
        ('.' == *(aux_file_name + 1)))) {

       Xfree (aux_file_name_buf);
       return;
    }

    /*
     * eliminate leading "./"
     */
    if ((2 <= aux_file_name_len) &&
       ('.' == *(aux_file_name + 0)) &&
       ('/' == *(aux_file_name + 1))) {
       aux_file_name += 2;
       aux_file_name_len -= 2;
    }

    dir_name = AUX_BASE_DIR;

#if defined(IIIM_AUX_SO_BASE_ENV)
    {
       char * p;
       if (NULL != (p = getenv(IIIM_AUX_SO_BASE_ENV))) {
           dir_name = p;
       }
    }
#endif /* IIIM_AUX_SO_BASE_ENV */

    dir_name_len = strlen(dir_name);

#if defined(__sparcv9)
    if (MAXPATHLEN <
       (dir_name_len + 1 + aux_file_name_len + SPARCV9_DIR_LEN + 1)) {
       Xfree (aux_file_name_buf);
       return;
    }
    p = strrchr(aux_file_name, '/');
    if (NULL == p) {
       p = aux_file_name;
    } else {
       p += 1;
    }
    memcpy(file_name, dir_name, dir_name_len);
    len = (p - aux_file_name);
    if (dir_name_len > 0 && dir_name[dir_name_len-1] == '/') {
       memcpy(file_name + dir_name_len, aux_file_name, len);
       len += dir_name_len;
    } else {
       file_name[dir_name_len] = '/';
       memcpy(file_name + dir_name_len + 1, aux_file_name, len);
       len += (dir_name_len + 1);
    }
    memcpy(file_name + len, SPARCV9_DIR, SPARCV9_DIR_LEN);
    len += SPARCV9_DIR_LEN;
    memcpy(file_name + len, p, aux_file_name_len - (p - aux_file_name) + 1);

#else /* !__sparcv9 */

    if (MAXPATHLEN <= (dir_name_len + 1 + aux_file_name_len + 1)) {
       Xfree (aux_file_name_buf);
       return;
    }

    memcpy(file_name, dir_name, dir_name_len + 1);
    if (dir_name_len > 0 && dir_name[dir_name_len-1] == '/') {
       memcpy(file_name + dir_name_len,
              aux_file_name, aux_file_name_len + 1);
    } else {
       file_name[dir_name_len] = '/';
       memcpy(file_name + dir_name_len + 1,
              aux_file_name, aux_file_name_len + 1);
    }
#endif /* !__sparcv9 */

    (void)aux_load(file_name);

    Xfree (aux_file_name_buf);

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IIimpAuxDraw ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 651 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: draw\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: draw: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->draw(aux,
                              (XPointer) &ac,
                              /* Always set 0! */
                              0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 714 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: getvalues reply\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: getvalues reply: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    if (aux->im->ae->dir.method->getvalues_reply)
       aux->im->ae->dir.method->getvalues_reply(aux,
                                           (XPointer) &ac,
                                           /* Always set 0! */
                                           0);
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 774 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *aux_im;

    aux = XIC_IIIMP(ic, aux);
    if (!aux)
       return;

    for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
       if (aux_im->ae->if_version >= AUX_IF_VERSION_2 &&
           aux_im->ae->dir.method->set_icforcus != NULL) {
           aux->im = aux_im;
           aux_im->ae->dir.method->set_icforcus(aux);
       }
    }
}

Here is the caller graph for this function:

void IIimpAuxStart ( XicCommon  ic,
IIIMCF_event  ev 
)

Definition at line 618 of file iiimpAux.c.

{
    aux_t *aux;
    AUXComposed ac;

    TRACE_MESSAGE('A', ("iiimpAux: start\n"));

    aux = aux_get(ic, ev, NULL);
    if (!aux) {
       TRACE_MESSAGE('A', ("iiimpAux: start: failed to get aux\n"));
       return;
    }

    memset(&ac, 0, sizeof(ac));
    ac.aux = aux;
    ac.ev = ev;

    aux->im->ae->dir.method->start(aux, 
                               (XPointer) &ac,
                               /* Always set 0! */
                               0);

    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 795 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *aux_im;

    aux = XIC_IIIMP(ic, aux);
    if (!aux)
       return;

    for (aux_im = aux->im_list; aux_im; aux_im = aux_im->next) {
       if (aux_im->ae->if_version >= AUX_IF_VERSION_2 &&
           aux_im->ae->dir.method->unset_icforcus != NULL) {
           aux->im = aux_im;
           aux_im->ae->dir.method->unset_icforcus(aux);
       }
    }
}

Here is the caller graph for this function:

Definition at line 852 of file iiimpAux.c.

{
    aux_t *aux;
    aux_im_data_t *pai1, *pai2;

    if (!ic || !ic->iiimp_icpart) return;
    aux = XIC_IIIMP(ic, aux);
    if (!aux) return;

    delete_aux_ic(ic);

    for (pai1 = aux->im_list; pai1; ) {
       pai2 = pai1->next;
       free(pai1);
       pai1 = pai2;
    }
    aux->im_list = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 877 of file iiimpAux.c.

{
    aux_handle_t *ah;
    aux_handle_t *ah_next;
    int       i;

    TRACE_MESSAGE('A', ("iiimpAux: destroy\n"));

    for (ah = aux_handle; NULL != ah; ah = ah_next) {
       for (i = 0; i < ah->ae_num; i++) {
           if (0 == (ah->ae + i)->created) {
              continue;
           }
           (ah->ae + i)->dir.method->destroy(NULL);
           (ah->ae + i)->created = 0;
       }
       ah_next = ah->next;
       Xfree(ah->aux_name.ptr);
       Xfree(ah->file_name);
       dlclose(ah->handle);
       Xfree(ah->ae);
       Xfree(ah);
    }

    aux_handle = NULL;

    return;
}

Here is the caller graph for this function: