unicode_support.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (c) 2004-2012 LoRd_MuldeR <mulder2@gmx.de>
  2. File: unicode_support.h
  3. This file was originally part of a patch included with LameXP,
  4. released under the same license as the original audio tools.
  5. Redistribution and use in source and binary forms, with or without
  6. modification, are permitted provided that the following conditions
  7. are met:
  8. - Redistributions of source code must retain the above copyright
  9. notice, this list of conditions and the following disclaimer.
  10. - Redistributions in binary form must reproduce the above copyright
  11. notice, this list of conditions and the following disclaimer in the
  12. documentation and/or other materials provided with the distribution.
  13. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  14. ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  15. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  16. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
  17. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  21. LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  22. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef UNICODE_SUPPORT_H_INCLUDED
  26. #define UNICODE_SUPPORT_H_INCLUDED
  27. #include <stdio.h>
  28. #include <sys/stat.h>
  29. #define WIN_UNICODE 1
  30. char *utf16_to_utf8(const wchar_t *input);
  31. char *utf16_to_ansi(const wchar_t *input);
  32. wchar_t *utf8_to_utf16(const char *input);
  33. void init_commandline_arguments_utf8(int *argc, char ***argv);
  34. void free_commandline_arguments_utf8(int *argc, char ***argv);
  35. FILE *fopen_utf8(const char *filename_utf8, const char *mode_utf8);
  36. int stat_utf8(const char *path_utf8, struct _stat *buf);
  37. int unlink_utf8(const char *path_utf8);
  38. void init_console_utf8(void);
  39. void uninit_console_utf8(void);
  40. #endif