add version routines to polyplib

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@139 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2004-08-18 01:00:18 +00:00
parent ac595189fd
commit befd734aac
5 changed files with 73 additions and 31 deletions

View file

@ -27,6 +27,8 @@ EXTRA_DIST = polypaudio.pa depmod.py
bin_PROGRAMS = polypaudio pacat pactl
noinst_PROGRAMS = mainloop-test mainloop-test-glib pacat-simple parec-simple
BUILT_SOURCES=polyplib-version.h
polypinclude_HEADERS=polyplib.h \
polyplib-def.h \
polyplib-simple.h \

View file

@ -36,31 +36,28 @@
#include "util.h"
#include "modargs.h"
#ifdef USE_PROTOCOL_SIMPLE
#if defined(USE_PROTOCOL_SIMPLE)
#include "protocol-simple.h"
#define protocol_new pa_protocol_simple_new
#define protocol_free pa_protocol_simple_free
#define IPV4_PORT 4711
#define UNIX_SOCKET "/tmp/polypaudio/simple"
#define MODULE_ARGUMENTS "rate", "format", "channels", "sink", "source", "playback", "record",
#else
#ifdef USE_PROTOCOL_CLI
#elif defined(USE_PROTOCOL_CLI)
#include "protocol-cli.h"
#define protocol_new pa_protocol_cli_new
#define protocol_free pa_protocol_cli_free
#define IPV4_PORT 4712
#define UNIX_SOCKET "/tmp/polypaudio/cli"
#define MODULE_ARGUMENTS
#else
#ifdef USE_PROTOCOL_NATIVE
#elif defined(USE_PROTOCOL_NATIVE)
#include "protocol-native.h"
#define protocol_new pa_protocol_native_new
#define protocol_free pa_protocol_native_free
#define IPV4_PORT 4713
#define UNIX_SOCKET "/tmp/polypaudio/native"
#define MODULE_ARGUMENTS "public", "cookie",
#else
#ifdef USE_PROTOCOL_ESOUND
#elif defined(USE_PROTOCOL_ESOUND)
#include "protocol-esound.h"
#include "esound.h"
#define protocol_new pa_protocol_esound_new
@ -68,11 +65,8 @@
#define IPV4_PORT ESD_DEFAULT_PORT
#define UNIX_SOCKET ESD_UNIX_SOCKET_NAME
#define MODULE_ARGUMENTS "sink", "source", "public", "cookie",
#else
#else
#error "Broken build system"
#endif
#endif
#endif
#endif
static const char* const valid_modargs[] = {

View file

@ -532,3 +532,7 @@ struct pa_operation* pa_context_send_simple_command(struct pa_context *c, uint32
return pa_operation_ref(o);
}
const char* pa_get_library_version(void) {
return PACKAGE_VERSION;
}

View file

@ -0,0 +1,33 @@
#ifndef foopolyplibversionhfoo /*-*-C-*-*/
#define foopolyplibversionhfoo
/* $Id$ */
/***
This file is part of polypaudio.
polypaudio 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.
polypaudio 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 polypaudio; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA.
***/
/** \file
* Define header version */
/** Return the version of the header files. Keep in mind that this is
a macro and not a function, so it is impossible to get the pointer of
it. */
#define pa_get_headers_version() ("@PACKAGE_VERSION@")
#endif

View file

@ -22,6 +22,7 @@
USA.
***/
#include "cdecl.h"
#include "mainloop-api.h"
#include "sample.h"
#include "polyplib-def.h"
@ -30,11 +31,12 @@
#include "polyplib-introspect.h"
#include "polyplib-subscribe.h"
#include "polyplib-scache.h"
#include "polyplib-version.h"
/** \file
* Include all polyplib header file at once. The following files are included: \ref mainloop-api.h, \ref sample.h,
* \ref polyplib-def.h, \ref polyplib-context.h, \ref polyplib-stream.h,
* \ref polyplib-introspect.h, \ref polyplib-subscribe.h and \ref polyplib-scache.h
* \ref polyplib-introspect.h, \ref polyplib-subscribe.h and \ref polyplib-scache.h \ref polyplib-version.h
* at once */
/** \mainpage
@ -81,4 +83,11 @@
* synchronous API is available as "polyplib-simple".
*/
PA_C_DECL_BEGIN
/** Return the version of the library the current application is linked to */
const char* pa_get_library_version(void);
PA_C_DECL_END
#endif