Back to index

im-sdk  12.3.91
Functions
im-hotkey-state-notify.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <iiimp-data.h>
#include <iiimp-opcode.h>
#include "iiimp-dataP.h"

Go to the source code of this file.

Functions

IIIMP_messageiiimp_hotkey_state_notify_new (IIIMP_data_s *data_s, IIIMP_card16 im_id, IIIMP_card16 ic_id, IIIMP_card16 hotkey_id, IIIMP_card8 current_state_flag)
void iiimp_hotkey_state_notify_delete (IIIMP_data_s *data_s, IIIMP_message *m)
uchar_t * iiimp_hotkey_state_notify_pack (IIIMP_data_s *data_s, IIIMP_card16 im_id, IIIMP_card16 ic_id, IIIMP_card16 hotkey_id, IIIMP_card8 current_state_flag, size_t *buf_size)
IIIMP_messageiiimp_hotkey_state_notify_unpack (IIIMP_data_s *data_s, IIIMP_card7 opcode, size_t *nbyte, const uchar_t **ptr)
void iiimp_hotkey_state_notify_print (IIIMP_data_s *data_s, IIIMP_message *m)

Function Documentation

void iiimp_hotkey_state_notify_delete ( IIIMP_data_s *  data_s,
IIIMP_message m 
)

Definition at line 38 of file im-hotkey-state-notify.c.

{
#if defined(lint) && defined(HAVE_NOTE_H)
    NOTE(ARGUNUSED(data_s))
#endif /* lint && HAVE_NOTE_H */
       free(m);
}
IIIMP_message* iiimp_hotkey_state_notify_new ( IIIMP_data_s *  data_s,
IIIMP_card16  im_id,
IIIMP_card16  ic_id,
IIIMP_card16  hotkey_id,
IIIMP_card8  current_state_flag 
)

Definition at line 15 of file im-hotkey-state-notify.c.

{
    IIIMP_message *  m;
    m = (IIIMP_message *)malloc(sizeof (IIIMP_message));
    if (NULL == m) {
       data_s->status = IIIMP_DATA_MALLOC_ERROR;
       return NULL;
    }
    m->opcode = IM_HOTKEY_STATE_NOTIFY;
    m->im_id = im_id;
    m->ic_id = ic_id;
    m->v.hotkey_state_notify.hotkey_id = hotkey_id;
    m->v.hotkey_state_notify.current_state_flag = current_state_flag;
    return m;
}

Here is the caller graph for this function:

uchar_t* iiimp_hotkey_state_notify_pack ( IIIMP_data_s *  data_s,
IIIMP_card16  im_id,
IIIMP_card16  ic_id,
IIIMP_card16  hotkey_id,
IIIMP_card8  current_state_flag,
size_t *  buf_size 
)

Definition at line 48 of file im-hotkey-state-notify.c.

{
    size_t           nbyte;
    int                     length;
    uchar_t *        buf;
    size_t           rest;
    uchar_t *        p;

    nbyte = 0
       + 2     /* input method id */
       + 2     /* input context id */
       + 2     /* HOTKEY ID */
       + 1     /* Pad */
       + 1;     /* State Flag */

    length = (nbyte >> 2);
    *buf_size = (1 + 3 + nbyte);

    buf = (uchar_t *)malloc(1 + 3 + nbyte);
    if (NULL == buf) {
       data_s->status = IIIMP_DATA_MALLOC_ERROR;
       return NULL;
    }

    PUT_PACKET_HEADER(buf, IM_HOTKEY_STATE_NOTIFY, length);

    rest = nbyte;
    p = (buf + 4);

    PUTU16(im_id, rest, p, data_s->byte_swap);
    PUTU16(ic_id, rest, p, data_s->byte_swap);
    PUTU16(hotkey_id, rest, p, data_s->byte_swap);
    PUTU8(0, rest, p, data_s->byte_swap);
    PUTU8(current_state_flag, rest, p, data_s->byte_swap);

    return buf;
}

Here is the caller graph for this function:

void iiimp_hotkey_state_notify_print ( IIIMP_data_s *  data_s,
IIIMP_message m 
)

Definition at line 136 of file im-hotkey-state-notify.c.

{
    iiimp_message_header_print(data_s, m->opcode, m->im_id, m->ic_id);
    (void)fprintf(data_s->print_fp, "\thotkey_id = %d\n",
                m->v.hotkey_state_notify.hotkey_id);
    (void)fprintf(data_s->print_fp, "\tcurrent_state_flag = %d\n", m->v.hotkey_state_notify.current_state_flag);
}

Here is the call graph for this function:

IIIMP_message* iiimp_hotkey_state_notify_unpack ( IIIMP_data_s *  data_s,
IIIMP_card7  opcode,
size_t *  nbyte,
const uchar_t **  ptr 
)

Definition at line 94 of file im-hotkey-state-notify.c.

{
    IIIMP_message *                m;
    IIIMP_hotkey_state_notify_v *  v;
    size_t                         rest;
    const uchar_t *                p;

    rest = *nbyte;
    p = *ptr;

    if (rest < (2 + 2 + 2 + 1 + 1)) {
       data_s->status = IIIMP_DATA_INVALID;
       return NULL;
    }

    m = (IIIMP_message *)malloc(sizeof (IIIMP_message));
    if (NULL == m) {
       data_s->status = IIIMP_DATA_MALLOC_ERROR;
       return NULL;
    }
    v = &(m->v.hotkey_state_notify);

    m->opcode = opcode;

    GETU16(m->im_id, rest, p, data_s->byte_swap);
    GETU16(m->ic_id, rest, p, data_s->byte_swap);
    GETU16(v->hotkey_id, rest, p, data_s->byte_swap);
    SKIP8(rest, p);
    GETU8(v->current_state_flag, rest, p, data_s->byte_swap);

    *nbyte = rest;
    *ptr = p;

    return m;
}