Back to index

php5  5.3.10
Functions | Variables
mbfl_language.c File Reference
#include "mbfl_encoding.h"
#include "mbfl_language.h"
#include "nls/nls_ja.h"
#include "nls/nls_kr.h"
#include "nls/nls_zh.h"
#include "nls/nls_uni.h"
#include "nls/nls_de.h"
#include "nls/nls_ru.h"
#include "nls/nls_ua.h"
#include "nls/nls_en.h"
#include "nls/nls_hy.h"
#include "nls/nls_tr.h"
#include "nls/nls_neutral.h"

Go to the source code of this file.

Functions

const mbfl_languagembfl_name2language (const char *name)
const mbfl_languagembfl_no2language (enum mbfl_no_language no_language)
enum mbfl_no_language mbfl_name2no_language (const char *name)
const char * mbfl_no_language2name (enum mbfl_no_language no_language)

Variables

static const mbfl_languagembfl_language_ptr_table []

Function Documentation

const mbfl_language* mbfl_name2language ( const char *  name)

Definition at line 90 of file mbfl_language.c.

{
       const mbfl_language *language;
       int i, j;

       if (name == NULL) {
              return NULL;
       }

       i = 0;
       while ((language = mbfl_language_ptr_table[i++]) != NULL){
              if (strcasecmp(language->name, name) == 0) {
                     return language;
              }
       }

       i = 0;
       while ((language = mbfl_language_ptr_table[i++]) != NULL){
              if (strcasecmp(language->short_name, name) == 0) {
                     return language;
              }
       }

       /* serch aliases */
       i = 0;
       while ((language = mbfl_language_ptr_table[i++]) != NULL) {
              if (language->aliases != NULL) {
                     j = 0;
                     while ((*language->aliases)[j] != NULL) {
                            if (strcasecmp((*language->aliases)[j], name) == 0) {
                                   return language;
                            }
                            j++;
                     }
              }
       }

       return NULL;
}

Here is the caller graph for this function:

enum mbfl_no_language mbfl_name2no_language ( const char *  name)

Definition at line 147 of file mbfl_language.c.

{
       const mbfl_language *language;

       language = mbfl_name2language(name);
       if (language == NULL) {
              return mbfl_no_language_invalid;
       } else {
              return language->no_language;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

const mbfl_language* mbfl_no2language ( enum mbfl_no_language  no_language)

Definition at line 131 of file mbfl_language.c.

{
       const mbfl_language *language;
       int i;

       i = 0;
       while ((language = mbfl_language_ptr_table[i++]) != NULL){
              if (language->no_language == no_language) {
                     return language;
              }
       }

       return NULL;
}

Here is the caller graph for this function:

const char* mbfl_no_language2name ( enum mbfl_no_language  no_language)

Definition at line 160 of file mbfl_language.c.

{
       const mbfl_language *language;

       language = mbfl_no2language(no_language);
       if (language == NULL) {
              return "";
       } else {
              return language->name;
       }
}

Here is the call graph for this function:


Variable Documentation