example1.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <locale.h>`
`#include <librcc.h>`

## Functions

int | main ()

## Function Documentation

## main()

int main | ( |  | ) |

{
const char *language;
char buf[255];
char *recoded;
rcc_class classes[] = {
{ "input", RCC_CLASS_STANDARD, NULL, NULL, "Input Encoding", 0 },
{ "output", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output Encoding", 0 },
{ NULL }
};
setlocale(LC_ALL, "");
rccInit();
rccInitDefaultContext(NULL, 0, 0, classes, 0);
language = rccGetCurrentLanguageName(NULL);
if (language) printf("Current Language: %s\n\n", language);
else printf("Unable Detect Language\n\n");
while (fgets(buf,255,stdin)) {
if (strlen(buf)<2) break;
recoded = rccRecode(NULL, 0, 1, buf);
if (recoded) {
printf("%s", recoded);
free(recoded);
} else printf("%s", buf);
}
rccFree();
return 0;
}
rccInitDefaultContext
int rccInitDefaultContext(const char *locale_variable, unsigned int max_languages, unsigned int max_classes, rcc_class_ptr defclasses, rcc_init_flags flags)
rccGetCurrentLanguageName
const char * rccGetCurrentLanguageName(rcc_context ctx)
rcc_class
const struct rcc_class_t rcc_class
Definition librcc.h:376
RCC_CLASS_STANDARD
@ RCC_CLASS_STANDARD
Definition librcc.h:314
rccInit
int rccInit()
rccRecode
#define rccRecode(ctx, from, to, buf)
Definition librcc.h:1455
rccFree
void rccFree()

References RCC_CLASS_STANDARD, rccFree(), rccGetCurrentLanguageName(), rccInit(), rccInitDefaultContext(), and rccRecode.