Changeset 3546 for trunk/src/lib


Ignore:
Timestamp:
Jan 29, 2022, 3:37:06 AM (3 years ago)
Author:
bird
Message:

lib: Added a get_crt_codepage function for windows (with a get_ansi_codepage() for debug).

Location:
trunk/src/lib
Files:
1 added
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/Makefile.kmk

    r3394 r3546  
    4646        version_compare.c
    4747kUtil_SOURCES.win = \
     48        get_codepage.c \
    4849        msc_buffered_printf.c \
    4950        win_get_processor_group_active_mask.c \
  • trunk/src/lib/get_codepage.h

    r3541 r3546  
    11/* $Id$ */
    22/** @file
    3  * console related functions.
     3 * Codepage related functions.
    44 */
    55
    66/*
    7  * Copyright (c) 2016-2018 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
     7 * Copyright (c) 2021 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
    88 *
    99 * Permission is hereby granted, free of charge, to any person obtaining a
     
    2929 */
    3030
    31 #ifndef ___lib_console_h___
    32 #define ___lib_console_h___
     31#ifndef ___lib_get_codepage_h___
     32#define ___lib_get_codepage_h___
    3333
    34 #include <stdio.h>
    35 #ifdef _MSC_VER
    36 # include <io.h>
    37 # ifndef ssize_t
    38 typedef intptr_t ssize_t;
    39 # endif
    40 #else
    41 # include <unistd.h>
    42 #endif
     34#include <locale.h>
    4335
     36extern unsigned get_crt_codepage(void);
     37extern unsigned get_ansi_codepage(void);
    4438
    45 #ifdef KBUILD_OS_WINDOWS
    46 extern int      is_console_handle(intptr_t hHandle);
    47 #endif
    48 extern int      is_console(int fd);
    49 extern ssize_t  maybe_con_write(int fd, void const *pvBuf, size_t cbToWrite);
    50 extern size_t   maybe_con_fwrite(void const *pvBuf, size_t cbUnit, size_t cUnits, FILE *pFile);
     39#define MY_CP_UTF8 65001
    5140
    5241#endif
Note: See TracChangeset for help on using the changeset viewer.