Back to index

im-sdk  12.3.91
Defines | Functions
le_info.c File Reference
#include <stdio.h>
#include "le_info.h"

Go to the source code of this file.

Defines

#define LE_CONFIG_FILE   "thai_keymap.cfg"

Functions

LeResult le_info_destroy (LeInfoRec *le_info)
LeResult le_info_load_config_file (LeInfoRec *le_info, char *le_config_file)
LeInfoRecle_info_new ()
LeResult le_info_print (LeInfoRec *le_info)
char * le_info_get_full_file_path (char *file_path)

Define Documentation

#define LE_CONFIG_FILE   "thai_keymap.cfg"

Definition at line 5 of file le_info.c.


Function Documentation

char* le_info_get_full_file_path ( char *  file_path)

Definition at line 66 of file le_info.c.

{
    int len;
    char *full_file_path = NULL;

    if (!file_path || !*file_path)
       return (NULL);

    if (file_path[0] == '/') {
       len = strlen(file_path);

       full_file_path = (char *) calloc(len + 1, sizeof(char));
       if (full_file_path == NULL)
           return (NULL);

       sprintf(full_file_path, "%s", file_path);
    } else {
       len = strlen(LE_BASE_DIR) + 1 + strlen(file_path);

       full_file_path = (char *) calloc(len + 1, sizeof(char));
       if (full_file_path == NULL)
           return (NULL);

       sprintf(full_file_path, "%s/%s", LE_BASE_DIR, file_path);
    }

    return (full_file_path);
}
LeResult le_info_load_config_file ( LeInfoRec le_info,
char *  le_config_file 
)

Definition at line 11 of file le_info.c.

{
    LeResult result;

    LeInfoRec *le_info = NULL;
    char *le_config_file = LE_CONFIG_FILE;

    le_info = (LeInfoRec *) calloc(1, sizeof(LeInfoRec));
    if (le_info == NULL)
       return (NULL);

    le_info->keymap_list = NULL;

    result = le_info_load_config_file(le_info, le_config_file);
    if (result == LE_FAIL) {
        le_info_destroy(le_info);
        return (NULL);
    }

    return (le_info);
}

Here is the call graph for this function:

Definition at line 51 of file le_info.c.

{
#ifdef DEBUG
    if (le_info == NULL)
       return (LE_FAIL);

    /* print ime modules */
    if (le_info->keymap_list) {
       ThaiKeymapList_Print(le_info->keymap_list);
    }

    return (LE_OK);
#endif
}

Here is the call graph for this function: