diff --git a/packages/libjack/fpmake.pp b/packages/libjack/fpmake.pp index 1dfca879e5..6c25d8c2bb 100644 --- a/packages/libjack/fpmake.pp +++ b/packages/libjack/fpmake.pp @@ -44,6 +44,13 @@ begin AddUnit('jack'); end; + T:=P.Targets.AddUnit('jackuuid.pp'); + with T.Dependencies do + begin + AddInclude('uuid.inc'); + AddUnit('jack'); + end; + P.ExamplePath.Add('examples'); P.Targets.AddExampleProgram('simple_client.pp'); P.Targets.AddExampleProgram('latent_client.pp'); diff --git a/packages/libjack/namespaced/Api.Jack.Uuid.pp b/packages/libjack/namespaced/Api.Jack.Uuid.pp new file mode 100644 index 0000000000..b2c32974b6 --- /dev/null +++ b/packages/libjack/namespaced/Api.Jack.Uuid.pp @@ -0,0 +1,3 @@ +unit Api.Jack.Uuid; +{$DEFINE FPC_DOTTEDUNITS} +{$i jackuuid.pp} diff --git a/packages/libjack/namespaces.lst b/packages/libjack/namespaces.lst new file mode 100644 index 0000000000..9f28ba3db6 --- /dev/null +++ b/packages/libjack/namespaces.lst @@ -0,0 +1,5 @@ +src/jack.pp=namespaced/Api.Jack.pp +src/jackringbuffer.pp=namespaced/Api.Jack.RingBuffer.pp +src/jackuuid.pp=namespaced/Api.Jack.Uuid.pp +{s*:src/}=namespaced/ +{i+:src/} diff --git a/packages/libjack/src/jackuuid.pp b/packages/libjack/src/jackuuid.pp new file mode 100644 index 0000000000..82c1107808 --- /dev/null +++ b/packages/libjack/src/jackuuid.pp @@ -0,0 +1,21 @@ +{$IFNDEF FPC_DOTTEDUNITS} +unit jackuuid; +{$ENDIF FPC_DOTTEDUNITS} + +interface + +{$packrecords C} + +uses +{$IFDEF FPC_DOTTEDUNITS} + System.CTypes, Api.Jack; +{$ELSE FPC_DOTTEDUNITS} + ctypes, jack; +{$ENDIF FPC_DOTTEDUNITS} + +{$I uuid.inc} + +implementation + +end. + diff --git a/packages/libjack/src/uuid.inc b/packages/libjack/src/uuid.inc new file mode 100644 index 0000000000..f107a53da0 --- /dev/null +++ b/packages/libjack/src/uuid.inc @@ -0,0 +1,51 @@ +{ + Copyright (C) 2013 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +} + +{$ifndef __jack_uuid_h__} +{$define __jack_uuid_h__} + +//#include + +//#ifdef __cplusplus +//extern "C" { +//#endif + +const + JACK_UUID_SIZE = 36; + JACK_UUID_STRING_SIZE = (JACK_UUID_SIZE+1); { includes trailing null } + JACK_UUID_EMPTY_INITIALIZER = 0; + +function jack_client_uuid_generate: jack_uuid_t; cdecl; external libjack; +function jack_port_uuid_generate (port_id: uint32_t): jack_uuid_t; cdecl; external libjack; + +function jack_uuid_to_index (u: jack_uuid_t): uint32_t; cdecl; external libjack; + +function jack_uuid_compare (u1, u2: jack_uuid_t): cint; cdecl; external libjack; +procedure jack_uuid_copy (dst: Pjack_uuid_t; src: jack_uuid_t); cdecl; external libjack; +procedure jack_uuid_clear (dst: Pjack_uuid_t); cdecl; external libjack; +function jack_uuid_parse (const buf: PChar; dst: Pjack_uuid_t): cint; cdecl; external libjack; +procedure jack_uuid_unparse (src: jack_uuid_t; buf: PChar {[JACK_UUID_STRING_SIZE]}); cdecl; external libjack; +function jack_uuid_empty (src: jack_uuid_t): cint; cdecl; external libjack; + +//#ifdef __cplusplus +//} /* namespace */ +//#endif + +{$endif __jack_uuid_h__} +