Back to index

im-sdk  12.3.91
Functions
commit.c File Reference
#include <stdlib.h>
#include "iiimcfint.h"

Go to the source code of this file.

Functions

IIIMF_status iiimcf_commit_string (IIIMCF_context_rec *pc, IIIMP_message *pmes)
IIIMF_status iiimcf_get_committed_text (IIIMCF_context context, IIIMCF_text *ptext)

Function Documentation

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 38 of file commit.c.

Here is the caller graph for this function: