Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4972 → Rev 4973

/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/Makefile
0,0 → 1,4
THIS_SRCS = lconv.c mbcurmax.c mblen.c mbstowcs.c mbtowc.c setlocal.c \
wcstombs.c wctomb.c
 
include $(MENUET_LIBC_TOPDIR)/Make.rules
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/lconv.c
0,0 → 1,32
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <locale.h>
#include <limits.h>
 
static char ESTR[] = "";
static char DSTR[] = ".";
 
static struct lconv __lconv_ = {
ESTR,
DSTR,
ESTR,
ESTR,
ESTR,
ESTR,
ESTR,
ESTR,
ESTR,
ESTR,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX,
CHAR_MAX
};
 
struct lconv *localeconv()
{
return &__lconv_;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/mbcurmax.c
0,0 → 1,4
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
int __dj_mb_cur_max = 1;
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/mblen.c
0,0 → 1,15
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
int
mblen(const char *s, size_t n)
{
if (s)
{
if (n == 0 || *s == 0)
return 0;
return 1;
}
else
return 1;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/mbstowcs.c
0,0 → 1,12
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
size_t
mbstowcs(wchar_t *wcs, const char *s, size_t n)
{
int i;
for (i=0; s[i] && (i<n-1); i++)
wcs[i] = s[i];
wcs[i] = 0;
return i;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/mbtowc.c
0,0 → 1,17
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
int
mbtowc(wchar_t *pwc, const char *s, size_t n)
{
int x = 0;
if (s == 0)
return 0;
if (*s)
x = 1;
 
if (pwc)
*pwc = *s;
 
return x;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/setlocal.c
0,0 → 1,13
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <locale.h>
#include <string.h>
 
char *setlocale(int category, const char *locale)
{
static char CLOCALE[] = "C";
if (locale == 0)
return CLOCALE;
if (strcmp(locale, CLOCALE) && strcmp(locale, "POSIX") && locale[0])
return 0;
return CLOCALE;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/wcstombs.c
0,0 → 1,12
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
size_t
wcstombs(char *s, const wchar_t *wcs, size_t n)
{
int i;
for (i=0; wcs[i] && (i<n-1); i++)
s[i] = wcs[i];
s[i] = 0;
return i;
}
/programs/develop/libraries/menuetlibc/src/libc/ansi/locale/wctomb.c
0,0 → 1,10
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
#include <stdlib.h>
 
int
wctomb(char *s, wchar_t wchar)
{
if (s)
s[0] = wchar;
return 1;
}