Back to index

im-sdk  12.3.91
Functions
iiimp-misc.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iiimp.h>
#include "iiimp-dataP.h"

Go to the source code of this file.

Functions

int iiimp_data_s_get_protocol_version (IIIMP_data_s *data_s)
IIIMF_status iiimp_data_s_limit_protocol_version (IIIMP_data_s *data_s, int version)
IIIMP_data_s * iiimp_data_s_with_protocol_version_new (int protocol_version)
int iiimp_data_s_capability (IIIMP_data_s *data_s, int capability)
IIIMP_data_s * iiimp_data_s_new (void)
void iiimp_data_s_delete (IIIMP_data_s *data_s)
FILE * iiimp_data_print_fp (IIIMP_data_s *data_s, FILE *fp)
uint_t iiimp_data_print_flag (IIIMP_data_s *data_s, uint_t print_flag)
int iiimp_data_status (IIIMP_data_s *data_s)
IIIMP_card16 iiimp_attribute_id_search (IIIMP_data_s *data_s, IIIMP_card16 id_dynamic)
void iiimp_attribute_id_update (IIIMP_data_s *data_s, IIIMP_card16 id_predefined, IIIMP_card16 id_dynamic)
void iiimp_attribute_id_destroy (IIIMP_data_s *data_s)

Function Documentation

void iiimp_attribute_id_destroy ( IIIMP_data_s *  data_s)

Definition at line 158 of file iiimp-misc.c.

{
    IIIMP_attribute_id *    attr;
    IIIMP_attribute_id *    attr_next;

    for (attr = data_s->attribute_id; NULL != attr; attr = attr_next) {
       attr_next = attr->next;
       free(attr);
    }
    data_s->attribute_id = NULL;

    return;
}

Here is the caller graph for this function:

IIIMP_card16 iiimp_attribute_id_search ( IIIMP_data_s *  data_s,
IIIMP_card16  id_dynamic 
)

Definition at line 118 of file iiimp-misc.c.

{
    IIIMP_attribute_id *    attr;

    for (attr = data_s->attribute_id; NULL != attr; attr = attr->next) {
       if (id_dynamic == attr->id_dynamic) {
           return attr->id_predefined;
       }
    }

    return 0;
}

Here is the caller graph for this function:

void iiimp_attribute_id_update ( IIIMP_data_s *  data_s,
IIIMP_card16  id_predefined,
IIIMP_card16  id_dynamic 
)

Definition at line 133 of file iiimp-misc.c.

{
    IIIMP_attribute_id *    attr;

    for (attr = data_s->attribute_id; NULL != attr; attr = attr->next) {
       if (id_dynamic == attr->id_dynamic) {
           attr->id_predefined = id_predefined;
           return;
       }
    }
    attr = (IIIMP_attribute_id *)malloc(sizeof (IIIMP_attribute_id));
    if (NULL == attr) return;
    attr->id_predefined = id_predefined;
    attr->id_dynamic = id_dynamic;
    attr->next = data_s->attribute_id;
    data_s->attribute_id = attr;

    return;
}

Here is the caller graph for this function:

uint_t iiimp_data_print_flag ( IIIMP_data_s *  data_s,
uint_t  print_flag 
)

Definition at line 101 of file iiimp-misc.c.

{
    if (IIIMP_PRINT_QUERY != print_flag) {
       data_s->print_flag = print_flag;
    }
    return data_s->print_flag;
}
FILE* iiimp_data_print_fp ( IIIMP_data_s *  data_s,
FILE *  fp 
)

Definition at line 92 of file iiimp-misc.c.

{
    if (NULL == data_s) return NULL;
    data_s->print_fp = fp;
    return data_s->print_fp;
}

Here is the caller graph for this function:

int iiimp_data_s_capability ( IIIMP_data_s *  data_s,
int  capability 
)

Definition at line 59 of file iiimp-misc.c.

{
    int       list_index;
    int       bit_index;

    if ((NULL == data_s) || (NULL == data_s->capability)) return 0;

    return iiimp_card32_list_bit_p(data_s, data_s->capability, capability);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void iiimp_data_s_delete ( IIIMP_data_s *  data_s)

Definition at line 81 of file iiimp-misc.c.

{
    if (NULL == data_s) return;
    (void)iiimp_data_print_fp(data_s, NULL);
    (void)iiimp_attribute_id_destroy(data_s);
    (void)iiimp_card32_list_delete(data_s, data_s->capability);
    free(data_s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiimp_data_s_get_protocol_version ( IIIMP_data_s *  data_s)

Definition at line 11 of file iiimp-misc.c.

{
    return data_s->protocol_version;
}

Here is the caller graph for this function:

IIIMF_status iiimp_data_s_limit_protocol_version ( IIIMP_data_s *  data_s,
int  version 
)

Definition at line 20 of file iiimp-misc.c.

{
    if (version > data_s->protocol_version)
       return IIIMF_STATUS_PROTOCOL_VERSION;
    data_s->protocol_version = version;

    return IIIMF_STATUS_SUCCESS;
}

Here is the caller graph for this function:

IIIMP_data_s* iiimp_data_s_new ( void  )

Definition at line 74 of file iiimp-misc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMP_data_s* iiimp_data_s_with_protocol_version_new ( int  protocol_version)

Definition at line 34 of file iiimp-misc.c.

{
    IIIMP_data_s *   data_s;

    if (protocol_version >= 0x100) {
       return NULL;
    }

    data_s = (IIIMP_data_s *)malloc(sizeof (IIIMP_data_s));
    if (NULL == data_s) return NULL;
    data_s->byte_swap = 0;
    data_s->attribute_id = NULL;
    data_s->status = 0;
    data_s->print_fp = stdout;
    data_s->print_flag = 0;
    data_s->protocol_version = protocol_version;
    data_s->capability = NULL;

    return data_s;
}

Here is the caller graph for this function:

int iiimp_data_status ( IIIMP_data_s *  data_s)

Definition at line 111 of file iiimp-misc.c.

{
    return data_s->status;
}

Here is the caller graph for this function: