* and delete 4 pkgs leftovers, ldap mad modplug dts

git-svn-id: trunk@9969 -
This commit is contained in:
marco 2008-01-26 20:27:05 +00:00
parent 26ce512061
commit 6fb3d9cd7a
19 changed files with 0 additions and 12072 deletions

18
.gitattributes vendored
View File

@ -1098,9 +1098,6 @@ packages/extra/chm/htmlutil.pas svneol=native#text/plain
packages/extra/chm/paslznonslide.pas svneol=native#text/plain
packages/extra/chm/paslzx.pas svneol=native#text/plain
packages/extra/chm/paslzxcomp.pas svneol=native#text/plain
packages/extra/dts/Makefile svneol=native#text/plain
packages/extra/dts/Makefile.fpc svneol=native#text/plain
packages/extra/dts/dts.pas svneol=native#text/plain
packages/extra/fftw/Makefile -text
packages/extra/fftw/Makefile.fpc -text
packages/extra/fftw/example.pas -text
@ -2035,15 +2032,6 @@ packages/extra/imlib/fpmake.inc svneol=native#text/plain
packages/extra/imlib/fpmake.pp svneol=native#text/plain
packages/extra/imlib/gdk_imlib/gdk_imlib.pp svneol=native#text/plain
packages/extra/imlib/imlib/imlib.pp svneol=native#text/plain
packages/extra/ldap/Makefile svneol=native#text/plain
packages/extra/ldap/Makefile.fpc svneol=native#text/plain
packages/extra/ldap/lber.pas svneol=native#text/plain
packages/extra/ldap/lber_typesh.inc svneol=native#text/plain
packages/extra/ldap/lberh.inc svneol=native#text/plain
packages/extra/ldap/ldap.pas svneol=native#text/plain
packages/extra/ldap/ldap_featuresh.inc svneol=native#text/plain
packages/extra/ldap/ldap_schemah.inc svneol=native#text/plain
packages/extra/ldap/ldaph.inc svneol=native#text/plain
packages/extra/libcurl/Makefile svneol=native#text/plain
packages/extra/libcurl/Makefile.fpc svneol=native#text/plain
packages/extra/libcurl/fpmake.inc svneol=native#text/plain
@ -2216,15 +2204,9 @@ packages/extra/lua/fpmake.pp svneol=native#text/plain
packages/extra/lua/lauxlib.pas svneol=native#text/plain
packages/extra/lua/lua.pas svneol=native#text/plain
packages/extra/lua/lualib.pas svneol=native#text/plain
packages/extra/mad/Makefile svneol=native#text/plain
packages/extra/mad/Makefile.fpc svneol=native#text/plain
packages/extra/mad/mad.pas svneol=native#text/plain
packages/extra/matroska/Makefile svneol=native#text/plain
packages/extra/matroska/Makefile.fpc svneol=native#text/plain
packages/extra/matroska/matroska.pas svneol=native#text/plain
packages/extra/modplug/Makefile svneol=native#text/plain
packages/extra/modplug/Makefile.fpc svneol=native#text/plain
packages/extra/modplug/modplug.pas svneol=native#text/plain
packages/extra/newt/Makefile svneol=native#text/plain
packages/extra/newt/Makefile.fpc svneol=native#text/plain
packages/extra/newt/README -text

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Makefile.fpc for A52DEC bindings
#
[package]
name=dts
version=2.0.0
[target]
units=dts
[require]
[install]
fpcpackage=y
[default]
fpcdir=../../..
[rules]
.NOTPARALLEL:

View File

