From 6a12e04be7ef203d1cd005216df5a538a09c74ef Mon Sep 17 00:00:00 2001 From: oscarl-2 Date: Sun, 16 Nov 2003 08:24:42 +0000 Subject: [PATCH] added missing functions --- .../bepascal/pas/src/be/support/_beep.pp | 19 ++++---- .../bepascal/pas/src/be/support/utf8.pp | 47 +++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 bepascal/source/bepascal/pas/src/be/support/utf8.pp diff --git a/bepascal/source/bepascal/pas/src/be/support/_beep.pp b/bepascal/source/bepascal/pas/src/be/support/_beep.pp index 680d5ae..d62b59a 100644 --- a/bepascal/source/bepascal/pas/src/be/support/_beep.pp +++ b/bepascal/source/bepascal/pas/src/be/support/_beep.pp @@ -1,5 +1,6 @@ -{ BePascal - A pascal wrapper around the BeOS API - Copyright (C) 2002 Olivier Coursiere +{ BePascal - A pascal wrapper around the BeOS API + Copyright (C) 2002-2003 Olivier Coursiere + Oscar Lesta This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -15,17 +16,19 @@ License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA } - unit _beep; interface uses - supportdefs; - - // beep is a simple function. We can link to libbe.so. - // beep__Fv is the mangled name of the function in libbe.so. -function beep : Status_t; cdecl; external 'be' name 'beep__Fv'; + SupportDefs; + +// As the following are simple function, we can link directly to libbe.so. +// beep__Fv is the mangled name of the C function in libbe.so. + +function beep : status_t; cdecl; external 'be' name 'beep__Fv'; +function system_beep(const event_name : PChar) : status_t; cdecl; external 'be' name 'system_beep__FPCc'; +function add_system_beep_event(const event_name : PChar; flags : Longword) : status_t; cdecl; external 'be' name 'add_system_beep_event__FPCcUl'; implementation diff --git a/bepascal/source/bepascal/pas/src/be/support/utf8.pp b/bepascal/source/bepascal/pas/src/be/support/utf8.pp new file mode 100644 index 0000000..e295693 --- /dev/null +++ b/bepascal/source/bepascal/pas/src/be/support/utf8.pp @@ -0,0 +1,47 @@ +// Description: UTF-8 conversion functions. +unit UTF8; + +uses + InterfaceDefs, SupportDefs; + +//------- Conversion Flavors --------------------------------- +const + B_ISO1_CONVERSION = 0; //* ISO 8859-1 + B_ISO2_CONVERSION = 1; //* ISO 8859-2 + B_ISO3_CONVERSION = 2; //* ISO 8859-3 + B_ISO4_CONVERSION = 3; //* ISO 8859-4 + B_ISO5_CONVERSION = 4; //* ISO 8859-5 + B_ISO6_CONVERSION = 5; //* ISO 8859-6 + B_ISO7_CONVERSION = 6; //* ISO 8859-7 + B_ISO8_CONVERSION = 7; //* ISO 8859-8 + B_ISO9_CONVERSION = 8; //* ISO 8859-9 + B_ISO10_CONVERSION = 9; //* ISO 8859-10 + B_MAC_ROMAN_CONVERSION = 10; //* Macintosh Roman + B_SJIS_CONVERSION = 11; //* Shift-JIS + B_EUC_CONVERSION = 12; //* EUC Packed Japanese + B_JIS_CONVERSION = 13; //* JIS X 0208-1990 + B_MS_WINDOWS_CONVERSION = 14; //* MS-Windows Codepage 1252 + B_UNICODE_CONVERSION = 15; //* Unicode 2.0 + B_KOI8R_CONVERSION = 16; //* KOI8-R + B_MS_WINDOWS_1251_CONVERSION = 17; //* MS-Windows Codepage 1251 + B_MS_DOS_866_CONVERSION = 18; //* MS-DOS Codepage 866 + B_MS_DOS_CONVERSION = 19; //* MS-DOS Codepage 437 + B_EUC_KR_CONVERSION = 20; //* EUC Korean + B_ISO13_CONVERSION = 21; //* ISO 8859-13 + B_ISO14_CONVERSION = 22; //* ISO 8859-14 + B_ISO15_CONVERSION = 23; //* ISO 8859-15 + +//------- Conversion Functions -------------------------------- +function convert_to_utf8(srcEncoding : Longword; const src : PChar; + srcLen : Longint; dst : PChar; dstLen : Longint; + state : Longint; substitute : Char = B_SUBSTITUTE) + : status_t; cdecl; external 'be' name 'convert_to_utf8__FUlPCcPlPcT2'; +// : status_t; cdecl; external 'textencoding' name 'convert_to_utf8__FUlPCcPlPcT2T2c'; + +function convert_from_utf8(dstEncoding : Longword; const src : PChar; + srcLen : Longint; dst : PChar; dstLen : Longint; + state : Longint; substitute : Char = B_SUBSTITUTE); + : status_t; cdecl; external 'be' name 'convert_from_utf8__FUlPCcPlPcT2'; +// : status_t; cdecl; external 'textencoding' name 'convert_from_utf8__FUlPCcPlPcT2T2c'; + +end. \ No newline at end of file