Audio-MPEG
view release on metacpan or search on metacpan
/*
*
* $Id: MPEG.xs,v 1.3 2001/06/18 04:19:40 ptimof Exp $
*
* Copyright (c) 2001 Peter Timofejew. All rights reserved.
*
* 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
*
*/
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "decode.h"
#include "audio.h"
#include "encode.h"
#define Min(A, B) ((A) < (B) ? (A) : (B))
#define Max(A, B) ((A) > (B) ? (A) : (B))
static int
not_here(char *s)
{
croak("%s not implemented on this architecture", s);
return -1;
}
MODULE = Audio::MPEG PACKAGE = Audio::MPEG
#
# Move along. Nothin' to see here folks.
#
PROTOTYPES: ENABLE
#
# Interface to MAD library
#
MODULE = Audio::MPEG PACKAGE = Audio::MPEG::Decode
Audio_MPEG_Decode
new(CLASS)
char *CLASS = NO_INIT
CODE:
Newz(0, (void *)RETVAL, sizeof(*RETVAL), char);
decode_new(RETVAL); // in decode.c
OUTPUT:
RETVAL
void
DESTROY(THIS)
Audio_MPEG_Decode THIS
CODE:
decode_DESTROY(THIS); // in decode.c
Safefree(THIS);
#
# MAD version strings
#
SV *
version(THIS)
Audio_MPEG_Decode THIS
PREINIT:
HV *h;
char *key;
CODE:
h = (HV *)sv_2mortal((SV *)newHV());
key = "version";
hv_store(h, key, strlen(key), newSVpv((char *)mad_version, 0), 0);
key = "copyright";
hv_store(h, key, strlen(key), newSVpv((char *)mad_copyright, 0), 0);
key = "author";
hv_store(h, key, strlen(key), newSVpv((char *)mad_author, 0), 0);
key = "build";
hv_store(h, key, strlen(key), newSVpv((char *)mad_build, 0), 0);
RETVAL = newRV((SV *)h);
OUTPUT:
RETVAL
( run in 2.528 seconds using v1.01-cache-2.11-cpan-437f7b0c052 )