@ -1,529 +0,0 @@
{
Translation of the DTS headers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
(*
* dts.h
* Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
*
* This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder.
* See http://www.videolan.org/dtsdec.html for updates.
*
* dtsdec is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* dtsdec 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 General Public License for more details.
*
* You should have received a copy of the GNU 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
*)
{
Using the libdts API
--------------------
libdts provides a low-level interface to decoding audio frames encoded
using DTS Coherent Acoustics. libdts provides downmixing and
dynamic range compression for the following output configurations:
DTS_CHANNEL : Dual mono. Two independant mono channels.
DTS_CHANNEL1 : First of the two mono channels above.
DTS_CHANNEL2 : Second of the two mono channels above.
DTS_MONO : Mono.
DTS_STEREO : Stereo.
DTS_DOLBY : Dolby surround compatible stereo.
DTS_3F : 3 front channels (left, center, right)
DTS_2F1R : 2 front, 1 rear surround channel (L, R, S)
DTS_3F1R : 3 front, 1 rear surround channel (L, C, R, S)
DTS_2F2R : 2 front, 2 rear surround channels (L, R, LS, RS)
DTS_3F2R : 3 front, 2 rear surround channels (L, C, R, LS, RS)
DTS_LFE : Low frequency effects channel. Normally used to connect a
subwoofer. Can be combined with any of the above channels.
For example: DTS_3F2R | DTS_LFE -> 3 front, 2 rear, 1 LFE (5.1)
Initialization
--------------
dts_state_t * dts_init (uint32_t mm_accel);
Initializes the DTS library. Takes as a parameter the acceptable
optimizations which may be used, such as MMX. These are found in the
included header file 'mm_accel', along with an autodetection function
(mm_accel()). Currently, there is no accelleration implemented.
The return value is a pointer to a dts state object.
Probing the bitstream
---------------------
int dts_syncinfo (uint8_t * buf, int * flags,
int * sample_rate, int * bit_rate, int * frame_length);
The DTS bitstream is composed of several dts frames concatenated one
after each other. A dts frame is the smallest independantly decodable
unit in the stream.
buf must contain at least 14 bytes from the input stream. If these look
like the start of a valid dts frame, dts_syncinfo() returns the size
of the coded frame in bytes, and fills flags, sample_rate, bit_rate and
frame_length with the information encoded in the stream. The returned size
is guaranteed to be an even number between 96 and 16384 for the 16 bits
version of the bitstream and 109 and 18726 for the 14 bits version.
sample_rate will be the sampling frequency in Hz, bit_rate is for the
compressed stream and is in bits per second, and flags is a description of
the coded channels: the DTS_LFE bit is set if there is an LFE channel coded
in this stream, and by masking flags with DTS_CHANNEL_MASK you will get a
value that describes the full-bandwidth channels, as one of the
DTS_CHANNEL...DTS_3F2R flags.
If this can not possibly be a valid frame, then the function returns
0. You should then try to re-synchronize with the dts stream - one way
to try this would be to advance buf by one byte until its contents
looks like a valid frame, but there might be better
application-specific ways to synchronize.
You need to call this function for each frame, for several
reasons: this function detects errors that the other functions will
not double-check, consecutive frames might have different lengths, and
it helps you re-sync with the stream if you get de-synchronized. It will as
well detect the kind of bitstream it is dealing with (big/little endian,
16/14 bits mode)
Starting to decode a frame
--------------------------
int dts_frame (dts_state_t * state, uint8_t * buf, int * flags,
sample_t * level, sample_t bias);
This starts the work of decoding the DTS frame (to be completed using
dts_block()). buf should point to the beginning of the complete frame
of the full size returned by dts_syncinfo().
You should pass in the flags the speaker configuration that you
support, and libdts will return the speaker configuration it will use
for its output, based on what is coded in the stream and what you
asked for. For example, if the stream contains 2+2 channels
(dts_syncinfo() returned DTS_2F2R in the flags), and you have 3+1
speakers (you passed DTS_3F1R), then libdts will choose do downmix to
2+1 speakers, since there is no center channel to send to your center
speaker. So in that case the left and right channels will be
essentially unmodified by the downmix, and the two surround channels
will be added together and sent to your surround speaker. libdts will
return DTS_2F1R to indicate this.
The good news is that when you downmix to stereo you dont have to
worry about this, you will ALWAYS get a stereo output no matter what
was coded in the stream. For more complex output configurations you
will have to handle the case where libdts couldnt give you what you
wanted because some of the channels were not encoded in the stream
though.
Level, bias, and DTS_ADJUST_LEVEL:
Before downmixing, samples are floating point values with a range of
[-1,1]. Most types of downmixing will combine channels together, which
will potentially result in a larger range for the output
samples. libdts provides two methods of controlling the range of the
output, either before or after the downmix stage.
If you do not set DTS_ADJUST_LEVEL, libdts will multiply the samples
by your level value, so that they fit in the [-level,level]
range. Then it will apply the standardized downmix equations,
potentially making the samples go out of that interval again. The
level parameter is not modified.
Setting the DTS_ADJUST_LEVEL flag will instruct libdts to treat your
level value as the intended range interval after downmixing. It will
then figure out what level to use before the downmix (what you should
have passed if you hadnt used the DTS_ADJUST_LEVEL flag), and
overwrite the level value you gave it with that new level value.
The bias represents a value which should be added to the result
regardless:
output_sample = (input_sample * level) + bias;
For example, a bias of 384 and a level of 1 tells liba52 you want
samples between 383 and 385 instead of -1 and 1. This is what the
sample program dtsdec does, as it makes it faster to convert the
samples to integer format, using a trick based on the IEEE
floating-point format.
This function also initialises the state for that frame, which will be
reused next when decoding blocks.
Dynamic range compression
-------------------------
void dts_dynrng (dts_state_t * state,
sample_t (* call) (sample_t, void *), void * data);
This function is purely optional. If you dont call it, libdts will
provide the default behaviour, which is to apply the full dynamic
range compression as specified in the DTS stream. This basically
makes the loud sounds softer, and the soft sounds louder, so you can
more easily listen to the stream in a noisy environment without
disturbing anyone.
If you do call this function and set a NULL callback, this will
totally disable the dynamic range compression and provide a playback
more adapted to a movie theater or a listening room.
If you call this function and specify a callback function, this
callback might be called up to once for each block, with two
arguments: the compression factor 'c' recommended by the bitstream,
and the private data pointer you specified in dts_dynrng(). The
callback will then return the amount of compression to actually use -
typically pow(c,x) where x is somewhere between 0 and 1. More
elaborate compression functions might want to use a different value
for 'x' depending wether c>1 or c<1 - or even something more complex
if this is what you want.
Finding the number of blocks
----------------------------
int dts_blocks_num (dts_state_t * state);
Every DTS frame is composed of a variable number of blocks. Calling
dts_blocks_num() after dts_frame() will give you the number of blocks in the
current frame.
Decoding blocks
---------------
int dts_block (dts_state_t * state);
Every DTS frame is composed of a variable number of blocks, each with an
output of 256 samples for each channel. The dts_block() function decodes
the next block in the frame, and should be called dts_blocks_num() times to
decode all of the audio in the frame.
Getting the decoded audio samples
---------------------------------
sample_t * dts_samples (dts_state_t * state);
After each call to dts_block(), you should extract the audio data from the
internal samples buffer.
This function returns a pointer to an internal buffer which will contain 256
samples for the first channel, followed by 256 samples for the second
channel, etc... the channel order is center, left, right, left
surround, right surround, LFE. If one of the channels is not present in the
libdts output, as indicated by the flags returned by dts_frame(), then
this channel is skipped and the following channels are shifted so
libdts does not leave an empty space between channels.
Pseudocode example
------------------
dts_state_t * state = dts_init (mm_accel());
loop on input bytes:
if at least 14 bytes in the buffer:
bytes_to_get = dts_syncinfo (...)
if bytes_to_get == 0:
goto loop to keep looking for sync point
else
get rest of bytes
dts_frame (state, buf, ...)
[dts_dynrng (state, ...); this is only optional]
for i = 1 ... dts_blocks_num():
dts_block (state)
dts_samples (state)
convert samples to integer and queue to soundcard
}
unit dts;
{$mode objfpc}
{$MINENUMSIZE 4}
interface
uses
ctypes;
{$UNDEF LIBA52_DOUBLE}
{$IFDEF WINDOWS}
{$DEFINE DYNLINK}
{$ENDIF}
{$IFDEF DYNLINK}
const
{$IF Defined(WINDOWS)}
dtslib = 'dts.dll';
{$ELSEIF Defined(UNIX)}
dtslib = 'libdts.so';
{$ELSE}
{$MESSAGE ERROR 'DYNLINK not supported'}
{$IFEND}
{$ELSE}
{$LINKLIB dts}
{$ENDIF}
(* x86 accelerations *)
const
MM_ACCEL_X86_MMX = $80000000;
MM_ACCEL_X86_3DNOW = $40000000;
MM_ACCEL_X86_MMXEXT = $20000000;
function mm_accel: cuint32; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
type
pdts_sample_t = ^dts_sample_t;
{$IF Defined(LIBDTS_FIXED)}
dts_sample_t = cint32;
{$ELSEIF Defined(LIBDTS_DOUBLE)}
dts_sample_t = cdouble;
{$ELSE}
dts_sample_t = cfloat;
{$IFEND}
pdts_level_t = ^dts_level_t;
dts_level_t = dts_sample_t;
pdts_state_t = ^dts_state_t;
dts_state_t = record
end;
dts_dynrng_call = function(s: dts_sample_t; data: pointer): dts_level_t; cdecl;
const
DTS_MONO = 0;
DTS_CHANNEL = 1;
DTS_STEREO = 2;
DTS_STEREO_SUMDIFF = 3;
DTS_STEREO_TOTAL = 4;
DTS_3F = 5;
DTS_2F1R = 6;
DTS_3F1R = 7;
DTS_2F2R = 8;
DTS_3F2R = 9;
DTS_4F2R = 10;
DTS_DOLBY = 101; (* FIXME *)
DTS_CHANNEL_MAX = DTS_3F2R; (* We don't handle anything above that *)
DTS_CHANNEL_BITS = 6;
DTS_CHANNEL_MASK = $3F;
DTS_LFE = $80;
DTS_ADJUST_LEVEL = $100;
function dts_init(mm_accel: cuint32): pdts_state_t; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
function dts_syncinfo(state: pdts_state_t; buf: pcuint8; var flags: cint; var sample_rate: cint; var bit_rate: cint; var frame_length: cint): cint; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
function dts_frame(state: pdts_state_t; buf: pcuint8; var flags: cint; var level: dts_level_t; bias: dts_sample_t): cint; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
procedure dts_dynrng(state: pdts_state_t; call: dts_dynrng_call; data: pointer); cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
function dts_blocks_num(state: pdts_state_t): cint; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
function dts_block(state: pdts_state_t): cint; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
function dts_samples(state: pdts_state_t): pdts_sample_t; cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
procedure dts_free(state: pdts_state_t); cdecl; external {$IFDEF DYNLINK}dtslib{$ENDIF};
{
Developer of the A52 helpers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
type
dts_read_func = function(user: pointer; ptr: pointer; size: cuint): cuint; cdecl;
dts_seek_func = function(user: pointer; offset: clong; whence: cint): clong; cdecl;
dts_close_func = function(user: pointer): cint; cdecl;
dts_tell_func = function(user: pointer): clong; cdecl;
pdts_decoder = ^dts_decoder;
dts_decoder = record
inbuf : array[0..24576-1] of cuint8;
inbuf_ptr : pcuint8;
frame_size : cint;
state : pdts_state_t;
fsamples : pdts_sample_t; // internal samples buffer of dts (returned by dts_samples)
samples : array[0..1,0..6*256-1] of cint16;
samplecnt : cint;
sampleofs : cint;
user : pointer;
read : dts_read_func;
seek : dts_seek_func;
close : dts_close_func;
tell : dts_tell_func;
// Userinfo
flags : cint;
channels : cint;
sample_rate : cint;
bit_rate : cint;
end;
function dts_decoder_init(mm_accel: cuint32; user: pointer; read: dts_read_func; seek: dts_seek_func; close: dts_close_func; tell: dts_tell_func): pdts_decoder;
function dts_decoder_read(decoder: pdts_decoder; buffer: pointer; length: cint): cint;
procedure dts_decoder_free(decoder: pdts_decoder);
implementation
function dts_decoder_init(mm_accel: cuint32; user: pointer; read: dts_read_func; seek: dts_seek_func; close: dts_close_func; tell: dts_tell_func): pdts_decoder;
begin
GetMem(Result, Sizeof(dts_decoder));
FillChar(Result^, Sizeof(dts_decoder), 0);
Result^.state := dts_init(mm_accel);
Result^.fsamples := dts_samples(Result^.state);
Result^.inbuf_ptr := @Result^.inbuf[0];
Result^.user := user;
Result^.read := read;
Result^.seek := seek;
Result^.close := close;
Result^.tell := tell;
end;
procedure dts_decoder_free(decoder: pdts_decoder);
begin
if not Assigned(decoder) then
Exit;
dts_free(decoder^.state);
decoder^.close(decoder^.user);
FreeMem(decoder);
end;
function dts_decoder_read(decoder: pdts_decoder; buffer: pointer; length: cint): cint;
const
HEADER_SIZE = 14;
// ac3_channels: array[0..7] of cint = (2,1,2,3,3,4,4,5);
var
num, ofs: cint;
flags, len, i, j: cint;
sample_rate, bit_rate: cint;
level: dts_sample_t;
begin
// check blocksize here!
ofs := 0;
num := length;
while num > 0 do
begin
if decoder^.samplecnt = 0 then
begin
len := ptrint(decoder^.inbuf_ptr) - ptrint(@decoder^.inbuf);
if (len < HEADER_SIZE) or (len < decoder^.frame_size) then
begin
(* inbuf too small : enlarge *)
len := Sizeof(dts_decoder.inbuf) - len;
len := decoder^.read(decoder^.user, decoder^.inbuf_ptr, len);
if len <= 0 then
Exit(ofs);
Inc(decoder^.inbuf_ptr, len);
end;
if decoder^.frame_size = 0 then
begin
(* no header seen : find one. We need at least 7 bytes to parse it *)
len := dts_syncinfo(decoder^.state, @decoder^.inbuf[0], decoder^.flags, sample_rate, bit_rate, i{dummy});
if len = 0 then
begin
(* no sync found : move by one byte (inefficient, but simple!) *)
Move(decoder^.inbuf[1], decoder^.inbuf[0], ptrint(decoder^.inbuf_ptr) - ptrint(@decoder^.inbuf) - 1);
Dec(decoder^.inbuf_ptr, 1);
end else begin
decoder^.frame_size := len;
(* update codec info *)
decoder^.sample_rate := sample_rate;
decoder^.bit_rate := bit_rate;
{decoder^.channels := ac3_channels[decoder^.flags and $7];
if decoder^.flags and A52_LFE <> 0 then
Inc(decoder^.channels);}
{WriteLn(' frame_size : ', decoder^.frame_size);
WriteLn(' sample_rate : ', sample_rate);
WriteLn(' bit_rate : ', bit_rate);
WriteLn(' channels : ', decoder^.channels);}
end;
Continue;
end;
(* decode the frame *)
flags := DTS_STEREO or DTS_ADJUST_LEVEL;//decoder^.flags;
level := 0;//High(Smallint)-30;
(* FIXME dts_frame dont care on level parameters, so I set it to zero and multiply with High(Smallint) later *)
if dts_frame(decoder^.state, @decoder^.inbuf[0], flags, level, 0) <> 0 then
begin
decoder^.inbuf_ptr := @decoder^.inbuf[0];
decoder^.frame_size := 0;
Continue;
end;
len := dts_blocks_num(decoder^.state);
for i := 0 to len - 1 do
begin
if dts_block(decoder^.state) <> 0 then
begin
decoder^.inbuf_ptr := @decoder^.inbuf[0];
decoder^.frame_size := 0;
Exit(-1);
end;
for j := 0 to 255 do
begin
decoder^.samples[0, i*256+j] := Round(High(Smallint)*decoder^.fsamples[j + 000]);
decoder^.samples[1, i*256+j] := Round(High(Smallint)*decoder^.fsamples[j + 256]);
end;
end;
(* skip decoded frame *)
Move(decoder^.inbuf[decoder^.frame_size], decoder^.inbuf[0], ptrint(decoder^.inbuf_ptr) - ptrint(@decoder^.inbuf) - decoder^.frame_size);
Dec(decoder^.inbuf_ptr, decoder^.frame_size);
decoder^.frame_size := 0;
decoder^.sampleofs := 0;
decoder^.samplecnt := len*256;
end;
len := num div 4;
if len > decoder^.samplecnt then
len := decoder^.samplecnt;
for i := 0 to len - 1 do
begin
pcint16(ptrint(buffer) + ofs + 0)^ := decoder^.samples[0][decoder^.sampleofs];
pcint16(ptrint(buffer) + ofs + 2)^ := decoder^.samples[1][decoder^.sampleofs];
Inc(decoder^.sampleofs);
Dec(decoder^.samplecnt);
ofs := ofs + 4;
num := num - 4;
end;
end;
Result := ofs;
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
#
# Makefile.fpc for LDAP bindings
#
[package]
name=ldap
version=2.0.0
[target]
units=lber ldap
[require]
packages=hash
[install]
fpcpackage=y
[default]
fpcdir=../../..
[rules]
.NOTPARALLEL:

View File

@ -1,99 +0,0 @@
{
Translation of the LDAP lber headers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
unit lber;
{$mode objfpc}
interface
{$linklib lber}
{$include lber_typesh.inc}
{$include lberh.inc}
implementation
function LBER_INVALID(t: ber_tag_t): ber_tag_t;
// #define LBER_INVALID(t) (((t) & (ber_tag_t) = $080UL) && (((t) & (ber_tag_t) ~ = $0FF))
begin
LBER_INVALID := (t and $80) and (t and $FF);
end;
function LBER_OPT_ON: Pointer;
// #define LBER_OPT_ON ((void *) &ber_pvt_opt_on)
begin
LBER_OPT_ON := @ber_pvt_opt_on;
end;
function LBER_SBIOD_READ_NEXT(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t;
// #define LBER_SBIOD_READ_NEXT( sbiod, buf, len ) ( (sbiod)->sbiod_next->sbiod_io->sbi_read( (sbiod)->sbiod_next, buf, len ) )
begin
LBER_SBIOD_READ_NEXT := sbiod^.sbiod_next^.sbiod_io^.sbi_read(sbiod^.sbiod_next, buf, len);
end;
function LBER_SBIOD_WRITE_NEXT(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t;
// #define LBER_SBIOD_WRITE_NEXT( sbiod, buf, len ) ( (sbiod)->sbiod_next->sbiod_io->sbi_write( (sbiod)->sbiod_next, buf, len ) )
begin
LBER_SBIOD_WRITE_NEXT := sbiod^.sbiod_next^.sbiod_io^.sbi_write(sbiod^.sbiod_next, buf, len);
end;
function LBER_SBIOD_CTRL_NEXT(sbiod: PSockbuf_IO_Desc; opt: cint; arg: Pointer): cint;
// #define LBER_SBIOD_CTRL_NEXT( sbiod, opt, arg ) ( (sbiod)->sbiod_next ? ( (sbiod)->sbiod_next->sbiod_io->sbi_ctrl( (sbiod)->sbiod_next, opt, arg ) ) : 0 )
begin
if Assigned(sbiod^.sbiod_next) then
LBER_SBIOD_CTRL_NEXT := sbiod^.sbiod_next^.sbiod_io^.sbi_ctrl(sbiod^.sbiod_next, opt, arg) else
LBER_SBIOD_CTRL_NEXT := 0;
end;
function ber_bvstr(const str: pcchar): PBerval;
begin
ber_bvstr := ber_str2bv(str, 0, false, nil);
end;
function ber_bvstrdup(const str: pcchar): PBerval;
begin
ber_bvstrdup := ber_str2bv(str, 0, true, nil);
end;
function memcmp(p1, p2: Pointer; len: cint): cint;
var
I: cint;
begin
for I := 0 to len -1 do
begin
if pbyte(p1)^ < pbyte(p2)^ then
begin
memcmp := -1;
Exit;
end;
if pbyte(p1)^ > pbyte(p2)^ then
begin
memcmp := 1;
Exit;
end;
inc(p1, 1);
inc(p2, 1);
end;
memcmp := 0;
end;
function ber_bvcmp(v1, v2: PBerval): cint;
// #define ber_bvcmp(v1,v2) ((v1)->bv_len < (v2)->bv_len ? -1 : ((v1)->bv_len > (v2)->bv_len ? 1 : memcmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
begin
if v1^.bv_len < v2^.bv_len then ber_bvcmp := -1 else
if v1^.bv_len > v2^.bv_len then ber_bvcmp := 1 else
ber_bvcmp := memcmp(v1^.bv_val, v2^.bv_val, v1^.bv_len);
end;
function ber_errno: cint;
begin
ber_errno := ber_errno_addr^;
end;
end.

View File

@ -1,67 +0,0 @@
(* include/lber_types.h. Generated by configure. *)
(* $OpenLDAP: pkg/ldap/include/lber_types.h.in,v 1.10.2.3 2005/01/20 17:00:58 kurt Exp $ *)
(* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*)
(*
* LBER types
*)
uses
ctypes;
type
ppcchar = ^pcchar;
pppcchar = ^ppcchar;
(* LBER Boolean, enum, integers (32 bits or larger) *)
LBER_INT_T = cint;
(* LBER tags (32 bits or larger) *)
LBER_TAG_T = clong;
(* LBER socket descriptor *)
LBER_SOCKET_T = cint;
(* LBER lengths (32 bits or larger) *)
LBER_LEN_T = clong;
(* ------------------------------------------------------------ *)
(* Booleans, enumerations, and integers *)
pber_int_t = ^ber_int_t;
ber_int_t = cint; // LBER_INT_T;
(* signed and unsigned versions *)
pber_sint_t = ^ber_sint_t;
ber_sint_t = csint; // signed LBER_INT_T
pber_uint_t = ^ber_uint_t;
ber_uint_t = cuint; // unsigned LBER_INT_T
(* tags *)
pber_tag_t = ^ber_tag_t;
ber_tag_t = culong; // unsigned LBER_TAG_T
(* "socket" descriptors *)
pber_socket_t = ^ber_socket_t;
ber_socket_t = cint; // LBER_SOCKET_T
(* lengths *)
pber_len_t = ^ber_len_t;
ber_len_t = culong; // unsigned LBER_LEN_T
(* signed lengths *)
pber_slen_t = ^ber_slen_t;
ber_slen_t = clong; // signed LBER_LEN_T;

View File

@ -1,427 +0,0 @@
(* $OpenLDAP: pkg/ldap/include/lber.h,v 1.83.2.11 2005/01/20 17:00:58 kurt Exp $ *)
(* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*)
(* Portions Copyright (c) 1990 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*)
(* Overview of LBER tag construction
*
* Bits
* ______
* 8 7 | CLASS
* 0 0 = UNIVERSAL
* 0 1 = APPLICATION
* 1 0 = CONTEXT-SPECIFIC
* 1 1 = PRIVATE
* _____
* | 6 | DATA-TYPE
* 0 = PRIMITIVE
* 1 = CONSTRUCTED
* ___________
* | 5 ... 1 | TAG-NUMBER
*)
const
(* BER classes and mask *)
LBER_CLASS_UNIVERSAL = ber_tag_t($00);
LBER_CLASS_APPLICATION = ber_tag_t($40);
LBER_CLASS_CONTEXT = ber_tag_t($80);
LBER_CLASS_PRIVATE = ber_tag_t($c0);
LBER_CLASS_MASK = ber_tag_t($c0);
(* BER encoding type and mask *)
LBER_PRIMITIVE = ber_tag_t($00);
LBER_CONSTRUCTED = ber_tag_t($20);
LBER_ENCODING_MASK = ber_tag_t($20);
LBER_BIG_TAG_MASK = ber_tag_t($1f);
LBER_MORE_TAG_MASK = ber_tag_t($80);
(*
* Note that LBER_ERROR and LBER_DEFAULT are values that can never appear
* as valid BER tags, and so it is safe to use them to report errors. In
* fact, any tag for which the following is true is invalid:
*)
function LBER_INVALID(t: ber_tag_t): ber_tag_t;
const
LBER_ERROR = ber_tag_t(-1);
LBER_DEFAULT = ber_tag_t(-1);
(* general BER types we know about *)
LBER_BOOLEAN = ber_tag_t($01);
LBER_INTEGER = ber_tag_t($02);
LBER_BITSTRING = ber_tag_t($03);
LBER_OCTETSTRING = ber_tag_t($04);
LBER_NULL = ber_tag_t($05);
LBER_ENUMERATED = ber_tag_t($0a);
LBER_SEQUENCE = ber_tag_t($30); (* constructed *)
LBER_SET = ber_tag_t($31); (* constructed *)
(* LBER BerElement options *)
LBER_USE_DER = $01;
(* get/set options for BerElement *)
LBER_OPT_BER_OPTIONS = $01;
LBER_OPT_BER_DEBUG = $02;
LBER_OPT_BER_REMAINING_BYTES = $03;
LBER_OPT_BER_TOTAL_BYTES = $04;
LBER_OPT_BER_BYTES_TO_WRITE = $05;
LBER_OPT_BER_MEMCTX = $06;
LBER_OPT_DEBUG_LEVEL = LBER_OPT_BER_DEBUG;
LBER_OPT_REMAINING_BYTES = LBER_OPT_BER_REMAINING_BYTES;
LBER_OPT_TOTAL_BYTES = LBER_OPT_BER_TOTAL_BYTES;
LBER_OPT_BYTES_TO_WRITE = LBER_OPT_BER_BYTES_TO_WRITE;
LBER_OPT_LOG_PRINT_FN = $8001;
LBER_OPT_MEMORY_FNS = $8002;
LBER_OPT_ERROR_FN = $8003;
LBER_OPT_LOG_PRINT_FILE = $8004;
(* get/set Memory Debug options *)
LBER_OPT_MEMORY_INUSE = $8005; (* for memory debugging *)
LBER_OPT_LOG_PROC = $8006; (* for external logging function *)
type
BER_ERRNO_FN = function: pcint; cdecl;
BER_LOG_PRINT_FN = procedure(const buf: pcchar); cdecl;
BER_MEMALLOC_FN = function(size: ber_len_t): Pointer; cdecl;
BER_MEMCALLOC_FN = function(n: ber_len_t; size: ber_len_t): Pointer; cdecl;
BER_MEMREALLOC_FN = function(p: Pointer; size: ber_len_t): Pointer; cdecl;
BER_MEMFREE_FN = function(p: Pointer): Pointer; cdecl;
plber_memory_fns = ^lber_memory_fns;
lber_memory_fns = record
bmf_malloc : BER_MEMALLOC_FN;
bmf_calloc : BER_MEMCALLOC_FN;
bmf_realloc : BER_MEMREALLOC_FN;
bmf_free : BER_MEMFREE_FN;
end;
PBerMemoryFunctions = ^BerMemoryFunctions;
BerMemoryFunctions = lber_memory_fns;
const
(* LBER Sockbuf_IO options *)
LBER_SB_OPT_GET_FD = 1;
LBER_SB_OPT_SET_FD = 2;
LBER_SB_OPT_HAS_IO = 3;
LBER_SB_OPT_SET_NONBLOCK = 4;
LBER_SB_OPT_GET_SSL = 7;
LBER_SB_OPT_DATA_READY = 8;
LBER_SB_OPT_SET_READAHEAD = 9;
LBER_SB_OPT_DRAIN = 10;
LBER_SB_OPT_NEEDS_READ = 11;
LBER_SB_OPT_NEEDS_WRITE = 12;
LBER_SB_OPT_GET_MAX_INCOMING = 13;
LBER_SB_OPT_SET_MAX_INCOMING = 14;
(* Largest option used by the library *)
LBER_SB_OPT_OPT_MAX = 14;
(* LBER IO operations stacking levels *)
LBER_SBIOD_LEVEL_PROVIDER = 10;
LBER_SBIOD_LEVEL_TRANSPORT = 20;
LBER_SBIOD_LEVEL_APPLICATION = 30;
(* get/set options for Sockbuf *)
LBER_OPT_SOCKBUF_DESC = $1000;
LBER_OPT_SOCKBUF_OPTIONS = $1001;
LBER_OPT_SOCKBUF_DEBUG = $1002;
LBER_OPT_SUCCESS = 0;
LBER_OPT_ERROR = -1;
(* on/off values *)
const
LBER_OPT_OFF = Pointer(0);
var
ber_pvt_opt_on: cchar; cvar; external;
function LBER_OPT_ON: Pointer;
(* Structure for LBER IO operarion descriptor *)
type
PBerElement = Pointer;
PSockbuf = Pointer;
PSeqorset = Pointer;
PSockbuf_IO = ^Sockbuf_IO;
PSockbuf_IO_Desc = ^Sockbuf_IO_Desc;
Sockbuf_IO_Desc = record
sbiod_level : cint;
sbiod_sb : PSockbuf;
sbiod_io : PSockbuf_IO;
sbiod_pvt : Pointer;
sbiod_next : PSockbuf_IO_Desc;
end;
(* Structure for LBER IO operation functions *)
Sockbuf_IO = record
sbi_setup : function(sbiod: PSockbuf_IO_Desc; arg: Pointer): cint; cdecl;
sbi_remove : function(sbiod: PSockbuf_IO_Desc): cint; cdecl;
sbi_ctrl : function(sbiod: PSockbuf_IO_Desc; opt: cint; arg: Pointer): cint; cdecl;
sbi_read : function(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t; cdecl;
sbi_write : function(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t; cdecl;
sbi_close : function(sbiod: PSockbuf_IO_Desc): cint; cdecl;
end;
(* Helper macros for LBER IO functions *)
function LBER_SBIOD_READ_NEXT(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t;
function LBER_SBIOD_WRITE_NEXT(sbiod: PSockbuf_IO_Desc; buf: Pointer; len: ber_len_t): ber_slen_t;
function LBER_SBIOD_CTRL_NEXT(sbiod: PSockbuf_IO_Desc; opt: cint; arg: Pointer): cint;
(* structure for returning a sequence of octet strings + length *)
type
PPPBerval = ^PPBerval;
PPBerval = ^PBerval;
PBerval = ^Berval;
Berval = record
bv_len : ber_len_t;
bv_val : pcchar;
end;
PBerVarray = ^BerVarray;
BerVarray = ^PBerval; (* To distinguish from a single bv *)
(* this should be moved to lber-cint.h *)
(*
* in bprint.c:
*)
procedure ber_error_print(const data: pcchar); cdecl; external;
procedure ber_bprint(const data: pcchar; len: ber_len_t); cdecl; external;
procedure ber_dump(ber: PBerElement; inout : cint); cdecl; external;
procedure ber_sos_dump(sos: PSeqorset); cdecl; external;
(*
* in decode.c:
*)
type
BERDecodeCallback = function(ber: PBerElement; data: Pointer; mode: cint): cint; cdecl;
function ber_get_tag(ber: PBerElement): ber_tag_t; cdecl; external;
function ber_skip_tag(ber: PBerElement; var len: ber_len_t): ber_tag_t; cdecl; external;
function ber_peek_tag(ber: PBerElement; var len: ber_len_t): ber_tag_t; cdecl; external;
function ber_get_int(ber: PBerElement; var num: ber_int_t): ber_tag_t; cdecl; external;
function ber_get_enum(ber: PBerElement; var num: ber_int_t): ber_tag_t; cdecl; external;
function ber_get_stringb(ber: PBerElement; buf: pcchar; var len: ber_len_t): ber_tag_t; cdecl; external;
function ber_get_stringbv(ber: PBerElement; bv: PBerval; alloc: cbool): ber_tag_t; cdecl; external;
function ber_get_stringa(ber: PBerElement; var buf: pcchar): ber_tag_t; cdecl; external;
function ber_get_stringal(ber: PBerElement; var bv: PBerval): ber_tag_t; cdecl; external;
function ber_get_bitstringa(ber: PBerElement; var buf: pcchar; var len: ber_len_t): ber_tag_t; cdecl; external;
function ber_get_null(ber: PBerElement): ber_tag_t; cdecl; external;
function ber_get_Boolean(ber: PBerElement; var boolval: ber_int_t): ber_tag_t; cdecl; external;
function ber_first_element(ber: PBerElement; var len: ber_len_t; var last: pcchar): ber_tag_t; cdecl; external;
function ber_next_element(ber: PBerElement; var len: ber_len_t; const last: pcchar): ber_tag_t; cdecl; external;
function ber_scanf(ber: PBerElement;const fmt: pcchar): ber_tag_t; cdecl; varargs; external;
(*
* in encode.c
*)
type
BEREncodeCallback = function(ber: PBerElement; data: Pointer): cint;
function ber_put_enum(ber: PBerElement; num: ber_int_t; tag: ber_tag_t): cint; cdecl; external;
function ber_put_int(ber: PBerElement; num: ber_int_t; tag: ber_tag_t): cint; cdecl; external;
function ber_put_ostring(ber: PBerElement; const str: pcchar; len: ber_len_t; tag: ber_tag_t): cint; cdecl; external;
function ber_put_berval(ber: PBerElement; bv: PBerval; tag: ber_tag_t): cint; cdecl; external;
function ber_put_string(ber: PBerElement; const str: pcchar; tag: ber_tag_t): cint; cdecl; external;
function ber_put_bitstring(ber: PBerElement; const str: pcchar; bitlen: ber_len_t; tag: ber_tag_t): cint; cdecl; external;
function ber_put_null(ber: PBerElement; tag: ber_tag_t): cint; cdecl; external;
function ber_put_boolean(ber: PBerElement; boolval: ber_int_t; tag: ber_tag_t): cint; cdecl; external;
function ber_start_seq(ber: PBerElement; tag: ber_tag_t): cint; cdecl; external;
function ber_start_set(ber: PBerElement; tag: ber_tag_t): cint; cdecl; external;
function ber_put_seq(ber: PBerElement): cint; cdecl; external;
function ber_put_set(ber: PBerElement): cint; cdecl; external;
function ber_printf(ber: PBerElement; const fmt: pcchar): cint; cdecl; varargs; external;
(*
* in io.c:
*)
function ber_read(ber: PBerElement; buf: pcchar; len: ber_len_t): ber_slen_t; cdecl; external;
function ber_write(ber: PBerElement; const buf: pcchar; len: ber_len_t; nosos: cint): ber_slen_t; cdecl; external;
procedure ber_free(ber: PBerElement; freebuf: cbool); cdecl; external;
procedure ber_free_buf(ber: PBerElement); cdecl; external;
function ber_flush(sb: PSockbuf; ber: PBerElement; freeit: cbool): cint; cdecl; external;
function ber_alloc: PBerElement; cdecl; external; deprecated;
function der_alloc: PBerElement; cdecl; external; deprecated;
function ber_alloc_t(beroptions: cint): PBerElement; cdecl; external;
function ber_dup(ber: PBerElement): PBerElement; cdecl; external;
function ber_get_next(sb: PSockbuf; var len: ber_len_t; ber: PBerElement): ber_tag_t; cdecl; external;
procedure ber_init2(ber: PBerElement; bv: PBerval; options: cint); cdecl; external;
procedure ber_init_w_nullc(ber: PBerElement; options: cint); cdecl; external; deprecated;
procedure ber_reset(ber: PBerElement; was_writing: cbool); cdecl; external;
function ber_init(bv: PBerval): PBerElement; cdecl; external;
function ber_flatten(ber: PBerElement; var bvPtr: PBerval): cint; cdecl; external;
function ber_flatten2(ber: PBerElement; bv: PBerval; alloc: cbool): cint; cdecl; external;
function ber_remaining(ber: PBerElement): cint; cdecl; external;
(*
* LBER ber accessor functions
*)
function ber_get_option(item: Pointer; option: cint; outvalue: Pointer): cint; cdecl; external;
function ber_set_option(item: Pointer; option: cint; const invalue: Pointer): cint; cdecl; external;
(*
* LBER sockbuf.c
*)
function ber_sockbuf_alloc: PSockbuf; cdecl; external;
procedure ber_sockbuf_free(sb: PSockbuf); cdecl; external;
function ber_sockbuf_add_io(sb: PSockbuf; sbio: PSockbuf_IO; layer: cint; arg: Pointer): cint; cdecl; external;
function ber_sockbuf_remove_io(sb: PSockbuf; sbio: PSockbuf_IO; layer: cint): cint; cdecl; external;
function ber_sockbuf_ctrl(sb: PSockbuf; opt: cint; arg: Pointer): cint; cdecl; external;
var
ber_sockbuf_io_tcp : Sockbuf_IO; cvar; external;
ber_sockbuf_io_readahead : Sockbuf_IO; cvar; external;
ber_sockbuf_io_fd : Sockbuf_IO; cvar; external;
ber_sockbuf_io_debug : Sockbuf_IO; cvar; external;
{$IFDEF LDAP_CONNECTIONLESS}
ber_sockbuf_io_udp : Sockbuf_IO; cvar; external;
{$ENDIF}
(*
* LBER memory.c
*)
function ber_memalloc(s: ber_len_t): Pointer; cdecl; external;
function ber_memrealloc(p: Pointer; s: ber_len_t): Pointer; cdecl; external;
function ber_memcalloc(n: ber_len_t; s: ber_len_t): Pointer; cdecl; external;
procedure ber_memfree(p: Pointer); cdecl; external;
procedure ber_memvfree(vector: PPointer); cdecl; external;
procedure ber_bvfree(bv: PBerval); cdecl; external;
procedure ber_bvecfree(bv: PPBerval); cdecl; external;
function ber_bvecadd(var bvec: PPBerval; bv: PBerval): cint; cdecl; external;
function ber_dupbv(dst: PBerval; src: PBerval): PBerval; cdecl; external;
function ber_bvdup(src: PBerval): PBerval; cdecl; external;
function ber_str2bv(const str: pcchar; len: ber_len_t; duplicate: cbool; bv: PBerval): PBerval; cdecl; external;
function ber_mem2bv(const str: pcchar; len: ber_len_t; duplicate: cbool; bv: PBerval): PBerval; cdecl; external;
function ber_bvstr(const str: pcchar): PBerval;
function ber_bvstrdup(const str: pcchar): PBerval;
function ber_strdup(const str: pcchar): pcchar; cdecl; external;
procedure ber_bvarray_free(p: BerVarray); cdecl; external;
function ber_bvarray_add(p: PBerVarray; bv: PBerval): cint; cdecl; external;
function ber_bvcmp(v1, v2: PBerval): cint;
(*
* error.c
*)
function ber_errno_addr: pcint; cdecl; external;
function ber_errno: cint;
const
LBER_ERROR_NONE = $0;
LBER_ERROR_PARAM = $1;
LBER_ERROR_MEMORY = $2;

View File

@ -1,78 +0,0 @@
{
Translation of the LDAP headers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
unit ldap;
{$mode objfpc}
interface
uses
ctypes,
lber;
{$linklib ldap}
{$include ldap_featuresh.inc}
{$include ldap_schemah.inc}
{$include ldaph.inc}
implementation
function LDAP_OPT_ON: Pointer;
// #define LDAP_OPT_ON ((void *) &ber_pvt_opt_on)
begin
LDAP_OPT_ON := @ber_pvt_opt_on;
end;
function LDAP_RANGE(n, x, y: ber_int_t): Boolean;
// #define LDAP_RANGE(n,x,y) (((x) <= (n)) && ((n) <= (y)))
begin
LDAP_RANGE := (x <= n) and (n <= y);
end;
function LDAP_ATTR_ERROR(n: ber_int_t): Boolean;
// #define LDAP_ATTR_ERROR(n) LDAP_RANGE((n),0x10,0x15) (* 16-21 *)
begin
LDAP_ATTR_ERROR := LDAP_RANGE(n, $10, $15);
end;
function LDAP_NAME_ERROR(n: ber_int_t): Boolean;
// #define LDAP_NAME_ERROR(n) LDAP_RANGE((n),0x20,0x24) (* 32-34,36 *)
begin
LDAP_NAME_ERROR := LDAP_RANGE(n, $20, $24);
end;
function LDAP_SECURITY_ERROR(n: ber_int_t): Boolean;
// #define LDAP_SECURITY_ERROR(n) LDAP_RANGE((n),0x2F,0x32) (* 47-50 *)
begin
LDAP_SECURITY_ERROR := LDAP_RANGE(n, $2F, $32);
end;
function LDAP_SERVICE_ERROR(n: ber_int_t): Boolean;
// #define LDAP_SERVICE_ERROR(n) LDAP_RANGE((n),0x33,0x36) (* 51-54 *)
begin
LDAP_SERVICE_ERROR := LDAP_RANGE(n, $33, $36);
end;
function LDAP_UPDATE_ERROR(n: ber_int_t): Boolean;
// #define LDAP_UPDATE_ERROR(n) LDAP_RANGE((n),0x40,0x47) (* 64-69,71 *)
begin
LDAP_UPDATE_ERROR := LDAP_RANGE(n, $40, $47);
end;
function LDAP_API_ERROR(n: ber_int_t): Boolean;
// #define LDAP_API_ERROR(n) LDAP_RANGE((n),0x51,0x61) (* 81-97 *)}
begin
LDAP_API_ERROR := n < 0;
end;
function LDAP_API_RESULT(n: ber_int_t): Boolean;
// #define LDAP_API_RESULT(n) (((n) == LDAP_SUCCESS) || LDAP_RANGE((n),0x51,0x61)) (* 0,81-97 *)
begin
LDAP_API_RESULT := n <= 0;
end;
end.

View File

@ -1,59 +0,0 @@
(* include/ldap_features.h. Generated automatically by configure. *)
(* $OpenLDAP: pkg/ldap/include/ldap_features.h.in,v 1.13.2.1 2003/02/09 17:02:17 kurt Exp $ *)
(*
* Copyright 1998-2003 The OpenLDAP Foundation, Redwood City, California, USA
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License. A copy of this license is available at
* http://www.OpenLDAP.org/license.html or in file LICENSE in the
* top-level directory of the distribution.
*)
(*
* LDAP Features
*)
(* OpenLDAP API version macros *)
const
LDAP_VENDOR_VERSION = 20228;
LDAP_VENDOR_VERSION_MAJOR = 2;
LDAP_VENDOR_VERSION_MINOR = 2;
LDAP_VENDOR_VERSION_PATCH = 28;
(*
** WORK IN PROGRESS!
**
** OpenLDAP reentrancy/thread-safeness should be dynamically
** checked using ldap_get_option().
**
** The -lldap implementation is not thread-safe.
**
** The -lldap_r implementation is:
** LDAP_API_FEATURE_THREAD_SAFE (basic thread safety)
** but also be:
** LDAP_API_FEATURE_SESSION_THREAD_SAFE
** LDAP_API_FEATURE_OPERATION_THREAD_SAFE
**
** The preprocessor flag LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
** can be used to determine if -lldap_r is available at compile
** time. You must define LDAP_THREAD_SAFE if and only if you
** link with -lldap_r.
**
** If you fail to define LDAP_THREAD_SAFE when linking with
** -lldap_r or define LDAP_THREAD_SAFE when linking with -lldap,
** provided header definations and declarations may be incorrect.
**
*)
(* is -lldap_r available or not *)
{$DEFINE LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE}
(* LDAP v2 Kerberos Bind *)
//{$UNDEF LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND}
(* LDAP v2 Referrals *)
//{$UNDEF LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS}

View File

@ -1,255 +0,0 @@
(* $OpenLDAP: pkg/ldap/include/ldap_schema.h,v 1.32.2.3 2005/01/20 17:00:59 kurt Exp $ *)
(* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*)
(* ldap-schema.h - Header for basic schema handling functions that can be
* used by both clients and servers.
* these routines should be renamed ldap_x_...
*)
(* Codes for parsing errors *)
const
LDAP_SCHERR_OUTOFMEM = 1;
LDAP_SCHERR_UNEXPTOKEN = 2;
LDAP_SCHERR_NOLEFTPAREN = 3;
LDAP_SCHERR_NORIGHTPAREN = 4;
LDAP_SCHERR_NODIGIT = 5;
LDAP_SCHERR_BADNAME = 6;
LDAP_SCHERR_BADDESC = 7;
LDAP_SCHERR_BADSUP = 8;
LDAP_SCHERR_DUPOPT = 9;
LDAP_SCHERR_EMPTY = 10;
LDAP_SCHERR_MISSING = 11;
LDAP_SCHERR_OUT_OF_ORDER = 12;
type
pldap_schema_extension_item = ^ldap_schema_extension_item;
ldap_schema_extension_item = record
lsei_name : pcchar;
lsei_values : ppcchar;
end;
PPLDAPSchemaExtensionItem = ^PLDAPSchemaExtensionItem;
PLDAPSchemaExtensionItem = ^LDAPSchemaExtensionItem;
LDAPSchemaExtensionItem = ldap_schema_extension_item;
pldap_syntax = ^ldap_syntax;
ldap_syntax = record
syn_oid : pcchar; (* REQUIRED *)
syn_names : ppcchar; (* OPTIONAL *)
syn_desc : pcchar; (* OPTIONAL *)
syn_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPSyntax = ^ldap_syntax;
LDAPSyntax = ldap_syntax;
pldap_matchingrule = ^ldap_matchingrule;
ldap_matchingrule = record
mr_oid : pcchar; (* REQUIRED *)
mr_names : ppcchar; (* OPTIONAL *)
mr_desc : pcchar; (* OPTIONAL *)
mr_obsolete : cint; (* OPTIONAL *)
mr_syntax_oid : pcchar; (* REQUIRED *)
mr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPMatchingRule = ^LDAPMatchingRule;
LDAPMatchingRule = ldap_matchingrule;
pldap_matchingruleuse = ^ldap_matchingruleuse;
ldap_matchingruleuse = record
mru_oid : pcchar; (* REQUIRED *)
mru_names : ppcchar; (* OPTIONAL *)
mru_desc : pcchar; (* OPTIONAL *)
mru_obsolete : cint; (* OPTIONAL *)
mru_applies_oids: ppcchar; (* REQUIRED *)
mru_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPMatchingRuleUse = ^LDAPMatchingRuleUse;
LDAPMatchingRuleUse = ldap_matchingruleuse;
pldap_attributetype = ^ldap_attributetype;
ldap_attributetype = record
at_oid : pcchar; (* REQUIRED *)
at_names : ppcchar; (* OPTIONAL *)
at_desc : pcchar; (* OPTIONAL *)
at_obsolete : cint; (* 0=no, 1=yes *)
at_sup_oid : pcchar; (* OPTIONAL *)
at_equality_oid : pcchar; (* OPTIONAL *)
at_ordering_oid : pcchar; (* OPTIONAL *)
at_substr_oid : pcchar; (* OPTIONAL *)
at_syntax_oid : pcchar; (* OPTIONAL *)
at_syntax_len : cint; (* OPTIONAL *)
at_single_value : cint; (* 0=no, 1=yes *)
at_collective : cint; (* 0=no, 1=yes *)
at_no_user_mod : cint; (* 0=no, 1=yes *)
at_usage : cint; (* 0=userApplications, 1=directoryOperation, 2=distributedOperation, 3=dSAOperation *)
at_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPAttributeType = ^LDAPAttributeType;
LDAPAttributeType = ldap_attributetype;
pldap_objectclass = ^ldap_objectclass;
ldap_objectclass = record
oc_oid : pcchar; (* REQUIRED *)
oc_names : ppcchar; (* OPTIONAL *)
oc_desc : pcchar; (* OPTIONAL *)
oc_obsolete : cint; (* 0=no, 1=yes *)
oc_sup_oids : ppcchar; (* OPTIONAL *)
oc_kind : cint; (* 0=ABSTRACT, 1=STRUCTURAL, 2=AUXILIARY *)
oc_at_oids_must : ppcchar; (* OPTIONAL *)
oc_at_oids_may : ppcchar; (* OPTIONAL *)
oc_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPObjectClass = ^LDAPObjectClass;
LDAPObjectClass = ldap_objectclass;
pldap_contentrule = ^ldap_contentrule;
ldap_contentrule = record
cr_oid : pcchar; (* REQUIRED *)
cr_names : ppcchar; (* OPTIONAL *)
cr_desc : pcchar; (* OPTIONAL *)
cr_sup_oids : ppcchar; (* OPTIONAL *)
cr_obsolete : cint; (* 0=no, 1=yes *)
cr_oc_oids_aux : ppcchar; (* OPTIONAL *)
cr_at_oids_must : ppcchar; (* OPTIONAL *)
cr_at_oids_may : ppcchar; (* OPTIONAL *)
cr_at_oids_not : ppcchar; (* OPTIONAL *)
cr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPContentRule = ^LDAPContentRule;
LDAPContentRule = ldap_contentrule;
pldap_nameform = ^ldap_nameform;
ldap_nameform = record
nf_oid : pcchar; (* REQUIRED *)
nf_names : ppcchar; (* OPTIONAL *)
nf_desc : pcchar; (* OPTIONAL *)
nf_obsolete : cint; (* 0=no, 1=yes *)
nf_objectclass : pcchar; (* REQUIRED *)
nf_at_oids_must : ppcchar; (* REQUIRED *)
nf_at_oids_may : ppcchar; (* OPTIONAL *)
nf_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPNameForm = ^LDAPNameForm;
LDAPNameForm = ldap_nameform;
pldap_structurerule = ^ldap_structurerule;
ldap_structurerule = record
sr_ruleid : cint; (* REQUIRED *)
sr_names : ppcchar; (* OPTIONAL *)
sr_desc : pcchar; (* OPTIONAL *)
sr_obsolete : cint; (* 0=no, 1=yes *)
sr_nameform : pcchar; (* REQUIRED *)
sr_nsup_ruleids : cint; (* number of sr_sup_ruleids *)
sr_sup_ruleids : pcint; (* OPTIONAL *)
sr_extensions : PPLDAPSchemaExtensionItem; (* OPTIONAL *)
end;
PLDAPStructureRule = ^LDAPStructureRule;
LDAPStructureRule = ldap_structurerule;
(*
* Misc macros
*)
const
LDAP_SCHEMA_NO = 0;
LDAP_SCHEMA_YES = 1;
LDAP_SCHEMA_USER_APPLICATIONS = 0;
LDAP_SCHEMA_DIRECTORY_OPERATION = 1;
LDAP_SCHEMA_DISTRIBUTED_OPERATION = 2;
LDAP_SCHEMA_DSA_OPERATION = 3;
LDAP_SCHEMA_ABSTRACT = 0;
LDAP_SCHEMA_STRUCTURAL = 1;
LDAP_SCHEMA_AUXILIARY = 2;
(*
* Flags that control how liberal the parsing routines are.
*)
const
LDAP_SCHEMA_ALLOW_NONE = $00; (* Strict parsing *)
LDAP_SCHEMA_ALLOW_NO_OID = $01; (* Allow missing oid *)
LDAP_SCHEMA_ALLOW_QUOTED = $02; (* Allow bogus extra quotes *)
LDAP_SCHEMA_ALLOW_DESCR = $04; (* Allow descr instead of OID *)
LDAP_SCHEMA_ALLOW_DESCR_PREFIX = $08; (* Allow descr as OID prefix *)
LDAP_SCHEMA_ALLOW_OID_MACRO = $10; (* Allow OID macros in slapd *)
LDAP_SCHEMA_ALLOW_OUT_OF_ORDER_FIELDS = $20; (* Allow fields in most any order *)
LDAP_SCHEMA_ALLOW_ALL = $3f; (* Be very liberal in parsing *)
LDAP_SCHEMA_SKIP = $80; (* Don't malloc any result *)
function ldap_syntax2name(syn: PLDAPSyntax): pcchar; cdecl; external;
function ldap_matchingrule2name(mr: PLDAPMatchingRule): pcchar; cdecl; external;
function ldap_matchingruleuse2name(mru: PLDAPMatchingRuleUse): pcchar; cdecl; external;
function ldap_attributetype2name(_at: PLDAPAttributeType): pcchar; cdecl; external;
function ldap_objectclass2name(oc: PLDAPObjectClass): pcchar; cdecl; external;
function ldap_contentrule2name(cr: PLDAPContentRule): pcchar; cdecl; external;
function ldap_nameform2name(nf: PLDAPNameForm): pcchar; cdecl; external;
function ldap_structurerule2name(sr: PLDAPStructureRule): pcchar; cdecl; external;
procedure ldap_syntax_free(syn: PLDAPSyntax); cdecl; external;
procedure ldap_matchingrule_free(mr: PLDAPMatchingRule); cdecl; external;
procedure ldap_matchingruleuse_free(mru: PLDAPMatchingRuleUse); cdecl; external;
procedure ldap_attributetype_free(_at: PLDAPAttributeType); cdecl; external;
procedure ldap_objectclass_free(oc: PLDAPObjectClass); cdecl; external;
procedure ldap_contentrule_free(cr: PLDAPContentRule); cdecl; external;
procedure ldap_nameform_free(nf: PLDAPNameForm); cdecl; external;
procedure ldap_structurerule_free(sr: PLDAPStructureRule); cdecl; external;
function ldap_str2structurerule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPStructureRule; cdecl; external;
function ldap_str2nameform(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPNameForm; cdecl; external;
function ldap_str2contentrule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPContentRule; cdecl; external;
function ldap_str2objectclass(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPObjectClass; cdecl; external;
function ldap_str2attributetype(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPAttributeType; cdecl; external;
function ldap_str2syntax(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPSyntax; cdecl; external;
function ldap_str2matchingrule(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPMatchingRule; cdecl; external;
function ldap_str2matchingruleuse(const s: pcchar; code: pcint; const errp: ppcchar; flags: cuint): PLDAPMatchingRuleUse; cdecl; external;
function ldap_structurerule2str(sr: PLDAPStructureRule): pcchar; cdecl; external;
function ldap_structurerule2bv(sr: PLDAPStructureRule; bv: PBerval): PBerval; cdecl; external;
function ldap_nameform2str(nf: PLDAPNameForm): pcchar; cdecl; external;
function ldap_nameform2bv(nf: PLDAPNameForm; bv: PBerval): PBerval; cdecl; external;
function ldap_contentrule2str(cr: PLDAPContentRule): pcchar; cdecl; external;
function ldap_contentrule2bv(cr: PLDAPContentRule; bv: PBerval): PBerval; cdecl; external;
function ldap_objectclass2str(oc: PLDAPObjectClass): pcchar; cdecl; external;
function ldap_objectclass2bv(oc: PLDAPObjectClass; bv: PBerval): PBerval; cdecl; external;
function ldap_attributetype2str(_at: PLDAPAttributeType): pcchar; cdecl; external;
function ldap_attributetype2bv(_at: PLDAPAttributeType; bv: PBerval): PBerval; cdecl; external;
function ldap_syntax2str(syn: PLDAPSyntax): pcchar; cdecl; external;
function ldap_syntax2bv(syn: PLDAPSyntax; bv: PBerval): PBerval; cdecl; external;
function ldap_matchingrule2str(mr: PLDAPMatchingRule): pcchar; cdecl; external;
function ldap_matchingrule2bv(mr: PLDAPMatchingRule; bv: PBerval): PBerval; cdecl; external;
function ldap_matchingruleuse2str(mru: PLDAPMatchingRuleUse): pcchar; cdecl; external;
function ldap_matchingruleuse2bv(mru: PLDAPMatchingRuleUse; bv: PBerval): PBerval; cdecl; external;
function ldap_scherr2str(code: cint): pcchar; cdecl; external;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Makefile.fpc for libmad bindings
#
[package]
name=mad
version=2.0.0
[target]
units=mad
[require]
[install]
fpcpackage=y
[default]
fpcdir=../../..
[rules]
.NOTPARALLEL:

View File

@ -1,717 +0,0 @@
{
Translation of the libmad headers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
(*
* libmad - MPEG audio decoder library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 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 General Public License for more details.
*
* You should have received a copy of the GNU 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
*
* If you would like to negotiate alternate licensing terms, you may do
* so by contacting: Underbit Technologies, Inc. <info@underbit.com>
*)
unit mad;
{$mode objfpc}
{$MINENUMSIZE 4}
interface
uses
ctypes;
{$IFDEF WINDOWS}
{$DEFINE DYNLINK}
{$ENDIF}
{$DEFINE MAD_DISABLE_BUILTIN_DECODER}
{$IFDEF DYNLINK}
const
{$IF Defined(WINDOWS)}
madlib = 'libmad.dll';
{$ELSEIF Defined(UNIX)}
madlib = 'libmad.so';
{$ELSE}
{$MESSAGE ERROR 'DYNLINK not supported'}
{$IFEND}
{$ELSE}
{$LINKLIB mad}
{$ENDIF}
(***********************************************************************)
(* Header : version.h *)
(***********************************************************************)
const
MAD_VERSION_MAJOR = 0;
MAD_VERSION_MINOR = 15;
MAD_VERSION_PATCH = 1;
MAD_VERSION_EXTRA = ' (beta)';
function MAD_VERSION_STRINGIZE(num: cint): String;
function MAD_VERSION_STRING(num: cint): String;
function MAD_VERSION: String;
const
MAD_PUBLISHYEAR = '2000-2004';
MAD_AUTHOR = 'Underbit Technologies, Inc.';
MAD_EMAIL = 'info@underbit.com';
(***********************************************************************)
(* Header : fixed.h *)
(***********************************************************************)
type
mad_fixed_t = csint;
mad_fixed64hi_t = csint;
mad_fixed64lo_t = cuint;
mad_fixed64_t = cslonglong;
mad_sample_t = mad_fixed_t;
{*
* Fixed-point format: 0xABBBBBBB
* A == whole part (sign + 3 bits)
* B == fractional part (28 bits)
*
* Values are signed two's complement, so the effective range is:
* 0x80000000 to 0x7fffffff
* -8.0 to +7.9999999962747097015380859375
*
* The smallest representable value is:
* 0x00000001 == 0.0000000037252902984619140625 (i.e. about 3.725e-9)
*
* 28 bits of fractional accuracy represent about
* 8.6 digits of decimal accuracy.
*
* Fixed-point numbers can be added or subtracted as normal
* integers, but multiplication requires shifting the 64-bit result
* from 56 fractional bits back to 28 (and rounding.)
*
* Changing the definition of MAD_F_FRACBITS is only partially
* supported, and must be done with care.
*}
const
MAD_F_FRACBITS = 28;
// MAD_F_MIN = mad_fixed_t(-$80000000);
MAD_F_MAX = mad_fixed_t(+$7fffffff);
MAD_F_ONE = mad_fixed_t( $10000000);
MAD_F_SCALEBITS = MAD_F_FRACBITS;
//function mad_f_tofixed(x: double): mad_fixed_t;
(***********************************************************************)
(* Header : bit.h *)
(***********************************************************************)
type
mad_bitptr = record
byte : ^cuchar;
cache : cushort;
left : cushort;
end;
procedure mad_bit_init(var bitptr: mad_bitptr; byte: pcuchar); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_bit_finish(var bitptr: mad_bitptr);
function mad_bit_length(var begin_, end_: mad_bitptr): cuint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_bit_bitsleft(var bitptr: mad_bitptr): cushort;
function mad_bit_nextbyte(var bitptr: mad_bitptr): pcuchar; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_bit_skip(var bitptr: mad_bitptr); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_bit_read(var bitptr: mad_bitptr; len: cuint): culong; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_bit_write(var bitptr: mad_bitptr; len: cuint; value: culong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_bit_crc(bitptr: mad_bitptr; len: cuint; init: cushort): cushort; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
(***********************************************************************)
(* Header : timer.h *)
(***********************************************************************)
type
mad_timer_t = record
seconds : cslong; { whole seconds }
fraction : culong; { 1/MAD_TIMER_RESOLUTION seconds }
end;
const
MAD_TIMER_RESOLUTION = 352800000;
mad_timer_zero : mad_timer_t = (seconds:0; fraction:0);
type
mad_units = (
MAD_UNITS_HOURS = -2,
MAD_UNITS_MINUTES = -1,
MAD_UNITS_SECONDS = 0,
{ metric units }
MAD_UNITS_DECISECONDS = 10,
MAD_UNITS_CENTISECONDS = 100,
MAD_UNITS_MILLISECONDS = 1000,
{ audio sample units }
MAD_UNITS_8000_HZ = 8000,
MAD_UNITS_11025_HZ = 11025,
MAD_UNITS_12000_HZ = 12000,
MAD_UNITS_16000_HZ = 16000,
MAD_UNITS_22050_HZ = 22050,
MAD_UNITS_24000_HZ = 24000,
MAD_UNITS_32000_HZ = 32000,
MAD_UNITS_44100_HZ = 44100,
MAD_UNITS_48000_HZ = 48000,
{ video frame/field units }
MAD_UNITS_24_FPS = 24,
MAD_UNITS_25_FPS = 25,
MAD_UNITS_30_FPS = 30,
MAD_UNITS_48_FPS = 48,
MAD_UNITS_50_FPS = 50,
MAD_UNITS_60_FPS = 60,
{ CD audio frames }
MAD_UNITS_75_FPS = 75,
{ video drop-frame units }
MAD_UNITS_23_976_FPS = -24,
MAD_UNITS_24_975_FPS = -25,
MAD_UNITS_29_97_FPS = -30,
MAD_UNITS_47_952_FPS = -48,
MAD_UNITS_49_95_FPS = -50,
MAD_UNITS_59_94_FPS = -60
);
procedure mad_timer_reset(var timer: mad_timer_t);
function mad_timer_compare(timer1: mad_timer_t; timer2: mad_timer_t): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_timer_sign(timer: mad_timer_t): cint;
procedure mad_timer_negate(var timer: mad_timer_t); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_timer_abs(timer: mad_timer_t): mad_timer_t; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_timer_set(var timer: mad_timer_t; seconds, numer, denom: culong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_timer_add(var timer: mad_timer_t; incr: mad_timer_t); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_timer_multiply(var timer: mad_timer_t; scalar: cslong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_timer_count(timer: mad_timer_t; units: mad_units): cslong; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_timer_fraction(timer: mad_timer_t; denom: culong): culong; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_timer_string(timer: mad_timer_t; dest, format: pcchar; units, fracunits: mad_units; subparts: culong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
(***********************************************************************)
(* Header : stream.h *)
(***********************************************************************)
type
mad_error = (
MAD_ERROR_NONE = $0000, { no error }
MAD_ERROR_BUFLEN = $0001, { input buffer too small (or EOF) }
MAD_ERROR_BUFPTR = $0002, { invalid (null) buffer pointer }
MAD_ERROR_NOMEM = $0031, { not enough memory }
MAD_ERROR_LOSTSYNC = $0101, { lost synchronization }
MAD_ERROR_BADLAYER = $0102, { reserved header layer value }
MAD_ERROR_BADBITRATE = $0103, { forbidden bitrate value }
MAD_ERROR_BADSAMPLERATE = $0104, { reserved sample frequency value }
MAD_ERROR_BADEMPHASIS = $0105, { reserved emphasis value }
MAD_ERROR_BADCRC = $0201, { CRC check failed }
MAD_ERROR_BADBITALLOC = $0211, { forbidden bit allocation value }
MAD_ERROR_BADSCALEFACTOR = $0221, { bad scalefactor index }
MAD_ERROR_BADFRAMELEN = $0231, { bad frame length }
MAD_ERROR_BADBIGVALUES = $0232, { bad big_values count }
MAD_ERROR_BADBLOCKTYPE = $0233, { reserved block_type }
MAD_ERROR_BADSCFSI = $0234, { bad scalefactor selection info }
MAD_ERROR_BADDATAPTR = $0235, { bad main_data_begin pointer }
MAD_ERROR_BADPART3LEN = $0236, { bad audio data length }
MAD_ERROR_BADHUFFTABLE = $0237, { bad Huffman table select }
MAD_ERROR_BADHUFFDATA = $0238, { Huffman data overrun }
MAD_ERROR_BADSTEREO = $0239 { incompatible block_type for JS }
);
function MAD_RECOVERABLE(error: mad_error) : Boolean;
type
mad_stream = record
buffer : pointer; { input bitstream buffer }
bufend : pointer; { end of buffer }
skiplen : culong; { bytes to skip before next frame }
sync : cint; { stream sync found }
freerate : culong; { free bitrate (fixed) }
this_frame : pointer; { start of current frame }
next_frame : pointer; { start of next frame }
ptr : mad_bitptr; { current processing bit pointer }
anc_ptr : mad_bitptr; { ancillary bits pointer }
anc_bitlen : cuint; { number of ancillary bits }
main_data : pointer; { Layer III main_data() }
md_len : cuint; { bytes in main_data }
options : cint; { decoding options (see below) }
error : mad_error; { error code (see above) }
end;
const
MAD_BUFFER_GUARD = 8;
MAD_BUFFER_MDLEN = 511 + 2048 + MAD_BUFFER_GUARD;
MAD_OPTION_IGNORECRC = $0001; { ignore CRC errors }
MAD_OPTION_HALFSAMPLERATE = $0002; { generate PCM at 1/2 sample rate }
{$if defined(false)} { not yet implemented }
MAD_OPTION_LEFTCHANNEL = $0010; { decode left channel only }
MAD_OPTION_RIGHTCHANNEL = $0020; { decode right channel only }
MAD_OPTION_SINGLECHANNEL = $0030; { combine channels }
{$ifend}
procedure mad_stream_init(var stream: mad_stream); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_stream_finish(var stream: mad_stream); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_stream_options(stream: mad_stream; opts: cint);
procedure mad_stream_buffer(var stream: mad_stream; buffer: pcuchar; length: culong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_stream_skip(var stream: mad_stream; length: culong); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_stream_sync(var stream: mad_stream): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_stream_errorstr(var stream: mad_stream): pcchar; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
(***********************************************************************)
(* Header : frame.h *)
(***********************************************************************)
type
mad_layer = (
MAD_LAYER_I = 1, { Layer I }
MAD_LAYER_II = 2, { Layer II }
MAD_LAYER_III = 3 { Layer III }
);
mad_mode = (
MAD_MODE_SINGLE_CHANNEL = 0, { single channel }
MAD_MODE_DUAL_CHANNEL = 1, { dual channel }
MAD_MODE_JOINT_STEREO = 2, { joint (MS/intensity) stereo }
MAD_MODE_STEREO = 3 { normal LR stereo }
);
mad_emphasis = (
MAD_EMPHASIS_NONE = 0, { no emphasis }
MAD_EMPHASIS_50_15_US = 1, { 50/15 microseconds emphasis }
MAD_EMPHASIS_CCITT_J_17 = 3, { CCITT J.17 emphasis }
MAD_EMPHASIS_RESERVED = 2 { unknown emphasis }
);
mad_header = record
layer : mad_layer; { audio layer (1, 2, or 3) }
mode : mad_mode; { channel mode (see above) }
mode_extension : cint; { additional mode info }
emphasis : mad_emphasis; { de-emphasis to use (see above) }
bitrate : culong; { stream bitrate (bps) }
samplerate : cuint; { sampling frequency (Hz) }
crc_check : cushort; { frame CRC accumulator }
crc_target : cushort; { final target CRC checksum }
flags : cint; { flags (see below) }
private_bits : cint; { private bits (see below) }
duration : mad_timer_t; { audio playing time of frame }
end;
mad_overlap = array[0..1, 0..31, 0..17] of mad_fixed_t;
mad_frame = record
header : mad_header; { MPEG audio header }
options : cint; { decoding options (from stream) }
{ synthesis subband filter samples }
sbsample : packed array[0..1, 0..35, 0..31] of mad_fixed_t;
overlap : ^mad_overlap; { Layer III block overlap data }
end;
const
MAD_FLAG_NPRIVATE_III = $0007; { number of Layer III private bits }
MAD_FLAG_INCOMPLETE = $0008; { header but not data is decoded }
MAD_FLAG_PROTECTION = $0010; { frame has CRC protection }
MAD_FLAG_COPYRIGHT = $0020; { frame is copyright }
MAD_FLAG_ORIGINAL = $0040; { frame is original (else copy) }
MAD_FLAG_PADDING = $0080; { frame has additional slot }
MAD_FLAG_I_STEREO = $0100; { uses intensity joint stereo }
MAD_FLAG_MS_STEREO = $0200; { uses middle/side joint stereo }
MAD_FLAG_FREEFORMAT = $0400; { uses free format bitrate }
MAD_FLAG_LSF_EXT = $1000; { lower sampling freq. extension }
MAD_FLAG_MC_EXT = $2000; { multichannel audio extension }
MAD_FLAG_MPEG_2_5_EXT = $4000; { MPEG 2.5 (unofficial) extension }
MAD_PRIVATE_HEADER = $0100; { header private bit }
MAD_PRIVATE_III = $001f; { Layer III private bits (up to 5) }
function mad_nchannels(header: mad_header): cint;
function mad_nsbsamples(header: mad_header): cint;
procedure mad_header_init(var header: mad_header); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_header_finish(var header: mad_header);
function mad_header_decode(var header: mad_header; var stream: mad_stream): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_frame_init(var frame: mad_frame); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_frame_finish(var frame: mad_frame); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_frame_decode(var frame: mad_frame; var stream: mad_stream): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_frame_mute(var frame: mad_frame); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
(***********************************************************************)
(* Header : synth.h *)
(***********************************************************************)
type
mad_pcm = record
samplerate : cuint; { sampling frequency (Hz) }
channels : cushort; { number of channels }
length : cushort; { number of samples per channel }
{ PCM output samples [ch][sample] }
samples : packed array [0..1, 0..1151] of mad_fixed_t;
end;
mad_synth = record
{ polyphase filterbank outputs [ch][eo][peo][s][v] }
filter : array[0..1, 0..1, 0..1, 0..15, 0..7] of mad_fixed_t;
phase : cuint; { current processing phase }
pcm : mad_pcm; { PCM output }
end;
const
{ single channel PCM selector }
MAD_PCM_CHANNEL_SINGLE = 0;
{ dual channel PCM selector }
MAD_PCM_CHANNEL_DUAL_1 = 0;
MAD_PCM_CHANNEL_DUAL_2 = 1;
{ stereo PCM selector }
MAD_PCM_CHANNEL_STEREO_LEFT = 0;
MAD_PCM_CHANNEL_STEREO_RIGHT = 1;
procedure mad_synth_init(var synth: mad_synth); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_synth_finish(var synth: mad_synth);
procedure mad_synth_mute(var synth: mad_synth); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
procedure mad_synth_frame(var synth: mad_synth; var frame: mad_frame); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
(***********************************************************************)
(* Header : decoder.h *)
(***********************************************************************)
{$IFNDEF MAD_DISABLE_BUILTIN_DECODER}
type
mad_decoder_mode = (
MAD_DECODER_MODE_SYNC = 0,
MAD_DECODER_MODE_ASYNC = 1
);
mad_flow = (
MAD_FLOW_CONTINUE = $0000, { continue normally }
MAD_FLOW_STOP = $0010, { stop decoding normally }
MAD_FLOW_BREAK = $0011, { stop decoding and signal an error }
MAD_FLOW_IGNORE = $0020 { ignore the current frame }
);
async_struct = record
pid : clong;
_in : cint;
_out : cint;
end;
sync_struct = record
stream : mad_stream;
frame : mad_frame;
synth : mad_synth;
end;
mad_input_func = function(user: Pointer; var stream: mad_stream): mad_flow; cdecl;
mad_header_func = function(user: Pointer; var header: mad_header): mad_flow; cdecl;
mad_filter_func = function(user: Pointer; var frame: mad_frame): mad_flow; cdecl;
mad_output_func = function(user: Pointer; var header: mad_header; var pcm: mad_pcm): mad_flow; cdecl;
mad_error_func = function(user: Pointer; var stream: mad_stream; var frame: mad_frame): mad_flow; cdecl;
mad_message_func = function(user, msg: Pointer; var l: cuint): mad_flow; cdecl;
mad_decoder = record
mode : mad_decoder_mode;
options : cint;
async : async_struct;
sync : ^sync_struct;
data : pointer;
InputFunc : mad_input_func;
HeaderFunc : mad_header_func;
FilterFunc : mad_filter_func;
OutputFunc : mad_output_func;
ErrorFunc : mad_error_func;
MessageFunc : mad_message_func;
end;
procedure mad_decoder_init(var decoder: mad_decoder; user: pointer; Input: mad_input_func; Header: mad_header_func; Filter: mad_filter_func; Output: mad_output_func; Error: mad_error_func; Message: mad_message_func); cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_decoder_finish(var decoder: mad_decoder): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_decoder_run(var decoder: mad_decoder; mode: mad_decoder_mode): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
function mad_decoder_message(var decoder: mad_decoder; msg: Pointer; var l: cuint): cint; cdecl; external {$IFDEF DYNLINK}madlib{$ENDIF};
{$ENDIF}
{
Developer of the MAD helpers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
{$IFDEF MAD_DISABLE_BUILTIN_DECODER}
const
MAD_INPUT_BUFFER_SIZE = 5*8192;
type
mad_read_func = function(user: pointer; ptr: pointer; size: cuint): cuint; cdecl;
mad_seek_func = function(user: pointer; offset: clong; whence: cint): clong; cdecl;
mad_close_func = function(user: pointer): cint; cdecl;
mad_tell_func = function(user: pointer): clong; cdecl;
pmad_decoder = ^mad_decoder;
mad_decoder = record
inbuf : array[0..MAD_INPUT_BUFFER_SIZE-1] of cuint8;
stream : mad_stream;
frame : mad_frame;
synth : mad_synth;
samplecnt : cint;
sampleofs : cint;
user : pointer;
read : mad_read_func;
seek : mad_seek_func;
close : mad_close_func;
tell : mad_tell_func;
// Userinfo
sample_rate : cint;
end;
function mad_decoder_init(user: pointer; read: mad_read_func; seek: mad_seek_func; close: mad_close_func; tell: mad_tell_func): pmad_decoder;
function mad_decoder_read(decoder: pmad_decoder; buffer: pointer; length: cint): cint;
procedure mad_decoder_free(decoder: pmad_decoder);
{$ENDIF}
implementation
function MAD_VERSION_STRINGIZE(num: cint): String;
begin
MAD_VERSION_STRINGIZE := '';
Str(num, MAD_VERSION_STRINGIZE);
end;
function MAD_VERSION_STRING(num: cint): String;
begin
MAD_VERSION_STRING := MAD_VERSION_STRINGIZE(num);
end;
function MAD_VERSION: String;
begin
MAD_VERSION :=
MAD_VERSION_STRING(MAD_VERSION_MAJOR) + '.' +
MAD_VERSION_STRING(MAD_VERSION_MINOR) + '.' +
MAD_VERSION_STRING(MAD_VERSION_PATCH) +
MAD_VERSION_EXTRA;
end;
{function mad_f_tofixed(x: double): mad_fixed_t;
begin
Result := mad_fixed_t(x * double(1 shl MAD_F_FRACBITS) + 0.5);
end;}
procedure mad_bit_finish(var bitptr: mad_bitptr);
begin
end;
function mad_bit_bitsleft(var bitptr: mad_bitptr): cushort;
begin
mad_bit_bitsleft := bitptr.left;
end;
procedure mad_timer_reset(var timer: mad_timer_t);
begin
timer := mad_timer_zero;
end;
function mad_timer_sign(timer: mad_timer_t): cint;
begin
mad_timer_sign := mad_timer_compare(timer, mad_timer_zero);
end;
function MAD_RECOVERABLE(error: mad_error): Boolean;
begin
MAD_RECOVERABLE := word(error) and $ff00 > 0;
end;
procedure mad_stream_options(stream: mad_stream; opts: cint);
begin
stream.options := opts;
end;
procedure mad_header_finish(var header: mad_header);
begin
FillChar(header, sizeof(mad_header), 0);
end;
function mad_nchannels(header: mad_header): cint;
begin
if longword(header.mode) <> 0 then
mad_nchannels := 2 else
mad_nchannels := 1;
end;
function mad_nsbsamples(header: mad_header): cint;
begin
if header.layer = MAD_LAYER_I then mad_nsbsamples := 12 else
if (header.layer = MAD_LAYER_III) and (header.flags and MAD_FLAG_LSF_EXT > 0)
then mad_nsbsamples := 18
else mad_nsbsamples := 36;
end;
procedure mad_synth_finish(var synth: mad_synth);
begin
FillChar(synth, sizeof(mad_synth), 0);
end;
{$IFDEF MAD_DISABLE_BUILTIN_DECODER}
function mad_decoder_init(user: pointer; read: mad_read_func; seek: mad_seek_func; close: mad_close_func; tell: mad_tell_func): pmad_decoder;
begin
GetMem(Result, Sizeof(mad_decoder));
FillChar(Result^, Sizeof(mad_decoder), 0);
mad_stream_init(Result^.stream);
mad_frame_init(Result^.frame);
mad_synth_init(Result^.synth);
Result^.user := user;
Result^.read := read;
Result^.seek := seek;
Result^.close := close;
Result^.tell := tell;
end;
procedure mad_decoder_free(decoder: pmad_decoder);
begin
if not Assigned(decoder) then
Exit;
mad_synth_finish(decoder^.synth);
mad_frame_finish(decoder^.frame);
mad_stream_finish(decoder^.stream);
decoder^.close(decoder^.user);
FreeMem(decoder);
end;
function mad_decoder_read(decoder: pmad_decoder; buffer: pointer; length: cint): cint;
var
ofs, num, i: cint;
inbuf_ptr: pointer;
len, remaining: cint;
begin
// check blocksize here!
ofs := 0;
num := length;
while num > 0 do
begin
if decoder^.samplecnt = 0 then
begin
if (decoder^.stream.buffer = nil) or (decoder^.stream.error = MAD_ERROR_BUFLEN) then
begin
if Assigned(decoder^.stream.next_frame) then
begin
remaining := ptrint(decoder^.stream.bufend) - ptrint(decoder^.stream.next_frame);
inbuf_ptr := pointer(ptrint(@decoder^.inbuf) + remaining);
len := MAD_INPUT_BUFFER_SIZE - remaining;
Move(decoder^.stream.next_frame^, decoder^.inbuf, remaining);
end else begin
remaining := 0;
len := MAD_INPUT_BUFFER_SIZE;
inbuf_ptr := @decoder^.inbuf;
end;
len := decoder^.read(decoder^.user, inbuf_ptr, len);
if len <= 0 then
Exit(ofs);
mad_stream_buffer(decoder^.stream, decoder^.inbuf, len+remaining);
decoder^.stream.error := MAD_ERROR_NONE;
end;
if mad_frame_decode(decoder^.frame, decoder^.stream) <> 0 then
begin
if MAD_RECOVERABLE(decoder^.stream.error) or (decoder^.stream.error = MAD_ERROR_BUFLEN) then
Continue;
Exit(ofs);
end;
mad_synth_frame(decoder^.synth, decoder^.frame);
with decoder^.synth do
if pcm.channels = 2 then
begin
for i := 0 to pcm.length -1 do
begin
if pcm.samples[0][i] >= MAD_F_ONE then
pcm.samples[0][i] := MAD_F_ONE - 1;
if pcm.samples[0][i] < -MAD_F_ONE then
pcm.samples[0][i] := -MAD_F_ONE;
pcm.samples[0][i] := pcm.samples[0][i] shr (MAD_F_FRACBITS + 1 - 16 + 1);
if pcm.samples[1][i] >= MAD_F_ONE then
pcm.samples[1][i] := MAD_F_ONE - 1;
if pcm.samples[1][i] < -MAD_F_ONE then
pcm.samples[1][i] := -MAD_F_ONE;
pcm.samples[1][i] := pcm.samples[1][i] shr (MAD_F_FRACBITS + 1 - 16 + 1);
end;
end else begin
for i := 0 to pcm.length -1 do
begin
if pcm.samples[0][i] >= MAD_F_ONE then
pcm.samples[0][i] := MAD_F_ONE - 1;
if pcm.samples[0][i] < -MAD_F_ONE then
pcm.samples[0][i] := -MAD_F_ONE;
pcm.samples[0][i] := pcm.samples[0][i] shr (MAD_F_FRACBITS + 1 - 16 + 1);
pcm.samples[1][i] := pcm.samples[0][i];
end;
end;
decoder^.sampleofs := 0;
decoder^.samplecnt := decoder^.synth.pcm.length;
decoder^.sample_rate := decoder^.synth.pcm.samplerate;
end;
len := num div 4;
if len > decoder^.samplecnt then
len := decoder^.samplecnt;
for i := 0 to len - 1 do
begin
pcint16(ptrint(buffer) + ofs + 0)^ := decoder^.synth.pcm.samples[0][decoder^.sampleofs];
pcint16(ptrint(buffer) + ofs + 2)^ := decoder^.synth.pcm.samples[1][decoder^.sampleofs];
Inc(decoder^.sampleofs);
Dec(decoder^.samplecnt);
ofs := ofs + 4;
num := num - 4;
end;
end;
Result := ofs;
end;
{$ENDIF}
end.

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#
# Makefile.fpc for libmodplug bindings
#
[package]
name=modplug
version=2.0.0
[target]
units=modplug
[require]
[install]
fpcpackage=y
[default]
fpcdir=../../..
[rules]
.NOTPARALLEL:

View File

@ -1,130 +0,0 @@
{
Translation of the libmodplug headers for FreePascal
Copyright (C) 2006 by Ivo Steinmann
}
(*
* This source code is public domain.
*
* Authors: Kenton Varda <temporal@gauge3d.org> (C interface wrapper)
*)
unit modplug;
{$mode objfpc}
{$MINENUMSIZE 4}
interface
uses
ctypes;
{$IFDEF WINDOWS}
{$DEFINE DYNLINK}
{$ENDIF}
//{$DEFINE DYNLINK}
{$IFDEF DYNLINK}
const
{$IF Defined(WINDOWS)}
modpluglib = 'libmodplug.dll';
{$ELSEIF Defined(UNIX)}
modpluglib = 'libmodplug.so';
{$ELSE}
{$MESSAGE ERROR 'DYNLINK not supported'}
{$IFEND}
{$ELSE}
//{$LINKLIB stdc++}
{$LINKLIB modplug}
{$ENDIF}
type
PModPlugFile = ^ModPlugFile;
ModPlugFile = record
end;
(* Load a mod file. [data] should point to a block of memory containing the complete
* file, and [size] should be the size of that block.
* Return the loaded mod file on success, or NULL on failure. *)
function ModPlug_Load(data: pointer; size: cint): PModPlugFile; cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
(* Unload a mod file. *)
procedure ModPlug_Unload(_file: PModPlugFile); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
(* Read sample data into the buffer. Returns the number of bytes read. If the end
* of the mod has been reached, zero is returned. *)
function ModPlug_Read(_file: PModPlugFile; buffer: pointer; size: cint): cint; cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
(* Get the name of the mod. The returned buffer is stored within the ModPlugFile
* structure and will remain valid until you unload the file. *)
function ModPlug_GetName(_file: PModPlugFile): pcchar; cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
(* Get the length of the mod, in milliseconds. Note that this result is not always
* accurate, especially in the case of mods with loops. *)
function ModPlug_GetLength(_file: PModPlugFile): cint; cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
(* Seek to a particular position in the song. Note that seeking and MODs don't mix very
* well. Some mods will be missing instruments for a short time after a seek, as ModPlug
* does not scan the sequence backwards to find out which instruments were supposed to be
* playing at that time. (Doing so would be difficult and not very reliable.) Also,
* note that seeking is not very exact in some mods -- especially those for which
* ModPlug_GetLength() does not report the full length. *)
procedure ModPlug_Seek(_file: PModPlugFile; millisecond: cint); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
const
// _ModPlug_Flags
MODPLUG_ENABLE_OVERSAMPLING = 1 shl 0; (* Enable oversampling (highly recommended) *)
MODPLUG_ENABLE_NOISE_REDUCTION = 1 shl 1; (* Enable noise reduction *)
MODPLUG_ENABLE_REVERB = 1 shl 2; (* Enable reverb *)
MODPLUG_ENABLE_MEGABASS = 1 shl 3; (* Enable megabass *)
MODPLUG_ENABLE_SURROUND = 1 shl 4; (* Enable surround sound. *)
// _ModPlug_ResamplingMode
MODPLUG_RESAMPLE_NEAREST = 0; (* No interpolation (very fast, extremely bad sound quality) *)
MODPLUG_RESAMPLE_LINEAR = 1; (* Linear interpolation (fast, good quality) *)
MODPLUG_RESAMPLE_SPLINE = 2; (* Cubic spline interpolation (high quality) *)
MODPLUG_RESAMPLE_FIR = 3; (* 8-tap fir filter (extremely high quality) *)
type
PModPlug_Settings = ^ModPlug_Settings;
ModPlug_Settings = record
mFlags : cint; (* One or more of the MODPLUG_ENABLE_* flags above, bitwise-OR'ed *)
(* Note that ModPlug always decodes sound at 44100kHz, 32 bit, stereo and then
* down-mixes to the settings you choose. *)
mChannels : cint; (* Number of channels - 1 for mono or 2 for stereo *)
mBits : cint; (* Bits per sample - 8, 16, or 32 *)
mFrequency : cint; (* Sampling rate - 11025, 22050, or 44100 *)
mResamplingMode : cint; (* One of MODPLUG_RESAMPLE_*, above *)
mReverbDepth : cint; (* Reverb level 0(quiet)-100(loud) *)
mReverbDelay : cint; (* Reverb delay in ms, usually 40-200ms *)
mBassAmount : cint; (* XBass level 0(quiet)-100(loud) *)
mBassRange : cint; (* XBass cutoff in Hz 10-100 *)
mSurroundDepth : cint; (* Surround level 0(quiet)-100(heavy) *)
mSurroundDelay : cint; (* Surround delay in ms, usually 5-40ms *)
mLoopCount : cint; (* Number of times to loop. Zero prevents looping. -1 loops forever. *)
end;
(* Get and set the mod decoder settings. All options, except for channels, bits-per-sample,
* sampling rate, and loop count, will take effect immediately. Those options which don't
* take effect immediately will take effect the next time you load a mod. *)
procedure ModPlug_GetSettings(settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
procedure ModPlug_SetSettings(const settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
implementation
function cppNew(s: cint): pointer; cdecl; public; alias : '_Znaj'; alias : '_Znwj';
begin
GetMem(Result, s);
end;
procedure cppDelete(p: pointer); cdecl; public; alias : '_ZdlPv'; alias : '_ZdaPv';
begin
FreeMem(p);
end;
end.