Update to latest UniMRCP version. MRCP requests can no timeout if there is no server response.

This commit is contained in:
Christopher Rienzo 2011-06-16 16:25:00 +00:00
parent 0555b702db
commit 17099473a3
441 changed files with 17435 additions and 17076 deletions

View File

@ -12,6 +12,7 @@
<param name="max-connection-count" value="100"/>
<param name="offer-new-connection" value="1"/>
<param name="request-timeout" value="3000"/>
</settings>
<profiles>

View File

@ -1 +1 @@
Mon Feb 22 09:40:01 CST 2010
Thu Jun 16 15:02:31 UTC 2011

View File

@ -14,3 +14,4 @@ Contributor(s):
Carlos Pina Soares
Chaitanya Chokkareddy <chaitanya.chokkareddy@gmail.com>
Tomas Valenta <tomas.valenta@speechtech.cz>
Danijel Korzinek <danijel.korzinek@gmail.com>

View File

@ -14,7 +14,7 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure $(AUX_DIST)
ACLOCAL = aclocal -I $(macrodir)
SUBDIRS = conf data libs modules plugins platforms build
SUBDIRS = build conf data libs modules plugins platforms
if TEST_SUITES
SUBDIRS += tests
endif

View File

@ -1,5 +1,5 @@
The UniMRCP Project (http://www.unimrcp.org)
Copyright (C) 2008 Arsen Chaloyan
Copyright (C) 2008-2010 Arsen Chaloyan
Licensed under the Apache License, Version 2.0 (the "License").
This product includes a number of subcomponents with

View File

@ -3,7 +3,6 @@ m4_include([build/acmacros/apu.m4])
m4_include([build/acmacros/find_apr.m4])
m4_include([build/acmacros/find_apu.m4])
m4_include([build/acmacros/sofia-sip.m4])
m4_include([build/acmacros/swift.m4])
m4_include([build/acmacros/sphinxbase.m4])
m4_include([build/acmacros/pocketsphinx.m4])
m4_include([build/acmacros/flite.m4])

View File

@ -1,5 +1,9 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = uni_revision.h
SUBDIRS = pkgconfig
SUBDIRS = pkgconfig svnrev
include_HEADERS = uni_version.h
include_HEADERS = uni_version.h uni_revision.h
uni_revision.h :
svnrev/svnrev -rsvnrev/svnrev.input -p../ -ouni_revision.h

View File

@ -13,21 +13,28 @@ AC_DEFUN([UNIMRCP_CHECK_FLITE],
found_flite="no"
flite_libdir="build/libs"
flite_config="config/config"
for dir in $flite_path ; do
cd $dir && flite_dir=`pwd` && cd - > /dev/null
if test -d "$dir/$flite_libdir"; then
found_flite="yes"
UNIMRCP_FLITE_INCLUDES="-I$flite_dir/include"
UNIMRCP_FLITE_LIBS="$dir/$flite_libdir/libflite_cmu_us_awb.a \
$dir/$flite_libdir/libflite_cmu_us_kal.a \
$dir/$flite_libdir/libflite_cmu_us_rms.a \
$dir/$flite_libdir/libflite_cmu_us_slt.a \
$dir/$flite_libdir/libflite_cmulex.a \
$dir/$flite_libdir/libflite_usenglish.a \
$dir/$flite_libdir/libflite.a"
break
fi
if test -f "$flite_dir/$flite_config"; then
target_os=`grep TARGET_OS "$flite_dir/$flite_config" | sed "s/^.*= //"` ;\
target_cpu=`grep TARGET_CPU "$flite_dir/$flite_config" | sed "s/^.*= //"` ;\
flite_libdir=$flite_dir/build/$target_cpu-$target_os/lib
if test -d "$flite_libdir"; then
UNIMRCP_FLITE_INCLUDES="-I$flite_dir/include"
UNIMRCP_FLITE_LIBS="$flite_libdir/libflite_cmu_us_awb.a \
$flite_libdir/libflite_cmu_us_kal.a \
$flite_libdir/libflite_cmu_us_rms.a \
$flite_libdir/libflite_cmu_us_slt.a \
$flite_libdir/libflite_cmulex.a \
$flite_libdir/libflite_usenglish.a \
$flite_libdir/libflite.a"
found_flite="yes"
break
else
AC_MSG_WARN(Cannot find Flite lib dir: $flite_libdir)
fi
fi
done
if test x_$found_flite != x_yes; then

View File

@ -1,28 +0,0 @@
dnl UNIMRCP_CHECK_SWIFT
AC_DEFUN([UNIMRCP_CHECK_SWIFT],
[
AC_MSG_NOTICE([Cepstral Swift library configuration])
AC_MSG_CHECKING([for Swift])
AC_ARG_WITH(swift,
[ --with-swift=PATH prefix for installed Swift],
[swift_path=$withval],
[swift_path="/opt/swift"]
)
if test -d "$swift_path"; then
found_swift="yes"
UNIMRCP_SWIFT_INCLUDES="-I$swift_path/include"
UNIMRCP_SWIFT_LIBS="-lswift -lceplex_us -lceplang_en -lm"
UNIMRCP_SWIFT_LDFLAGS="-L$swift_path/lib/ -R$swift_path/lib/"
AC_SUBST(UNIMRCP_SWIFT_INCLUDES)
AC_SUBST(UNIMRCP_SWIFT_LIBS)
AC_SUBST(UNIMRCP_SWIFT_LDFLAGS)
AC_MSG_RESULT($swift_path)
else
AC_MSG_WARN([not found - looked for $swift_path])
fi
])

View File

@ -0,0 +1,271 @@
#!/bin/sh
#
# unimrcp-server This shell script takes care of starting and stopping the UniMRCP server.
#
# chkconfig: 2345 65 35
# description: UniMRCP is an open source MRCP v1 & v2 server
# Some global variables
# Application
APP_NAME="unimrcpserver"
APP_LONG_NAME="unimrcpserver"
UNIMRCP_DIR="/usr/local/unimrcp/"
EXEC="${UNIMRCP_DIR}bin/${APP_NAME} -d -o 2 -r ${UNIMRCP_DIR}"
# sudo user
USERNAME=root
# Priority at which to run the server. See "man nice" for valid priorities.
# nice is only used if a priority is specified.
PRIORITY=
# Location of the pid file.
PIDDIR="/var/run/"
pid=
LOG="/var/log/${APP_NAME}.log"
if [ -e $PIDDIR ]; then
echo
else
mkdir $PIDDIR
fi
# Allow configuration overrides in /etc/sysconfig/$APP_NAME
CONFIGFILE=/etc/sysconfig/$APP_NAME
[ -x $CONFIGFILE ] && . $CONFIGFILE
# Do not modify anything beyond this point
#-----------------------------------------------------------------------------
# Get the fully qualified path to the script
case $0 in
/*)
SCRIPT="$0"
;;
*)
PWD=`pwd`
SCRIPT="$PWD/$0"
;;
esac
# Change spaces to ":" so the tokens can be parsed.
SCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
# Get the real path to this script, resolving any symbolic links
TOKENS=`echo $SCRIPT | sed -e 's;/; ;g'`
REALPATH=
for C in $TOKENS; do
REALPATH="$REALPATH/$C"
while [ -h "$REALPATH" ] ; do
LS="`ls -ld "$REALPATH"`"
LINK="`expr "$LS" : '.*-> \(.*\)$'`"
if expr "$LINK" : '/.*' > /dev/null; then
REALPATH="$LINK"
else
REALPATH="`dirname "$REALPATH"`""/$LINK"
fi
done
done
# Change ":" chars back to spaces.
REALPATH=`echo $REALPATH | sed -e 's;:; ;g'`
# Change the current directory to the location of the script
cd "`dirname "$REALPATH"`"
chown $USERNAME $PIDDIR
# Process ID
PIDFILE="$PIDDIR/$APP_NAME.pid"
# Resolve the location of the 'ps' command
PSEXE="/usr/bin/ps"
if [ ! -x $PSEXE ]
then
PSEXE="/bin/ps"
if [ ! -x $PSEXE ]
then
echo "Unable to locate 'ps'."
echo "Please report this with the location on your system."
exit 1
fi
fi
# Build the nice clause
if [ "X$PRIORITY" = "X" ]
then
CMDNICE=""
else
CMDNICE="nice -$PRIORITY"
fi
getpid() {
if [ -f $PIDFILE ]
then
if [ -r $PIDFILE ]
then
pid=`cat $PIDFILE`
if [ "X$pid" != "X" ]
then
# Verify that a process with this pid is still running.
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
if [ "X$pid" = "X" ]
then
# This is a stale pid file.
rm -f $PIDFILE
echo "Removed stale pid file: $PIDFILE"
fi
fi
else
echo "Cannot read $PIDFILE."
exit 1
fi
fi
}
testpid() {
pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
if [ "X$pid" = "X" ]
then
# Process is gone so remove the pid file.
rm -f $PIDFILE
fi
}
console() {
echo "Running $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
exec sudo -u $USERNAME $CMDNICE $EXEC
else
echo "$APP_LONG_NAME is already running."
exit 1
fi
}
start() {
echo "Starting $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
sudo -u $USERNAME $CMDNICE $EXEC
pid=`$PSEXE -C $APP_NAME -o pid=`
echo $pid
echo $pid > $PIDFILE
else
echo "$APP_LONG_NAME is already running."
exit 1
fi
}
stopit() {
echo "Stopping $APP_LONG_NAME..."
getpid
if [ "X$pid" = "X" ]
then
echo "$APP_LONG_NAME was not running."
else
# Running so try to stop it.
sudo -u $USERNAME kill $pid
if [ $? -ne 0 ]
then
# An explanation for the failure should have been given
echo "Unable to stop $APP_LONG_NAME."
exit 1
fi
# We can not predict how long it will take for the wrapper to
# actually stop as it depends on settings in wrapper.conf.
# Loop until it does.
savepid=$pid
CNT=0
TOTCNT=0
while [ "X$pid" != "X" ]
do
# Loop for up to 5 minutes
if [ "$TOTCNT" -lt "300" ]
then
if [ "$CNT" -lt "5" ]
then
CNT=`expr $CNT + 1`
else
echo "Waiting for $APP_LONG_NAME to exit..."
CNT=0
fi
TOTCNT=`expr $TOTCNT + 1`
sleep 1
testpid
else
pid=
fi
done
pid=$savepid
testpid
if [ "X$pid" != "X" ]
then
echo "Timed out waiting for $APP_LONG_NAME to exit."
echo " Attempting a forced exit..."
kill -9 $pid
fi
pid=$savepid
testpid
if [ "X$pid" != "X" ]
then
echo "Failed to stop $APP_LONG_NAME."
exit 1
else
echo "Stopped $APP_LONG_NAME."
fi
fi
}
status() {
getpid
if [ "X$pid" = "X" ]
then
echo "$APP_LONG_NAME is not running."
exit 1
else
echo "$APP_LONG_NAME is running ($pid)."
exit 0
fi
}
case "$1" in
'console')
console
;;
'start')
start
;;
'stop')
stopit
;;
'restart')
stopit
start
;;
'status')
status
;;
*)
echo "Usage: $0 { console | start | stop | restart | status }"
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,10 @@
MAINTAINERCLEANFILES = Makefile.in
INCLUDES = $(UNIMRCP_APR_INCLUDES) $(UNIMRCP_APU_INCLUDES)
noinst_PROGRAMS = svnrev
svnrev_LDADD = $(UNIMRCP_APR_LIBS) $(UNIMRCP_APU_LIBS)
svnrev_SOURCES = svnrev.c
rev:
./svnrev -rsvnrev.input -p../../ -o../uni_revision.h

View File

@ -0,0 +1,381 @@
/* SvnRev
*
* This utility retrieves the highest number that follows the "$Id: $" keyword
* or a combination of the $Rev: $ and $Date: $ keywords. The Subversion
* version control system expands these keywords and keeps them up to date.
* For an example of the tag, see the end of this comment.
*
* Details on the usage and the operation of this utility is available on-line
* at http://www.compuphase.com/svnrev.htm.
*
*
* Acknowledgements
*
* The support for .java files is contributed by Tom McCann (tommc@spoken.com).
* The option for prefixing and/or suffixing the build number (in the string
* constant SVN_REVSTR) was suggested by Robert Nitzel.
*
*
* License
*
* Copyright (c) 2005-2009, ITB CompuPhase (www.compuphase.com).
*
* This software is provided "as-is", without any express or implied warranty.
* In no event will the authors be held liable for any damages arising from
* the use of this software.
*
* Permission is granted to anyone to use this software for any purpose,
* including commercial applications, and to alter it and redistribute it
* freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not
* claim that you wrote the original software. If you use this software in
* a product, an acknowledgment in the product documentation would be
* appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be
* misrepresented as being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*
* Version: $Id: svnrev.c 1497 2010-02-12 17:20:21Z achaloyan $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <apr_pools.h>
#include <apr_file_io.h>
#if defined __WIN32__ || defined _Win32 || defined _WIN32
#define DIRSEP '\\'
#elif defined macintosh
#define DIRSEP ':'
#else
/* assume Linux/Unix */
#define DIRSEP '/'
#endif
#define MAX_LINELENGTH 512
#define MAX_SYMBOLLENGTH 32
static void about(void)
{
printf("svnrev 1.7.\n\n");
printf("Usage: svnrev [options] <input> [input [...]]\n\n"
"Options:\n"
"-ofilename\tOutput filename for the file with the build number. When no\n"
"\t\tfilename follows \"-o\", the result is written to stdout. The\n"
"\t\tdefault filename is \"svnrev.h\" for C/C++ and \"VersionInfo.java\"\n"
"\t\tfor Java.\n\n"
"-fpattern\tFormat: Adds text before or after the build number in the\n"
"\t\tconstant SVN_REVSTR. The pattern has the form \"text#text\"\n"
"\t\t(without the quotes) where \"text\" is arbitrary text and \"#\"\n"
"\t\twill be replaced by the build number.\n\n"
"-i\t\tIncremental: this option should be used when the list of input\n"
"\t\tfiles is a subset of all files in the project. When -i is\n"
"\t\tpresent, svnrev also scans the output file that was generated\n"
"\t\ton a previous run.\n\n"
"-jname\t\tJava: this option writes a java package file instead of a C/C++\n"
"\t\theader file. The name of the Java package must follow the\n"
"\t\toption (this is not the filename).\n\n"
"-v\t\tVerbose: prints the names of files that are modified since the\n"
"\t\tlast commit (into version control) to stderr.\n");
exit(1);
}
static void processfile(const char *name, int failsilent,
int *max_build, int *accum_build,
int *max_year, int *max_month, int *max_day,
int *ismodified)
{
char str[MAX_LINELENGTH], str_base[MAX_LINELENGTH];
char name_base[MAX_LINELENGTH];
char *p1;
FILE *fp, *fp_base;
int build, maj_build;
int year, month, day;
int cnt;
char modchar;
/* since we also want to verify whether the file is modified in version
* control, get the path to the working copy name
* for every source file "<path>\<filename>, the "working copy" base can
* be found in "<path>\.svn\text-base\<filename>.svn-base"
*/
if ((p1 = strrchr(name, DIRSEP)) != NULL) {
++p1; /* skip directory separator character ('\' in Windows, '/' in Linux) */
strncpy(name_base, name, (int)(p1 - name));
name_base[(int)(p1 - name)] = '\0';
} else {
name_base[0] = '\0';
p1 = (char*)name;
} /* if */
sprintf(name_base + strlen(name_base), ".svn%ctext-base%c%s.svn-base",
DIRSEP, DIRSEP, p1);
/* first extract the revision keywords */
fp = fopen(name, "r");
if (fp == NULL) {
if (!failsilent)
fprintf(stderr, "Failed to open input file '%s'\n", name);
return;
} /* if */
fp_base = fopen(name_base, "r"); /* fail silently */
build = 0;
maj_build = 0; /* RCS / CVS */
year = month = day = 0;
while (fgets(str, sizeof str, fp) != NULL) {
if (fp_base == NULL || fgets(str_base, sizeof str_base, fp_base) == NULL)
str_base[0] = '\0';
if ((p1 = strstr(str, "$Id:")) != NULL && strchr(p1+1, '$') != NULL) {
if (sscanf(p1, "$Id: %*s %d %d-%d-%d", &build, &year, &month, &day) < 4
&& sscanf(p1, "$Id: %*s %d %d/%d/%d", &build, &year, &month, &day) < 4)
if (sscanf(p1, "$Id: %*s %d.%d %d-%d-%d", &maj_build, &build, &year, &month, &day) < 5)
sscanf(p1, "$Id: %*s %d.%d %d/%d/%d", &maj_build, &build, &year, &month, &day);
} else if ((p1 = strstr(str, "$Rev:")) != NULL && strchr(p1+1, '$') != NULL) {
if (sscanf(p1, "$Rev: %d.%d", &maj_build, &build) < 2) {
sscanf(p1, "$Rev: %d", &build);
maj_build = 0;
} /* if */
} else if ((p1 = strstr(str, "$Revision:")) != NULL && strchr(p1+1, '$') != NULL) {
if (sscanf(p1, "$Revision: %d.%d", &maj_build, &build) < 2) {
/* SvnRev also writes this keyword in its own generated file; read it
* back for partial updates
*/
cnt = sscanf(p1, "$Revision: %d%c", &build, &modchar);
if (cnt == 2 && modchar == 'M' && ismodified != NULL)
*ismodified = 1;
maj_build = 0;
} /* if */
} else if ((p1 = strstr(str, "$Date:")) != NULL && strchr(p1+1, '$') != NULL) {
if (sscanf(p1, "$Date: %d-%d-%d", &year, &month, &day) < 3)
sscanf(p1, "$Date: %d/%d/%d", &year, &month, &day);
} else if (ismodified != NULL && *ismodified == 0 && fp_base != NULL) {
/* no keyword present, compare the lines for equivalence */
*ismodified = strcmp(str, str_base) != 0;
} /* if */
if (maj_build)
*accum_build += build; /* RCS / CVS */
else if (build > *max_build)
*max_build = build; /* Subversion */
if (year > *max_year
|| (year == *max_year && month > *max_month)
|| (year == *max_year && month == *max_month && day > *max_day))
{
*max_year = year;
*max_month = month;
*max_day = day;
} /* if */
if (build > 0 && year > 0 && (fp_base == NULL || ismodified == NULL || *ismodified != 0))
break; /* both build # and date found, not comparing or modification
* already found => no need to search further */
} /* while */
fclose(fp);
if (fp_base != NULL)
fclose(fp_base);
}
int main(int argc, char *argv[])
{
char *outname = NULL;
FILE *fp;
FILE *input_file;
char *input_file_name = NULL;
char *path_prefix = NULL;
int index;
int process_self = 0;
int verbose = 0;
int max_build, accum_build;
int max_year, max_month, max_day;
int ismodified, filemodified;
char prefix[MAX_SYMBOLLENGTH], suffix[MAX_SYMBOLLENGTH];
char modified_suffix[2];
int write_java = 0; /* flag for Java output, 0=.h output, 1=.java output */
/* java package to put revision info in.
* REVIEW - I assume if you want Java output you will specify a package. */
char *java_package = NULL;
if (argc <= 1)
about();
/* collect the options */
prefix[0] = '\0';
suffix[0] = '\0';
for (index = 1; index < argc; index++) {
/* check for options */
if (argv[index][0] == '-'
#if defined __WIN32__ || defined _Win32 || defined _WIN32
|| argv[index][0] == '/'
#endif
)
{
switch (argv[index][1]) {
case 'f': {
int len;
char *ptr = strchr(&argv[index][2], '#');
len = (ptr != NULL) ? (int)(ptr - &argv[index][2]) : (int)strlen(&argv[index][2]);
if (len >= MAX_SYMBOLLENGTH)
len = MAX_SYMBOLLENGTH - 1;
strncpy(prefix, &argv[index][2], len);
prefix[len] = '\0';
ptr = (ptr != NULL) ? ptr + 1 : strchr(argv[index], '\0');
len = (int)strlen(ptr);
if (len >= MAX_SYMBOLLENGTH)
len = MAX_SYMBOLLENGTH - 1;
strncpy(suffix, ptr, len);
suffix[len] = '\0';
break;
} /* case */
case 'i':
process_self = 1;
break;
case 'j':
write_java=1;
java_package = &argv[index][2];
break;
case 'o':
outname = &argv[index][2];
break;
case 'r':
input_file_name = &argv[index][2];
break;
case 'p':
path_prefix = &argv[index][2];
break;
case 'v':
verbose = 1;
break;
default:
fprintf(stderr, "Invalid option '%s'\n", argv[index]);
about();
} /* switch */
} /* if */
} /* for */
if (outname == NULL)
outname = write_java ? "SvnRevision.java" : "uni_revision.h";
if (!process_self && *outname != '\0')
remove(outname);
/* phase 1: scan through all files and get the highest build number */
max_build = 0;
accum_build = 0; /* for RCS / CVS */
max_year = max_month = max_day = 0;
ismodified = 0;
if(input_file_name) {
input_file = fopen(input_file_name, "r");
if (input_file != NULL) {
apr_dir_t *dir;
apr_finfo_t finfo;
apr_status_t rv;
apr_pool_t *pool;
char *file_path;
char dir_path[256]; /* line */
int offset = 0;
if(path_prefix)
offset = sprintf(dir_path, "%s", path_prefix);
else
offset = sprintf(dir_path, "../../");
apr_initialize();
apr_pool_create(&pool,NULL);
while (fgets(dir_path + offset, sizeof(dir_path) - offset, input_file) != NULL ) { /* read a line */
size_t len = strlen(dir_path)-1;
if(dir_path[len] == '\n')
dir_path[len] = 0;
rv = apr_dir_open(&dir,dir_path,pool);
if(rv == APR_SUCCESS) {
while (apr_dir_read(&finfo, APR_FINFO_NAME, dir) == APR_SUCCESS) { /* get next file */
if(finfo.filetype != APR_REG) continue;
apr_filepath_merge(&file_path,dir_path,finfo.name,0,pool);
filemodified = 0;
if (strcasecmp(file_path, outname)!=0)
processfile(file_path, 0, &max_build, &accum_build, &max_year, &max_month, &max_day, &filemodified);
if (filemodified && verbose)
fprintf(stderr, "\tNotice: modified file '%s'\n", file_path);
ismodified = ismodified || filemodified;
}
apr_dir_close(dir);
}
else {
fprintf(stderr, "No such directory '%s'\n", dir_path);
}
}
fclose (input_file);
apr_pool_destroy(pool);
apr_terminate();
}
else {
fprintf(stderr, "No such input file '%s'\n", input_file_name);
}
}
else {
for (index = 1; index < argc; index++) {
/* skip the options (already handled) */
if (argv[index][0] == '-'
#if defined __WIN32__ || defined _Win32 || defined _WIN32
|| argv[index][0] == '/'
#endif
)
continue;
filemodified = 0;
if (strcasecmp(argv[index], outname)!=0)
processfile(argv[index], 0, &max_build, &accum_build, &max_year, &max_month, &max_day, &filemodified);
if (filemodified && verbose)
fprintf(stderr, "\tNotice: modified file '%s'\n", argv[index]);
ismodified = ismodified || filemodified;
} /* for */
}
/* also run over the existing header file, if any */
if (process_self && *outname != '\0')
processfile(outname, 1, &max_build, &accum_build, &max_year, &max_month, &max_day, NULL/*&ismodified*/);
if (accum_build > max_build)
max_build = accum_build;
modified_suffix[0] = ismodified ? 'M' : '\0';
modified_suffix[1] = '\0';
/* phase 2: write a file with this highest build number */
if (*outname == '\0') {
fp = stdout;
} else if ((fp = fopen(outname, "w")) == NULL) {
fprintf(stderr, "Failed to create output file '%s'\n", outname);
return 2;
} /* if */
if (*outname != '\0') {
/* don't print the comments to stdout */
fprintf(fp, "/* This file was generated by the \"svnrev\" utility\n"
" * (http://www.compuphase.com/svnrev.htm).\n"
" * You should not modify it manually, as it may be re-generated.\n"
" *\n"
" * $Revision: %d%s$\n"
" * $Date: %04d-%02d-%02d$\n"
" */\n\n", max_build, modified_suffix, max_year, max_month, max_day);
} /* if */
fprintf(fp, "#ifndef UNI_REVISION_H\n");
fprintf(fp, "#define UNI_REVISION_H\n\n");
fprintf(fp, "#define UNI_REVISION\t\t%d\n", max_build);
fprintf(fp, "#define UNI_REVISION_STRING\t\"%s%d%s%s\"\n", prefix, max_build, modified_suffix, suffix);
fprintf(fp, "#define UNI_REVISION_DATE\t\"%04d-%02d-%02d\"\n", max_year, max_month, max_day);
fprintf(fp, "#define UNI_REVISION_STAMP\t%04d%02d%02dL\n", max_year, max_month, max_day);
fprintf(fp, "#define UNI_REVISION_MODIFIED\t%d\n", ismodified);
fprintf(fp, "\n#endif /* UNI_REVISION_H */\n");
if (*outname != '\0')
fclose(fp);
return 0;
}

View File

@ -0,0 +1,32 @@
build
libs/apr-toolkit/include
libs/apr-toolkit/src
libs/mpf/include
libs/mpf/src
libs/mrcp/control/include
libs/mrcp/control/src
libs/mrcp/include
libs/mrcp/message/include
libs/mrcp/message/src
libs/mrcp/resources/include
libs/mrcp/resources/src
libs/mrcp-client/include
libs/mrcp-client/src
libs/mrcp-server/include
libs/mrcp-server/src
libs/mrcp-engine/include
libs/mrcp-engine/src
libs/mrcp-signaling/include
libs/mrcp-signaling/src
libs/mrcpv2-transport/include
libs/mrcpv2-transport/src
libs/uni-rtsp/include
libs/uni-rtsp/src
modules/mrcp-sofiasip/include
modules/mrcp-sofiasip/src
modules/mrcp-unirtsp/include
modules/mrcp-unirtsp/src
platforms/libunimrcp-client/include
platforms/libunimrcp-client/src
platforms/libunimrcp-server/include
platforms/libunimrcp-server/src

View File

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="svnrev"
ProjectGUID="{49AAB3FE-63D3-41CA-B92B-65828B79902B}"
RootNamespace="svnrev"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apt.vsprops;$(ProjectDir)..\..\build\vsprops\unibin.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
CommandLine="$(SolutionDir)$(ConfigurationName)\bin\svnrev -r$(SolutionDir)build\svnrev\svnrev.input -p$(SolutionDir) -o$(SolutionDir)build\uni_revision.h&#x0D;&#x0A;"
Outputs="$(SolutionDir)build\uni_revision.h"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
GenerateDebugInformation="true"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apt.vsprops;$(ProjectDir)..\..\build\vsprops\unibin-x64.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
CommandLine="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\svnrev -r$(SolutionDir)build\svnrev\svnrev.input -p$(SolutionDir) -o$(SolutionDir)build\uni_revision.h&#x0D;&#x0A;"
Outputs="$(SolutionDir)build\uni_revision.h"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
GenerateDebugInformation="true"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apt.vsprops;$(ProjectDir)..\..\build\vsprops\unibin.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
CommandLine="$(SolutionDir)$(ConfigurationName)\bin\svnrev -r$(SolutionDir)build\svnrev\svnrev.input -p$(SolutionDir) -o$(SolutionDir)build\uni_revision.h&#x0D;&#x0A;"
Outputs="$(SolutionDir)build\uni_revision.h"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apt.vsprops;$(ProjectDir)..\..\build\vsprops\unibin-x64.vsprops"
CharacterSet="2"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
CommandLine="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\svnrev -r$(SolutionDir)build\svnrev\svnrev.input -p$(SolutionDir) -o$(SolutionDir)build\uni_revision.h&#x0D;&#x0A;"
Outputs="$(SolutionDir)build\uni_revision.h"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
RuntimeLibrary="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
GenerateDebugInformation="true"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\svnrev.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="prepare"
ProjectGUID="{01D63BF5-7798-4746-852A-4B45229BB735}"
RootNamespace="prepare"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apr.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apr.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
</Files>
</VisualStudioProject>

View File

@ -28,7 +28,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; (&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xsd&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\client-profiles\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\client-profiles\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
ExcludedFromBuild="false"
/>
<Tool
@ -41,29 +41,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apr.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
@ -74,7 +51,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(PlatformName)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(PlatformName)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(PlatformName)\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\$(PlatformName)\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
CommandLine="xcopy &quot;$(AprDir)\$(PlatformName)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(PlatformName)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(PlatformName)\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\$(PlatformName)\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf&quot; (&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xsd&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\client-profiles\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\client-profiles\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
ExcludedFromBuild="false"
/>
<Tool
@ -88,6 +65,29 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\apr.vsprops;$(ProjectDir)..\..\build\vsprops\sofiasip.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf&quot; (&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xsd&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\client-profiles\*.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\client-profiles\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
@ -99,7 +99,7 @@
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(AprDir)\$(PlatformName)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(PlatformName)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(PlatformName)\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\$(PlatformName)\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf&quot; xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
CommandLine="xcopy &quot;$(AprDir)\$(PlatformName)\$(ConfigurationName)\libapr-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(AprUtilDir)\$(PlatformName)\$(ConfigurationName)\libaprutil-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; (&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\libapriconv-1.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;if exist &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv&quot; (&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv&quot;&#x0D;&#x0A;xcopy &quot;$(AprIconvDir)\$(PlatformName)\$(ConfigurationName)\iconv\*.so&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\iconv\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\libsofia-sip-ua\$(PlatformName)\$(ConfigurationName)\libsofia_sip_ua.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SofiaDir)\win32\pthread\$(PlatformName)\pthreadVC2.dll&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf&quot; (&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\*.xsd&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SolutionDir)conf\client-profiles\*.xml&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\conf\client-profiles\&quot; /Y&#x0D;&#x0A;)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data&quot; xcopy &quot;$(SolutionDir)data\*&quot; &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\data\&quot; /Y&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log&quot; mkdir &quot;$(SolutionDir)$(PlatformName)\$(ConfigurationName)\log\&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"

View File

@ -1,68 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="preparesphinx"
ProjectGUID="{71D62A04-8EF6-4C6B-AC12-0C15A875E53A}"
RootNamespace="preparesphinx"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\pocketsphinx.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(PocketSphinxDir)\bin\$(ConfigurationName)\pocketsphinx.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SphinxBaseDir)\lib\$(ConfigurationName)\sphinxbase.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(PocketSphinxDir)\model\hmm\wsj1\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\wsj1\&quot; /Y&#x0D;&#x0A;copy &quot;$(PocketSphinxDir)\model\lm\cmudict.0.6d&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\default.dic&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf\pocketsphinx.xml&quot; xcopy &quot;$(SolutionDir)plugins\mrcp-pocketsphinx\conf\pocketsphinx.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;"
ExcludedFromBuild="false"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="10"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\pocketsphinx.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="xcopy &quot;$(PocketSphinxDir)\bin\$(ConfigurationName)\pocketsphinx.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;xcopy &quot;$(SphinxBaseDir)\lib\$(ConfigurationName)\sphinxbase.dll&quot; &quot;$(SolutionDir)$(ConfigurationName)\bin\&quot; /Y&#x0D;&#x0A;&#x0D;&#x0A;xcopy &quot;$(PocketSphinxDir)\model\hmm\wsj1\*&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\wsj1\&quot; /Y&#x0D;&#x0A;copy &quot;$(PocketSphinxDir)\model\lm\cmudict.0.6d&quot; &quot;$(SolutionDir)$(ConfigurationName)\data\default.dic&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(SolutionDir)$(ConfigurationName)\conf\pocketsphinx.xml&quot; xcopy &quot;$(SolutionDir)plugins\mrcp-pocketsphinx\conf\pocketsphinx.xml&quot; &quot;$(SolutionDir)$(ConfigurationName)\conf\&quot; /Y&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
</Files>
</VisualStudioProject>

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: unimrcp_service.c 1474 2010-02-07 20:51:47Z achaloyan $
*/
#include <windows.h>

View File

@ -1,158 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="unimrcpservice"
ProjectGUID="{4714EF49-BFD5-4B22-95F7-95A07F1EAC25}"
RootNamespace="unimrcpservice"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
AdditionalManifestFiles="unimrcpservice.exe.manifest"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="1"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
LinkTimeCodeGeneration="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
AdditionalManifestFiles="unimrcpservice.exe.manifest"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="src"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\unimrcp_service.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -51,7 +51,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
AdditionalDependencies="aprtoolkit.lib libaprutil-1.lib libapr-1.lib"
/>
<Tool
Name="VCALinkTool"
@ -113,7 +113,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
AdditionalDependencies="aprtoolkit.lib libaprutil-1.lib libapr-1.lib"
LinkTimeCodeGeneration="1"
/>
<Tool
@ -178,7 +178,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
AdditionalDependencies="aprtoolkit.lib libaprutil-1.lib libapr-1.lib"
/>
<Tool
Name="VCALinkTool"
@ -241,7 +241,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libaprutil-1.lib libapr-1.lib"
AdditionalDependencies="aprtoolkit.lib libaprutil-1.lib libapr-1.lib"
LinkTimeCodeGeneration="1"
/>
<Tool

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: uni_version.h 1724 2010-06-02 18:42:20Z achaloyan $
*/
#ifndef __UNI_VERSION_H__
#define __UNI_VERSION_H__
#ifndef UNI_VERSION_H
#define UNI_VERSION_H
/**
* @file uni_version.h
@ -26,20 +28,18 @@
* http://apr.apache.org/versioning.html
*/
#include <apr_version.h>
/** major version
* Major API changes that could cause compatibility problems for older
* programs such as structure size changes. No binary compatibility is
* possible across a change in the major version.
*/
#define UNI_MAJOR_VERSION 0
#define UNI_MAJOR_VERSION 1
/** minor version
* Minor API changes that do not cause binary compatibility problems.
* Reset to 0 when upgrading UNI_MAJOR_VERSION
*/
#define UNI_MINOR_VERSION 9
#define UNI_MINOR_VERSION 0
/** patch level
* The Patch Level never includes API changes, simply bug fixes.
@ -57,10 +57,40 @@
|| ((major) == UNI_MAJOR_VERSION && (minor) < UNI_MINOR_VERSION) \
|| ((major) == UNI_MAJOR_VERSION && (minor) == UNI_MINOR_VERSION && (patch) <= UNI_PATCH_VERSION))
/** Properly quote a value as a string in the C preprocessor */
#define UNI_STRINGIFY(n) UNI_STRINGIFY_HELPER(n)
/** Helper macro for UNI_STRINGIFY */
#define UNI_STRINGIFY_HELPER(n) #n
/** The formatted string of UniMRCP's version */
#define UNI_VERSION_STRING \
APR_STRINGIFY(UNI_MAJOR_VERSION) "." \
APR_STRINGIFY(UNI_MINOR_VERSION) "." \
APR_STRINGIFY(UNI_PATCH_VERSION)
UNI_STRINGIFY(UNI_MAJOR_VERSION) "." \
UNI_STRINGIFY(UNI_MINOR_VERSION) "." \
UNI_STRINGIFY(UNI_PATCH_VERSION)
#endif /* __UNI_VERSION_H__ */
/** An alternative formatted string of UniMRCP's version
macro for Win32 .rc files using numeric csv representation */
#define UNI_VERSION_STRING_CSV UNI_MAJOR_VERSION ##, \
##UNI_MINOR_VERSION ##, \
##UNI_PATCH_VERSION
/** The Copyright */
#define UNI_COPYRIGHT "Copyright 2008-2010 Arsen Chaloyan"
/** The License */
#define UNI_LICENSE \
"Licensed under the Apache License, Version 2.0 (the ""License"");" \
"you may not use this file except in compliance with the License." \
"You may obtain a copy of the License at" \
"" \
" http://www.apache.org/licenses/LICENSE-2.0" \
"" \
"Unless required by applicable law or agreed to in writing, software" \
"distributed under the License is distributed on an ""AS IS"" BASIS," \
"WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied." \
"See the License for the specific language governing permissions and" \
"limitations under the License."
#endif /* UNI_VERSION_H */

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vsprops\unibase.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<AprDir>$(LibRootDir)libs\apr</AprDir>
<AprUtilDir>$(LibRootDir)libs\apr-util</AprUtilDir>
<AprIconvDir>$(LibRootDir)libs\apr-iconv</AprIconvDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(AprDir)\include;$(AprUtilDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="AprDir">
<Value>$(AprDir)</Value>
</BuildMacro>
<BuildMacro Include="AprUtilDir">
<Value>$(AprUtilDir)</Value>
</BuildMacro>
<BuildMacro Include="AprIconvDir">
<Value>$(AprIconvDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="apr.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\apr-toolkit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>APT_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="cepstral"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(CepstralSDKDir)\include&quot;"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="swift.lib"
AdditionalLibraryDirectories="&quot;$(CepstralSDKDir)\lib\lib-windows&quot;"
/>
<UserMacro
Name="CepstralSDKDir"
Value="C:\Program Files\Cepstral\sdk"
/>
</VisualStudioPropertySheet>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="apt.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\mpf\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MPF_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="apt.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\mrcp\include;$(ProjectRootDir)libs\mrcp\message\include;$(ProjectRootDir)libs\mrcp\control\include;$(ProjectRootDir)libs\mrcp\resources\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>MRCP_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="mrcpsignaling.props" />
<Import Project="mrcpv2transport.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\mrcp-client\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="mpf.props" />
<Import Project="mrcp.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\mrcp-signaling\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="mrcp.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\mrcpv2-transport\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vsprops\unibase.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<SofiaDir>$(LibRootDir)libs\sofia-sip</SofiaDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SofiaDir)\win32;$(SofiaDir)\libsofia-sip-ua\su;$(SofiaDir)\libsofia-sip-ua\nua;$(SofiaDir)\libsofia-sip-ua\url;$(SofiaDir)\libsofia-sip-ua\sip;$(SofiaDir)\libsofia-sip-ua\msg;$(SofiaDir)\libsofia-sip-ua\sdp;$(SofiaDir)\libsofia-sip-ua\nta;$(SofiaDir)\libsofia-sip-ua\nea;$(SofiaDir)\libsofia-sip-ua\soa;$(SofiaDir)\libsofia-sip-ua\iptsec;$(SofiaDir)\libsofia-sip-ua\bnf;$(SofiaDir)\libsofia-sip-ua\features;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="SofiaDir">
<Value>$(SofiaDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="UserMacros">
<ProjectRootDir>$(ProjectDir)..\..\</ProjectRootDir>
<LibRootDir>$(SolutionDir)</LibRootDir>
</PropertyGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<DisableSpecificWarnings>4100;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<BuildMacro Include="ProjectRootDir">
<Value>$(ProjectRootDir)</Value>
</BuildMacro>
<BuildMacro Include="LibRootDir">
<Value>$(LibRootDir)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vsprops\unibase.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -11,6 +11,6 @@
/>
<UserMacro
Name="UniMRCPClientLibs"
Value="libunimrcpclient.lib mrcpclient.lib mrcpsignaling.lib mrcp.lib aprtoolkit.lib libaprutil-1.lib libapr-1.lib libsofia_sip_ua.lib ws2_32.lib winmm.lib"
Value="libunimrcpclient.lib mrcpsofiasip.lib mrcpunirtsp.lib unirtsp.lib mrcpclient.lib mrcpv2transport.lib mrcpsignaling.lib mrcp.lib mpf.lib aprtoolkit.lib libaprutil-1.lib libapr-1.lib libsofia_sip_ua.lib ws2_32.lib winmm.lib"
/>
</VisualStudioPropertySheet>

View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioPropertySheet
ProjectType="Visual C++"
Version="8.00"
Name="unimrcpplugin"
OutputDirectory="$(SolutionDir)$(ConfigurationName)\plugin"
InheritedPropertySheets=".\mrcpengine.vsprops"
>
<Tool
Name="VCLinkerTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalLibraryDirectories="&quot;$(SolutionDir)$(ConfigurationName)\bin&quot;"
AdditionalDependencies="mrcpengine.lib mrcp.lib mpf.lib aprtoolkit.lib libaprutil-1.lib libapr-1.lib ws2_32.lib"
/>
</VisualStudioPropertySheet>

View File

@ -11,6 +11,6 @@
/>
<UserMacro
Name="UniMRCPServerLibs"
Value="libunimrcpserver.lib mrcpserver.lib mrcpsignaling.lib mrcpengine.lib mrcp.lib aprtoolkit.lib libaprutil-1.lib libapr-1.lib libsofia_sip_ua.lib ws2_32.lib winmm.lib"
Value="libunimrcpserver.lib mrcpsofiasip.lib mrcpunirtsp.lib unirtsp.lib mrcpserver.lib mrcpv2transport.lib mrcpsignaling.lib mrcpengine.lib mrcp.lib mpf.lib aprtoolkit.lib libaprutil-1.lib libapr-1.lib libsofia_sip_ua.lib ws2_32.lib winmm.lib"
/>
</VisualStudioPropertySheet>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="$(ProjectDir)..\..\build\vsprops\unibase.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets">
<Import Project="apt.props" />
</ImportGroup>
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectRootDir)libs\uni-rtsp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>RTSP_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
</Project>

View File

@ -2,10 +2,17 @@ MAINTAINERCLEANFILES = Makefile.in
def-conf:
test -d $(confdir) || $(mkinstalldirs) $(confdir)
for conffile in `find ./ -name \*.xml` ; do \
for conffile in `find ./ -maxdepth 1 -name \*.xml -o -name \*.xsd` ; do \
filename=`echo $$conffile | sed -e 's|^.*/||'`; \
$(INSTALL) -m 644 $$filename $(confdir); \
done
test -d $(confdir)/client-profiles || $(mkinstalldirs) $(confdir)/client-profiles
for conffile in `find ./client-profiles/ -maxdepth 1 -name \*.xml -o -name \*.xsd` ; do \
filename=`echo $$conffile | sed -e 's|^.*/||'`; \
$(INSTALL) -m 644 client-profiles/$$filename $(confdir)/client-profiles; \
done
install-data-local:
test -d $(confdir) || $(MAKE) def-conf

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd"
version="1.0">
<settings>
<!-- SIP MRCPv2 settings -->
<sip-settings id="LumenVox-SIP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>5060</server-port>
<!-- <force-destination>true</force-destination> -->
</sip-settings>
<!-- RTSP MRCPv1 settings -->
<rtsp-settings id="LumenVox-RTSP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>554</server-port>
<!-- <force-destination>true</force-destination> -->
<resource-location></resource-location>
<resource-map>
<param name="speechrecog" value="recognizer"/>
</resource-map>
</rtsp-settings>
</settings>
<profiles>
<!-- LumenVox MRCPv2 profile -->
<mrcpv2-profile id="lv2">
<sip-uac>SIP-Agent-1</sip-uac>
<mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<sip-settings>LumenVox-SIP-Settings</sip-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>
<!-- LumenVox MRCPv1 profile -->
<mrcpv1-profile id="lv1">
<rtsp-uac>RTSP-Agent-1</rtsp-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtsp-settings>LumenVox-RTSP-Settings</rtsp-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv1-profile>
<!-- more profiles might be added here -->
</profiles>
</unimrcpclient>

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd"
version="1.0">
<settings>
<!-- SIP MRCPv2 settings -->
<sip-settings id="Nuance-SIP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>5060</server-port>
<!-- <force-destination>true</force-destination> -->
<!-- <feature-tags>*;+mrcpv2.speechrecog;+mrcpv2.speechrecog.grammars="http://grammars.example.com/biggrammar.gram"</feature-tags> -->
</sip-settings>
<!-- RTSP MRCPv1 settings -->
<rtsp-settings id="Nuance-RTSP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>4900</server-port>
<!-- <force-destination>true</force-destination> -->
<resource-location>media</resource-location>
<resource-map>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resource-map>
</rtsp-settings>
<!-- RTP/RTCP settings -->
<rtp-settings id="Nuance-RTP-Settings">
<jitter-buffer>
<playout-delay>50</playout-delay>
<max-playout-delay>200</max-playout-delay>
</jitter-buffer>
<ptime>20</ptime>
<codecs>PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs>
<!-- enable/disable RTCP support -->
<rtcp enable="true">
<!-- RTCP BYE policies (RTCP must be enabled first)
0 - disable RTCP BYE
1 - send RTCP BYE at the end of session
2 - send RTCP BYE also at the end of each talkspurt (input)
-->
<rtcp-bye>2</rtcp-bye>
<!-- rtcp transmission interval in msec (set 0 to disable) -->
<tx-interval>5000</tx-interval>
<!-- period (timeout) to check for new rtcp messages in msec (set 0 to disable) -->
<rx-resolution>1000</rx-resolution>
</rtcp>
</rtp-settings>
</settings>
<profiles>
<!-- Nuance MRCPv2 profile -->
<mrcpv2-profile id="nss2">
<sip-uac>SIP-Agent-1</sip-uac>
<mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<sip-settings>Nuance-SIP-Settings</sip-settings>
<rtp-settings>Nuance-RTP-Settings</rtp-settings>
</mrcpv2-profile>
<!-- Nuance MRCPv1 profile -->
<mrcpv1-profile id="nss1">
<rtsp-uac>RTSP-Agent-1</rtsp-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtsp-settings>Nuance-RTSP-Settings</rtsp-settings>
<rtp-settings>Nuance-RTP-Settings</rtp-settings>
</mrcpv1-profile>
<!-- more profiles might be added here -->
</profiles>
</unimrcpclient>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd"
version="1.0">
<settings>
<!-- RTSP MRCPv1 settings -->
<rtsp-settings id="SpeechPro-RTSP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>8000</server-port>
<!-- <force-destination>true</force-destination> -->
<resource-location></resource-location>
<resource-map>
<param name="speechsynth" value="tts"/>
<param name="speechrecog" value="asr"/>
</resource-map>
</rtsp-settings>
</settings>
<profiles>
<!-- SpeechPro MRCPv1 profile -->
<mrcpv1-profile id="sp1">
<rtsp-uac>RTSP-Agent-1</rtsp-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtsp-settings>SpeechPro-RTSP-Settings</rtsp-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv1-profile>
<!-- more profiles might be added here -->
</profiles>
</unimrcpclient>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd"
version="1.0">
<settings>
<!-- SIP MRCPv2 settings -->
<sip-settings id="UniMRCP-SIP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>8060</server-port>
<!-- <force-destination>true</force-destination> -->
</sip-settings>
<!-- RTSP MRCPv1 settings -->
<rtsp-settings id="UniMRCP-RTSP-Settings">
<!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>1554</server-port>
<!-- <force-destination>true</force-destination> -->
<resource-location>media</resource-location>
<resource-map>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resource-map>
</rtsp-settings>
</settings>
<profiles>
<!-- UniMRCP MRCPv2 profile -->
<mrcpv2-profile id="uni2">
<sip-uac>SIP-Agent-1</sip-uac>
<mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<sip-settings>UniMRCP-SIP-Settings</sip-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>
<!-- UniMRCP MRCPv1 profile -->
<mrcpv1-profile id="uni1">
<rtsp-uac>RTSP-Agent-1</rtsp-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtsp-settings>UniMRCP-RTSP-Settings</rtsp-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv1-profile>
<!-- more profiles might be added here -->
</profiles>
</unimrcpclient>

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Logger Document -->
<aptlogger>
<!-- Set the log priority to one of
EMERGENCY system is unusable
ALERT action must be taken immediately
CRITICAL critical condition
ERROR error condition
WARNING warning condition
NOTICE normal, but significant condition
INFO informational message
DEBUG debug-level message
-->
<priority>INFO</priority>
<!-- Set the log output mode
CONSOLE console output
FILE log file output
CONSOLE,FILE both console and the log file output
-->
<output>CONSOLE</output>
<!-- Set the format of the log messages
DATE date output
TIME time output
PRIORITY priority output
MARK file:line marker output
THREAD calling thread identifier output
-->
<headers>DATE,TIME,PRIORITY</headers>
<!-- Set the log masking mode
NONE log everything as is
COMPLETE mask private data completely
ENCRYPTED enrcypt private data
-->
<masking>NONE</masking>
</aptlogger>

View File

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
UniMRCP Client Scenarios.
There are predefined, named scenarios, which you can customize and use.
@ -5,8 +6,9 @@ Currently available scenarios are
1. class="Synthesizer"
2. class="Recognizer"
3. class="Recorder"
4. class="DtmfRecofnizer"
4. class="DtmfRecognizer"
5. class="Params"
6. class="Verifier"
More than one scenario of the same type (class) can be defined.
The name (not class) of the scenario is used to run it from console.
@ -15,7 +17,7 @@ For instance,
-->
<umcscenarios>
<scenario name="synth" class="Synthesizer" profile="MRCPv2-Default">
<scenario name="synth" class="Synthesizer" profile="uni2">
<resource-discovery enable="0"/>
<speak enable="1" content-type="application/synthesis+ssml" content-location="speak.xml"/>
<!-- <speak enable="1" content-type="text/plain" content-location="speak.txt"/> -->
@ -33,7 +35,7 @@ For instance,
-->
</scenario>
<scenario name="recog" class="Recognizer" profile="MRCPv2-Default">
<scenario name="recog" class="Recognizer" profile="uni2">
<resource-discovery enable="0"/>
<define-grammar enable="1" content-type="application/srgs+xml" content-location="grammar.xml"/>
<!-- <define-grammar enable="1" content-type="application/grammar+xml" content-location="grammar.xml"/> -->
@ -55,7 +57,7 @@ For instance,
-->
</scenario>
<scenario name="rec" class="Recorder" profile="MRCPv2-Default">
<scenario name="rec" class="Recorder" profile="uni2">
<resource-discovery enable="0"/>
<record enable="1"/>
@ -72,7 +74,7 @@ For instance,
-->
</scenario>
<scenario name="dtmf" class="DtmfRecognizer" profile="MRCPv2-Default">
<scenario name="dtmf" class="DtmfRecognizer" profile="uni2">
<resource-discovery enable="0"/>
<recognize enable="1" content-type="text/uri-list" grammar="builtin:dtmf/digits" digits="1234"/> -->
@ -89,8 +91,24 @@ For instance,
-->
</scenario>
<scenario name="params" class="Params" profile="MRCPv2-Default"/>
<scenario name="params" class="Params" profile="uni2"/>
<scenario name="verify" class="Verifier" profile="uni2">
<resource-discovery enable="0"/>
<verify repository-uri="http://www.example.com/voiceprintdbase/" verification-mode="verify" voiceprint-identifier="johnsmith"/>
<termination enable="1">
<capabilities>
<codec name="LPCM" rates="8000 16000"/>
<!-- <codec name="PCMU" rates="8000 16000"/> -->
</capabilities>
</termination>
<!--
<rtp-termination enable="1" ip="127.0.0.1" port="5678">
<codecs="PCMU PCMA L16/96/8000 PCMU/97/16000 telephone-event/101/8000"/>
</rtp-termination>
-->
</scenario>
<!-- It'd be great to have scriptable custom scenarios as well.
<scenario name="custom" class="UmcXml">
</scenario>

View File

@ -1,97 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient>
<!-- MRCP resources -->
<resources>
<resource class="speechsynth" enable="1"/>
<resource class="speechrecog" enable="1"/>
<resource class="recorder" enable="1"/>
</resources>
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="unimrcpclient.xsd"
version="1.0"
subfolder="client-profiles">
<properties>
<!-- By default, network interface (IP address) to bind to will be implicitly identified.
Alternatively, it can be explicitly set.
-->
<ip type="auto"/>
<!-- <ip>10.10.0.1</ip> -->
<!-- <ext-ip>a.b.c.d</ext-ip> -->
<!-- <server-ip>a.b.c.d</server-ip> -->
</properties>
<!-- Client settings (signaling, media, ...) -->
<components>
<!-- Factory of MRCP resources -->
<resource-factory>
<resource id="speechsynth" enable="true"/>
<resource id="speechrecog" enable="true"/>
<resource id="recorder" enable="true"/>
<resource id="speakverify" enable="true"/>
</resource-factory>
<!-- SofiaSIP MRCPv2 signaling agent -->
<sip-uac id="SIP-Agent-1" type="SofiaSIP">
<!-- By default, "ip" and "ext-ip" addresses set in the properties will be used.
They still can be explicitly specified (overriden) here.
-->
<!-- <sip-ip>10.10.0.1</sip-ip> -->
<!-- <sip-ext-ip>a.b.c.d</sip-ext-ip> -->
<sip-port>8062</sip-port>
<sip-transport>udp</sip-transport>
<ua-name>UniMRCP SofiaSIP</ua-name>
<sdp-origin>UniMRCPClient</sdp-origin>
<!-- <sip-t1>500</sip-t1> -->
<!-- <sip-t2>4000</sip-t2> -->
<!-- <sip-t4>4000</sip-t4> -->
<!-- <sip-t1x64>32000</sip-t1x64> -->
</sip-uac>
<!-- UniRTSP MRCPv1 signaling agent -->
<rtsp-uac id="RTSP-Agent-1" type="UniRTSP">
<max-connection-count>100</max-connection-count>
<!-- <request-timeout>5000</request-timeout> -->
<sdp-origin>UniMRCPClient</sdp-origin>
</rtsp-uac>
<!-- MRCPv2 connection agent -->
<mrcpv2-uac id="MRCPv2-Agent-1">
<max-connection-count>100</max-connection-count>
<offer-new-connection>false</offer-new-connection>
<rx-buffer-size>1024</rx-buffer-size>
<tx-buffer-size>1024</tx-buffer-size>
<!-- <request-timeout>5000</request-timeout> -->
</mrcpv2-uac>
<!-- Media processing engine -->
<media-engine id="Media-Engine-1">
<realtime-rate>1</realtime-rate>
</media-engine>
<!-- Factory of RTP terminations -->
<rtp-factory id="RTP-Factory-1">
<!-- By default, "ip" and "ext-ip" addresses set in the properties will be used.
They still can be explicitly specified (overriden) here.
-->
<!-- <rtp-ip>10.10.0.1</rtp-ip> -->
<!-- <rtp-ext-ip>a.b.c.d</rtp-ext-ip> -->
<rtp-port-min>4000</rtp-port-min>
<rtp-port-max>5000</rtp-port-max>
</rtp-factory>
</components>
<settings>
<!-- SIP, RTSP signaling agents -->
<signaling>
<!-- SofiaSIP MRCPv2 signaling agent -->
<agent name="SIP-Agent-1" class="SofiaSIP">
<param name="client-ip" value="auto"/>
<!-- <param name="client-ext-ip" value="auto"/> -->
<param name="client-port" value="8062"/>
<param name="server-ip" value="auto"/>
<param name="server-port" value="8060"/>
<!-- <param name="force-destination" value="1"/> -->
<!-- <param name="sip-transport" value="tcp"/> -->
<param name="sip-transport" value="udp"/>
<param name="ua-name" value="UniMRCP SofiaSIP"/>
<param name="sdp-origin" value="UniMRCPClient"/>
</agent>
<!-- UniRTSP MRCPv1 signaling agent -->
<agent name="RTSP-Agent-1" class="UniRTSP">
<param name="server-ip" value="auto"/>
<param name="server-port" value="1554"/>
<!-- <param name="force-destination" value="1"/> -->
<param name="resource-location" value="media"/>
<resourcemap>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resourcemap>
</agent>
</signaling>
<!-- MRCPv2 connection agents -->
<connection>
<agent name="MRCPv2-Agent-1">
<param name="max-connection-count" value="100"/>
<!-- <param name="offer-new-connection" value="1"/> -->
</agent>
</connection>
<!-- Media engines -->
<media>
<engine name="Media-Engine-1" realtime-rate="1"/>
<rtp name="RTP-Factory-1">
<param name="rtp-ip" value="auto"/>
<!-- <param name="rtp-ext-ip" value="auto"/> -->
<param name="rtp-port-min" value="4000"/>
<param name="rtp-port-max" value="5000"/>
<!-- <param name="playout-delay" value="50"/> -->
<!-- <param name="max-playout-delay" value="200"/> -->
<!-- <param name="ptime" value="20"/> -->
<param name="codecs" value="PCMU PCMA L16/96/8000 PCMU/97/16000 telephone-event/101/8000"/>
<!-- <param name="codecs" value="PCMU PCMA L16/96/8000 PCMU/97/16000 PCMA/98/16000 L16/99/16000"/> -->
<!-- enable/disable rtcp support -->
<param name="rtcp" value="0"/>
<!-- rtcp bye policies (rtcp must be enabled first)
0 - disable rtcp bye
1 - send rtcp bye at the end of session
2 - send rtcp bye also at the end of each talkspurt (input)
<!-- common (default) RTP/RTCP settings -->
<rtp-settings id="RTP-Settings-1">
<jitter-buffer>
<playout-delay>50</playout-delay>
<max-playout-delay>200</max-playout-delay>
</jitter-buffer>
<ptime>20</ptime>
<codecs>PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs>
<!-- <codecs>PCMU PCMA L16/96/8000 PCMU/97/16000 PCMA/98/16000 L16/99/16000</codecs> -->
<!-- enable/disable RTCP support -->
<rtcp enable="false">
<!-- RTCP BYE policies (RTCP must be enabled first)
0 - disable RTCP BYE
1 - send RTCP BYE at the end of session
2 - send RTCP BYE also at the end of each talkspurt (input)
-->
<param name="rtcp-bye" value="1"/>
<rtcp-bye>1</rtcp-bye>
<!-- rtcp transmission interval in msec (set 0 to disable) -->
<param name="rtcp-tx-interval" value="5000"/>
<tx-interval>5000</tx-interval>
<!-- period (timeout) to check for new rtcp messages in msec (set 0 to disable) -->
<param name="rtcp-rx-resolution" value="1000"/>
</rtp>
</media>
</settings>
<!-- Client profiles -->
<profiles>
<!-- MRCPv2 default profile -->
<profile name="MRCPv2-Default">
<param name="signaling-agent" value="SIP-Agent-1"/>
<param name="connection-agent" value="MRCPv2-Agent-1"/>
<param name="media-engine" value="Media-Engine-1"/>
<param name="rtp-factory" value="RTP-Factory-1"/>
</profile>
<!-- MRCPv1 default profile -->
<profile name="MRCPv1-Default">
<param name="signaling-agent" value="RTSP-Agent-1"/>
<param name="media-engine" value="Media-Engine-1"/>
<param name="rtp-factory" value="RTP-Factory-1"/>
</profile>
<!-- more profiles might be added here -->
</profiles>
<rx-resolution>1000</rx-resolution>
</rtcp>
</rtp-settings>
</settings>
</unimrcpclient>

View File

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="unimrcpclient">
<xsd:annotation>
<xsd:documentation>UniMRCP client document</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="properties" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Generic properties</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ip" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="type" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="ext-ip" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="type" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="server-ip" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="type" type="xsd:string" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="components" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Common components</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="resource-factory" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Factory of MRCP resources</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="resource">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sip-uac" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>SIP signaling agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sip-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="sip-ext-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="sip-port" type="xsd:short" />
<xsd:element name="sip-transport" type="xsd:string" />
<xsd:element name="ua-name" type="xsd:string" minOccurs="0" />
<xsd:element name="sdp-origin" type="xsd:string" minOccurs="0" />
<xsd:element name="sip-t1" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t2" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t4" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t1x64" type="xsd:long" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="type" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="rtsp-uac" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>RTSP signaling agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="max-connection-count" type="xsd:short" minOccurs="0" />
<xsd:element name="request-timeout" type="xsd:long" minOccurs="0" />
<xsd:element name="sdp-origin" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="type" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="mrcpv2-uac" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv2 connection agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="max-connection-count" type="xsd:short" minOccurs="0" />
<xsd:element name="offer-new-connection" type="xsd:boolean" minOccurs="0" />
<xsd:element name="rx-buffer-size" type="xsd:long" minOccurs="0" />
<xsd:element name="tx-buffer-size" type="xsd:long" minOccurs="0" />
<xsd:element name="request-timeout" type="xsd:long" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="media-engine" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Media processing engine</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="realtime-rate" type="xsd:short" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="rtp-factory" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Factory of RTP terminations</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtp-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="rtp-ext-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="rtp-port-min" type="xsd:short" />
<xsd:element name="rtp-port-max" type="xsd:short" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="settings" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sip-settings" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>SIP settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="server-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="server-port" type="xsd:short" />
<xsd:element name="force-destination" type="xsd:boolean" default="false" minOccurs="0" />
<xsd:element name="feature-tags" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="rtsp-settings" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>RTSP settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="server-ip" type="xsd:string" minOccurs="0" />
<xsd:element name="server-port" type="xsd:short" />
<xsd:element name="force-destination" type="xsd:boolean" default="false" minOccurs="0" />
<xsd:element name="resource-location" type="xsd:string" />
<xsd:element name="resource-map">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="param" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="value" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="rtp-settings" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>RTP settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="jitter-buffer" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="playout-delay" type="xsd:long" />
<xsd:element name="max-playout-delay" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ptime" type="xsd:long" minOccurs="0" />
<xsd:element name="codecs" type="xsd:string" />
<xsd:element name="rtcp" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtcp-bye" type="xsd:int" />
<xsd:element name="tx-interval" type="xsd:long" />
<xsd:element name="rx-resolution" type="xsd:long" />
</xsd:sequence>
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="profiles" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Profiles</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="mrcpv2-profile" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv2 profile</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sip-uac" type="xsd:string" />
<xsd:element name="mrcpv2-uac" type="xsd:string" />
<xsd:element name="media-engine" type="xsd:string" />
<xsd:element name="rtp-factory" type="xsd:string" />
<xsd:element name="sip-settings" type="xsd:string" />
<xsd:element name="rtp-settings" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="mrcpv1-profile" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv1 profile</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtsp-uac" type="xsd:string" />
<xsd:element name="media-engine" type="xsd:string" />
<xsd:element name="rtp-factory" type="xsd:string" />
<xsd:element name="rtsp-settings" type="xsd:string" />
<xsd:element name="rtp-settings" type="xsd:string" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required" />
<xsd:attribute name="enable" type="xsd:boolean" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required" />
<xsd:attribute name="subfolder" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
</xsd:schema>

View File

@ -1,103 +1,157 @@
<!-- unimrcpserver document -->
<unimrcpserver>
<!-- MRCP resources -->
<resources>
<resource class="speechsynth" enable="1"/>
<resource class="speechrecog" enable="1"/>
<resource class="recorder" enable="1"/>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP server document -->
<unimrcpserver xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="unimrcpserver.xsd" version="1.0">
<properties>
<!-- By default, network interface (IP address) to bind to will be implicitly identified.
Alternatively, it can be explicitly set.
-->
<ip type="auto"/>
<!-- <ip>10.10.0.1</ip> -->
<!-- <ext-ip>a.b.c.d</ext-ip> -->
</properties>
<components>
<!-- Factory of MRCP resources -->
<resource-factory>
<resource id="speechsynth" enable="true"/>
<resource id="speechrecog" enable="true"/>
<resource id="recorder" enable="true"/>
<resource id="speakverify" enable="true"/>
</resource-factory>
<!-- SofiaSIP MRCPv2 signaling agent -->
<sip-uas id="SIP-Agent-1" type="SofiaSIP">
<!-- By default, "ip" and "ext-ip" addresses set in the properties will be used.
They still can be explicitly specified (overriden) here.
-->
<!-- <sip-ip>10.10.0.1</sip-ip> -->
<!-- <sip-ext-ip>a.b.c.d</sip-ext-ip> -->
<sip-port>8060</sip-port>
<sip-transport>udp,tcp</sip-transport>
<!-- <force-destination>true</force-destination> -->
<ua-name>UniMRCP SofiaSIP</ua-name>
<sdp-origin>UniMRCPServer</sdp-origin>
<!-- <sip-t1>500</sip-t1> -->
<!-- <sip-t2>4000</sip-t2> -->
<!-- <sip-t4>4000</sip-t4> -->
<!-- <sip-t1x64>32000</sip-t1x64> -->
</sip-uas>
<!-- UniRTSP MRCPv1 signaling agent -->
<rtsp-uas id="RTSP-Agent-1" type="UniRTSP">
<!-- By default, "ip" and "ext-ip" addresses set in the properties will be used.
They still can be explicitly specified (overriden) here.
-->
<!-- <rtsp-ip>10.10.0.1</rtsp-ip> -->
<!-- <rtsp-ext-ip>a.b.c.d</rtsp-ext-ip> -->
<rtsp-port>1554</rtsp-port>
<!-- <force-destination>true</force-destination> -->
<resource-map>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resource-map>
<max-connection-count>100</max-connection-count>
<sdp-origin>UniMRCPServer</sdp-origin>
</rtsp-uas>
<!-- MRCPv2 connection agent -->
<mrcpv2-uas id="MRCPv2-Agent-1">
<!-- By default, "ip" set in the properties will be used.
It still can be explicitly specified (overriden) here.
-->
<!-- <mrcp-ip>10.10.0.1</mrcp-ip> -->
<mrcp-port>1544</mrcp-port>
<max-connection-count>100</max-connection-count>
<force-new-connection>false</force-new-connection>
<rx-buffer-size>1024</rx-buffer-size>
<tx-buffer-size>1024</tx-buffer-size>
</mrcpv2-uas>
<!-- Media processing engine -->
<media-engine id="Media-Engine-1">
<realtime-rate>1</realtime-rate>
</media-engine>
<!-- Factory of RTP terminations -->
<rtp-factory id="RTP-Factory-1">
<!-- By default, "ip" and "ext-ip" addresses set in the properties will be used.
They still can be explicitly specified (overriden) here.
-->
<!-- <rtp-ip>10.10.0.1</rtp-ip> -->
<!-- <rtp-ext-ip>a.b.c.d</rtp-ext-ip> -->
<rtp-port-min>5000</rtp-port-min>
<rtp-port-max>6000</rtp-port-max>
</rtp-factory>
<!-- Factory of plugins (MRCP engines) -->
<plugin-factory>
<engine id="PocketSphinx-1" name="mrcppocketsphinx" enable="false"/>
<engine id="Flite-1" name="mrcpflite" enable="false"/>
<engine id="Demo-Synth-1" name="demosynth" enable="true"/>
<engine id="Demo-Recog-1" name="demorecog" enable="true"/>
<engine id="Demo-Verifier-1" name="demoverifier" enable="true"/>
<engine id="Recorder-1" name="mrcprecorder" enable="true"/>
<!-- Engines may have additional named and generic params
<engine id="Your-Engine-1" name="yourengine" enable="false">
<max-channel-count>100</max-channel-count>
<param name="..." value="..."/>
</engine>
-->
</plugin-factory>
</components>
<!-- Server settings (signaling, media, ...) -->
<settings>
<!-- SIP, RTSP signaling agents -->
<signaling>
<agent name="SIP-Agent-1" class="SofiaSIP">
<param name="sip-ip" value="auto"/>
<!-- <param name="sip-ext-ip" value="auto"/> -->
<param name="sip-port" value="8060"/>
<param name="sip-transport" value="udp,tcp"/>
<!-- <param name="force-destination" value="1"/> -->
<param name="ua-name" value="UniMRCP SofiaSIP"/>
<param name="sdp-origin" value="UniMRCPServer"/>
</agent>
<agent name="RTSP-Agent-1" class="UniRTSP">
<param name="rtsp-ip" value="auto"/>
<param name="rtsp-port" value="1554"/>
<!-- <param name="force-destination" value="1"/> -->
<resourcemap>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resourcemap>
</agent>
</signaling>
<!-- MRCPv2 connection agents -->
<connection>
<agent name="MRCPv2-Agent-1">
<param name="mrcp-ip" value="auto"/>
<param name="mrcp-port" value="1544"/>
<param name="max-connection-count" value="100"/>
<!-- <param name="force-new-connection" value="1"/> -->
</agent>
</connection>
<!-- Media engines -->
<media>
<engine name="Media-Engine-1" realtime-rate="1"/>
<rtp name="RTP-Factory-1">
<param name="rtp-ip" value="auto"/>
<!-- <param name="rtp-ext-ip" value="auto"/> -->
<param name="rtp-port-min" value="5000"/>
<param name="rtp-port-max" value="6000"/>
<!-- <param name="playout-delay" value="50"/> -->
<!-- <param name="max-playout-delay" value="200"/> -->
<!-- <param name="ptime" value="20"/> -->
<param name="codecs" value="PCMU PCMA L16/96/8000 telephone-event/101/8000"/>
<!-- <param name="codecs" value="PCMU PCMA L16/96/8000 PCMU/97/16000 PCMA/98/16000 L16/99/16000"/> -->
<!-- <param name="own-preference" value="1"/> -->
<!-- enable/disable rtcp support -->
<param name="rtcp" value="0"/>
<!-- rtcp bye policies (rtcp must be enabled first)
0 - disable rtcp bye
1 - send rtcp bye at the end of session
2 - send rtcp bye also at the end of each talkspurt (input)
<!-- RTP/RTCP settings -->
<rtp-settings id="RTP-Settings-1">
<jitter-buffer>
<playout-delay>50</playout-delay>
<max-playout-delay>200</max-playout-delay>
</jitter-buffer>
<ptime>20</ptime>
<codecs own-preference="false">PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs>
<!-- <codecs own-preference="false">PCMU PCMA L16/96/8000 PCMU/97/16000 PCMA/98/16000 L16/99/16000</codecs> -->
<!-- enable/disable RTCP support -->
<rtcp enable="false">
<!-- RTCP BYE policies (RTCP must be enabled first)
0 - disable RTCP BYE
1 - send RTCP BYE at the end of session
2 - send RTCP BYE also at the end of each talkspurt (input)
-->
<param name="rtcp-bye" value="1"/>
<!-- rtcp transmission interval in msec -->
<param name="rtcp-tx-interval" value="5000"/>
<rtcp-bye>1</rtcp-bye>
<!-- rtcp transmission interval in msec (set 0 to disable) -->
<tx-interval>5000</tx-interval>
<!-- period (timeout) to check for new rtcp messages in msec (set 0 to disable) -->
<param name="rtcp-rx-resolution" value="1000"/>
</rtp>
</media>
<!-- Resource plugins -->
<plugin>
<engine name="Cepstral-Swift-1" class="mrcpcepstral" enable="0"/>
<engine name="PocketSphinx-1" class="mrcppocketsphinx" enable="0"/>
<engine name="Flite-1" class="mrcpflite" enable="0"/>
<engine name="Demo-Synth-1" class="demosynth" enable="1"/>
<engine name="Demo-Recog-1" class="demorecog" enable="1"/>
<engine name="Recorder-1" class="mrcprecorder" enable="1"/>
</plugin>
<rx-resolution>1000</rx-resolution>
</rtcp>
</rtp-settings>
</settings>
<!-- Server profiles -->
<profiles>
<!-- MRCPv2 default profile -->
<profile name="MRCPv2-Default">
<param name="signaling-agent" value="SIP-Agent-1"/>
<param name="connection-agent" value="MRCPv2-Agent-1"/>
<param name="media-engine" value="Media-Engine-1"/>
<param name="rtp-factory" value="RTP-Factory-1"/>
</profile>
<mrcpv2-profile id="uni2">
<sip-uas>SIP-Agent-1</sip-uas>
<mrcpv2-uas>MRCPv2-Agent-1</mrcpv2-uas>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtp-settings>RTP-Settings-1</rtp-settings>
<!-- It's possible to define profile based map of resources and engines.
<resource-engine-map>
<param name="speechsynth" value="Flite-1"/>
<param name="speechrecog" value="PocketSphinx-1"/>
</resource-engine-map>
-->
</mrcpv2-profile>
<!-- MRCPv1 default profile -->
<profile name="MRCPv1-Default">
<param name="signaling-agent" value="RTSP-Agent-1"/>
<param name="media-engine" value="Media-Engine-1"/>
<param name="rtp-factory" value="RTP-Factory-1"/>
</profile>
<mrcpv1-profile id="uni1">
<rtsp-uas>RTSP-Agent-1</rtsp-uas>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv1-profile>
<!-- more profiles might be added here -->
</profiles>

View File

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:element name="unimrcpserver">
<xsd:annotation>
<xsd:documentation>UniMRCP server document</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="properties" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Generic properties</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ip" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="type" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="ext-ip" minOccurs="0">
<xsd:complexType>
<xsd:attribute name="type" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="components" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Common components</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="resource-factory" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Factory of MRCP resources</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="resource">
<xsd:complexType>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="sip-uas" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>SIP signaling agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sip-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="sip-ext-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="sip-port" type="xsd:short"/>
<xsd:element name="sip-transport" type="xsd:string"/>
<xsd:element name="force-destination" type="xsd:boolean" default="false" minOccurs="0"/>
<xsd:element name="ua-name" type="xsd:string" minOccurs="0"/>
<xsd:element name="sdp-origin" type="xsd:string" minOccurs="0"/>
<xsd:element name="sip-t1" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t2" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t4" type="xsd:long" minOccurs="0" />
<xsd:element name="sip-t1x64" type="xsd:long" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="type" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="rtsp-uas" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>RTSP signaling agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtsp-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="rtsp-ext-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="rtsp-port" type="xsd:string"/>
<xsd:element name="resource-map">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="param" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="max-connection-count" type="xsd:short" minOccurs="0"/>
<xsd:element name="sdp-origin" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="type" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="mrcpv2-uas" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv2 connection agent</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="mrcp-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="mrcp-port" type="xsd:string"/>
<xsd:element name="max-connection-count" type="xsd:short" minOccurs="0"/>
<xsd:element name="force-new-connection" type="xsd:boolean" minOccurs="0"/>
<xsd:element name="rx-buffer-size" type="xsd:long" minOccurs="0"/>
<xsd:element name="tx-buffer-size" type="xsd:long" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="media-engine" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Media processing engine</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="realtime-rate" type="xsd:short" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="rtp-factory" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Factory of RTP terminations</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtp-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="rtp-ext-ip" type="xsd:string" minOccurs="0"/>
<xsd:element name="rtp-port-min" type="xsd:short"/>
<xsd:element name="rtp-port-max" type="xsd:short"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="plugin-factory" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Factory of plugins (MRCP engines)</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="engine">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="max-channel-count" minOccurs="0"/>
<xsd:element name="param" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="value" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="settings" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtp-settings" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>RTP settings</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="jitter-buffer" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="playout-delay" type="xsd:long"/>
<xsd:element name="max-playout-delay" type="xsd:long"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="ptime" type="xsd:long" minOccurs="0"/>
<xsd:element name="codecs">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="own-preference" type="xsd:boolean" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="rtcp" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtcp-bye" type="xsd:int"/>
<xsd:element name="tx-interval" type="xsd:long"/>
<xsd:element name="rx-resolution" type="xsd:long"/>
</xsd:sequence>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="profiles" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Profiles</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="mrcpv2-profile" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv2 profile</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="sip-uas" type="xsd:string"/>
<xsd:element name="mrcpv2-uas" type="xsd:string"/>
<xsd:element name="media-engine" type="xsd:string"/>
<xsd:element name="rtp-factory" type="xsd:string"/>
<xsd:element name="rtp-settings" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="mrcpv1-profile" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>MRCPv1 profile</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rtsp-uas" type="xsd:string"/>
<xsd:element name="media-engine" type="xsd:string"/>
<xsd:element name="rtp-factory" type="xsd:string"/>
<xsd:element name="rtp-settings" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string" use="required"/>
<xsd:attribute name="enable" type="xsd:boolean" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="version" type="xsd:string" use="required"/>
<xsd:attribute name="subfolder" type="xsd:string" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>

View File

@ -3,14 +3,11 @@
AC_PREREQ(2.57)
AC_INIT([unimrcp],[0.9.0])
AC_INIT([unimrcp],[1.0.0])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build/acmacros])
AC_PREFIX_DEFAULT(/usr/local/unimrcp)
CFLAGS="$CFLAGS $CONFIGURE_CFLAGS"
CXXFLAGS="$CXXFLAGS $CONFIGURE_CXXFLAGS"
LDFLAGS="$LDFLAGS $CONFIGURE_LDFLAGS"
plugindir='${prefix}/plugin'
confdir='${prefix}/conf'
@ -120,6 +117,15 @@ AC_ARG_ENABLE(demorecog-plugin,
AM_CONDITIONAL([DEMORECOG_PLUGIN],[test "${enable_demorecog_plugin}" = "yes"])
#Enable demo verifier plugin
AC_ARG_ENABLE(demoverifier-plugin,
[AC_HELP_STRING([--disable-demoverifier-plugin ],[exclude demo verifier plugin from build])],
[enable_demoverifier_plugin="$enableval"],
[enable_demoverifier_plugin="yes"])
AM_CONDITIONAL([DEMOVERIFIER_PLUGIN],[test "${enable_demoverifier_plugin}" = "yes"])
#Enable recorder plugin
AC_ARG_ENABLE(recorder-plugin,
[AC_HELP_STRING([--disable-recorder-plugin ],[exclude recorder plugin from build])],
@ -129,20 +135,6 @@ AC_ARG_ENABLE(recorder-plugin,
AM_CONDITIONAL([RECORDER_PLUGIN],[test "${enable_recorder_plugin}" = "yes"])
#Enable Cepstral Swift plugin
AC_ARG_ENABLE(cepstral-plugin,
[AC_HELP_STRING([--disable-cepstral-plugin ],[exclude cepstral plugin from build])],
[enable_cepstral_plugin="$enableval"],
[enable_cepstral_plugin="yes"])
if test "${enable_cepstral_plugin}" != "no"; then
UNIMRCP_CHECK_SWIFT
fi
AM_CONDITIONAL([CEPSTRAL_PLUGIN],[test "${enable_cepstral_plugin}" = "yes" &&\
test "${found_swift}" = "yes"])
#Enable PocketSphinx plugin
AC_ARG_ENABLE(pocketsphinx-plugin,
[AC_HELP_STRING([--enable-pocketsphinx-plugin ],[enable pocketsphinx plugin])],
@ -191,12 +183,12 @@ AC_CONFIG_FILES([
modules/mrcp-sofiasip/Makefile
modules/mrcp-unirtsp/Makefile
plugins/Makefile
plugins/mrcp-cepstral/Makefile
plugins/mrcp-pocketsphinx/Makefile
plugins/mrcp-flite/Makefile
plugins/mrcp-recorder/Makefile
plugins/demo-synth/Makefile
plugins/demo-recog/Makefile
plugins/demo-verifier/Makefile
platforms/Makefile
platforms/libunimrcp-server/Makefile
platforms/libunimrcp-client/Makefile
@ -216,8 +208,10 @@ AC_CONFIG_FILES([
build/pkgconfig/unimrcpclient.pc
build/pkgconfig/unimrcpserver.pc
build/pkgconfig/unimrcpplugin.pc
build/svnrev/Makefile
conf/Makefile
data/Makefile
docs/doxygen.conf
])
AC_OUTPUT
@ -231,6 +225,7 @@ AC_MSG_NOTICE([ Sofia-SIP: $sofia_version])
AC_MSG_NOTICE([Plugins:])
AC_MSG_NOTICE([ Demo Synthesizer: $enable_demosynth_plugin])
AC_MSG_NOTICE([ Demo Recognizer: $enable_demorecog_plugin])
AC_MSG_NOTICE([ Cepstral: $enable_cepstral_plugin])
AC_MSG_NOTICE([ Demo Verifier: $enable_demoverifier_plugin])
AC_MSG_NOTICE([ Recorder: $enable_recorder_plugin])
AC_MSG_NOTICE([ PocketSphinx: $enable_pocketsphinx_plugin])
AC_MSG_NOTICE([ Flite: $enable_flite_plugin])

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,19 @@
--break
Content-Type:text/uri-list
Content-Length: 22
builtin:grammar/digits
--break
Content-Type:application/srgs+xml
Content-Length: 230
<?xml version="1.0"?>
<grammar root="digit" version="1.0" xml:lang="en-US"
xmlns="http://www.w3.org/2001/06/grammar">
<rule id="digit" scope="public">
<item>one two three four five</item>
</rule>
</grammar>
--break--

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,21 @@
<?xml version="1.0"?>
<result>
<verification-result>
<voiceprint id="johnsmith">
<incremental>
<utterance-length> 500 </utterance-length>
<device> cellular-phone </device>
<gender> male </gender>
<decision> accepted </decision>
<verification-score> 0.85 </verification-score>
</incremental>
<cumulative>
<utterance-length> 1500 </utterance-length>
<device> cellular-phone </device>
<gender> male </gender>
<decision> accepted </decision>
<verification-score> 0.75 </verification-score>
</cumulative>
</voiceprint>
</verification-result>
</result>

View File

@ -1 +1 @@
Hello World.
Welcome to Uni MRCP.

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<speak>
<paragraph>
<sentence>Hello World.</sentence>
</paragraph>
<speak version="1.0" xml:lang="en-US" xmlns="http://www.w3.org/2001/10/synthesis">
<p>
<s>Welcome to Uni MRCP.</s>
</p>
</speak>

View File

@ -1,6 +1,7 @@
PROJECT_NAME="UniMRCP"
PROJECT_NUMBER = @VERSION@
INPUT=.
INPUT=. docs/mainpage.docs
QUIET=YES
RECURSIVE=YES
FILE_PATTERNS=*.h

View File

@ -0,0 +1,92 @@
/**
@mainpage UniMRCP
<br>
@section Introduction
UniMRCP is an open source cross-platform MRCP project, which provides everything required for MRCP client and server side deployment.
<br>
UniMRCP encapsulates SIP/MRCPv2, RTSP, SDP and RTP/RTCP stacks inside and provides MRCP version independent user level interface for the integration.
<br>
<br>
@section Source Tree Structure
<br>
Libraries
* apr-toolkit - set of utilities built on top of APR and APR-Util libraries (task abstraction, logging, etc)
<br>
* mpf - media processing framework
<br>
* mrcp - implementation of MRCP basics (message, parser, resources)
<br>
* mrcpv2-transport - implementation of MRCPv2 transport layer
<br>
* mrcp-signaling - abstract MRCP signaling (session management) interface
<br>
* mrcp-engine - abstract resource engine interface
<br>
* mrcp-client - implementation of MRCP client stack based on abstract signaling interface
<br>
* mrcp-server - implementation of MRCP server stack based on abstract signaling and engine interfaces
<br>
* uni-rtsp - implementation of minimal RTSP stack required for MRCPv1
<br>
Modules
* mrcp-sofiasip - implementation of abstract signaling interface using SofiaSIP library
<br>
* mrcp-unirtsp - implementation of abstract signaling interface using UniRTSP library
<br>
<br>
Plugins
* demo-synth - simulation of actual synthesizer engine
<br>
* demo-recog - simulation of actual recognizer engine
<br>
* mrcp-recorder - implementation of recorder resource
<br>
* mrcp-flite - implementation of synthesizer resource using open source Flite engine
<br>
* mrcp-pocketsphinx - implementation of recognizer resource using open source PocketSphinx engine
<br>
Platforms
* libunimrcpclient - unimrcp client stack based on libraries and modules above
<br>
* libunimrcpserver - unimrcp server stack based on libraries, modules and plugins above
<br>
* unimrcpclient - sample C application based on unimrcp client stack
<br>
* umc - sample C++ application based on unimrcp client stack
<br>
* unimrcpserver - final unimrcp server application
<br>
@section Dependencies
<a href="http://apr.apache.org"> APR - Apache Portable Runtime </a>
<br>
<a href="http://sofia-sip.sourceforge.net"> Sofia-SIP - SIP User Agent Library </a>
<br>
@section Project Links
<a href="http://www.unimrcp.org"> Website </a>
<br>
<a href="http://code.google.com/p/unimrcp/downloads/list"> Downloads </a>
<br>
<a href="http://code.google.com/p/unimrcp/w/list"> Wiki </a>
<br>
<a href="http://code.google.com/p/unimrcp/issues/list"> Issue Tracker </a>
<br>
<a href="http://groups.google.com/group/unimrcp"> Discussion Group </a>
<br>
*/

View File

@ -8,38 +8,43 @@ noinst_LTLIBRARIES = libaprtoolkit.la
include_HEADERS = include/apt.h \
include/apt_obj_list.h \
include/apt_cyclic_queue.h \
include/apt_dir_layout.h \
include/apt_task.h \
include/apt_task_msg.h \
include/apt_consumer_task.h \
include/apt_net_server_task.h \
include/apt_net_client_task.h \
include/apt_pollset.h \
include/apt_poller_task.h \
include/apt_pool.h \
include/apt_log.h \
include/apt_pair.h \
include/apt_string.h \
include/apt_string_table.h \
include/apt_header_field.h \
include/apt_text_stream.h \
include/apt_text_message.h \
include/apt_net.h \
include/apt_nlsml_doc.h \
include/apt_dir_layout.h \
include/apt_multipart_content.h \
include/apt_timer_queue.h \
include/apt_test_suite.h
libaprtoolkit_la_SOURCES = src/apt_obj_list.c \
src/apt_cyclic_queue.c \
src/apt_dir_layout.c \
src/apt_task.c \
src/apt_task_msg.c \
src/apt_consumer_task.c \
src/apt_net_server_task.c \
src/apt_net_client_task.c \
src/apt_pollset.c \
src/apt_poller_task.c \
src/apt_pool.c \
src/apt_log.c \
src/apt_pair.c \
src/apt_string_table.c \
src/apt_header_field.c \
src/apt_text_stream.c \
src/apt_text_message.c \
src/apt_net.c \
src/apt_nlsml_doc.c \
src/apt_dir_layout.c \
src/apt_multipart_content.c \
src/apt_timer_queue.c \
src/apt_test_suite.c

View File

@ -1,409 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="aprtoolkit"
ProjectGUID="{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}"
RootNamespace="aprtoolkit"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
<Platform
Name="x64"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="APT_STATIC_LIB"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unidebug.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="APT_STATIC_LIB"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="APT_STATIC_LIB"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
InheritedPropertySheets="$(ProjectDir)..\..\build\vsprops\unirelease.vsprops;$(ProjectDir)..\..\build\vsprops\apt.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
PreprocessorDefinitions="APT_STATIC_LIB"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="include"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\include\apt.h"
>
</File>
<File
RelativePath=".\include\apt_consumer_task.h"
>
</File>
<File
RelativePath=".\include\apt_cyclic_queue.h"
>
</File>
<File
RelativePath=".\include\apt_dir_layout.h"
>
</File>
<File
RelativePath=".\include\apt_log.h"
>
</File>
<File
RelativePath=".\include\apt_net.h"
>
</File>
<File
RelativePath=".\include\apt_net_client_task.h"
>
</File>
<File
RelativePath=".\include\apt_net_server_task.h"
>
</File>
<File
RelativePath=".\include\apt_nlsml_doc.h"
>
</File>
<File
RelativePath=".\include\apt_obj_list.h"
>
</File>
<File
RelativePath=".\include\apt_pair.h"
>
</File>
<File
RelativePath=".\include\apt_pollset.h"
>
</File>
<File
RelativePath=".\include\apt_pool.h"
>
</File>
<File
RelativePath=".\include\apt_string.h"
>
</File>
<File
RelativePath=".\include\apt_string_table.h"
>
</File>
<File
RelativePath=".\include\apt_task.h"
>
</File>
<File
RelativePath=".\include\apt_task_msg.h"
>
</File>
<File
RelativePath=".\include\apt_test_suite.h"
>
</File>
<File
RelativePath=".\include\apt_text_stream.h"
>
</File>
</Filter>
<Filter
Name="src"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath=".\src\apt_consumer_task.c"
>
</File>
<File
RelativePath=".\src\apt_cyclic_queue.c"
>
</File>
<File
RelativePath=".\src\apt_dir_layout.c"
>
</File>
<File
RelativePath=".\src\apt_log.c"
>
</File>
<File
RelativePath=".\src\apt_net.c"
>
</File>
<File
RelativePath=".\src\apt_net_client_task.c"
>
</File>
<File
RelativePath=".\src\apt_net_server_task.c"
>
</File>
<File
RelativePath=".\src\apt_nlsml_doc.c"
>
</File>
<File
RelativePath=".\src\apt_obj_list.c"
>
</File>
<File
RelativePath=".\src\apt_pair.c"
>
</File>
<File
RelativePath=".\src\apt_pollset.c"
>
</File>
<File
RelativePath=".\src\apt_pool.c"
>
</File>
<File
RelativePath=".\src\apt_string_table.c"
>
</File>
<File
RelativePath=".\src\apt_task.c"
>
</File>
<File
RelativePath=".\src\apt_task_msg.c"
>
</File>
<File
RelativePath=".\src\apt_test_suite.c"
>
</File>
<File
RelativePath=".\src\apt_text_stream.c"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -1,157 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>aprtoolkit</ProjectName>
<ProjectGuid>{13DEECA0-BDD4-4744-A1A2-8EB0A44DF3D2}</ProjectGuid>
<RootNamespace>aprtoolkit</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(ProjectDir)..\..\build\vsprops\unirelease.props" />
<Import Project="$(ProjectDir)..\..\build\vsprops\apt.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(ProjectDir)..\..\build\vsprops\unidebug.props" />
<Import Project="$(ProjectDir)..\..\build\vsprops\apt.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(ProjectDir)..\..\build\vsprops\unirelease.props" />
<Import Project="$(ProjectDir)..\..\build\vsprops\apt.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(ProjectDir)..\..\build\vsprops\unidebug.props" />
<Import Project="$(ProjectDir)..\..\build\vsprops\apt.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)\$(Configuration)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PreprocessorDefinitions>APT_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>APT_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PreprocessorDefinitions>APT_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<PreprocessorDefinitions>APT_STATIC_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="include\apt.h" />
<ClInclude Include="include\apt_consumer_task.h" />
<ClInclude Include="include\apt_cyclic_queue.h" />
<ClInclude Include="include\apt_dir_layout.h" />
<ClInclude Include="include\apt_log.h" />
<ClInclude Include="include\apt_net.h" />
<ClInclude Include="include\apt_net_client_task.h" />
<ClInclude Include="include\apt_net_server_task.h" />
<ClInclude Include="include\apt_nlsml_doc.h" />
<ClInclude Include="include\apt_obj_list.h" />
<ClInclude Include="include\apt_pair.h" />
<ClInclude Include="include\apt_pollset.h" />
<ClInclude Include="include\apt_pool.h" />
<ClInclude Include="include\apt_string.h" />
<ClInclude Include="include\apt_string_table.h" />
<ClInclude Include="include\apt_task.h" />
<ClInclude Include="include\apt_task_msg.h" />
<ClInclude Include="include\apt_test_suite.h" />
<ClInclude Include="include\apt_text_stream.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\apt_consumer_task.c" />
<ClCompile Include="src\apt_cyclic_queue.c" />
<ClCompile Include="src\apt_dir_layout.c" />
<ClCompile Include="src\apt_log.c" />
<ClCompile Include="src\apt_net.c" />
<ClCompile Include="src\apt_net_client_task.c" />
<ClCompile Include="src\apt_net_server_task.c" />
<ClCompile Include="src\apt_nlsml_doc.c" />
<ClCompile Include="src\apt_obj_list.c" />
<ClCompile Include="src\apt_pair.c" />
<ClCompile Include="src\apt_pollset.c" />
<ClCompile Include="src\apt_pool.c" />
<ClCompile Include="src\apt_string_table.c" />
<ClCompile Include="src\apt_task.c" />
<ClCompile Include="src\apt_task_msg.c" />
<ClCompile Include="src\apt_test_suite.c" />
<ClCompile Include="src\apt_text_stream.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\win32\apr-util\libaprutil.2010.vcxproj">
<Project>{f057da7f-79e5-4b00-845c-ef446ef055e3}</Project>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,125 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="include">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="src">
<UniqueIdentifier>{4c2fadb2-8996-43e3-9db1-e3fc3eccee30}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\apt.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_consumer_task.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_cyclic_queue.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_dir_layout.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_log.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_net.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_net_client_task.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_net_server_task.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_nlsml_doc.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_obj_list.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_pair.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_pollset.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_pool.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_string.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_string_table.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_task.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_task_msg.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_test_suite.h">
<Filter>include</Filter>
</ClInclude>
<ClInclude Include="include\apt_text_stream.h">
<Filter>include</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\apt_consumer_task.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_cyclic_queue.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_dir_layout.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_log.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_net.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_net_client_task.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_net_server_task.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_nlsml_doc.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_obj_list.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_pair.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_pollset.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_pool.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_string_table.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_task.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_task_msg.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_test_suite.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\apt_text_stream.c">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -253,22 +253,22 @@
RelativePath=".\include\apt_dir_layout.h"
>
</File>
<File
RelativePath=".\include\apt_header_field.h"
>
</File>
<File
RelativePath=".\include\apt_log.h"
>
</File>
<File
RelativePath=".\include\apt_multipart_content.h"
>
</File>
<File
RelativePath=".\include\apt_net.h"
>
</File>
<File
RelativePath=".\include\apt_net_client_task.h"
>
</File>
<File
RelativePath=".\include\apt_net_server_task.h"
>
</File>
<File
RelativePath=".\include\apt_nlsml_doc.h"
>
@ -281,6 +281,10 @@
RelativePath=".\include\apt_pair.h"
>
</File>
<File
RelativePath=".\include\apt_poller_task.h"
>
</File>
<File
RelativePath=".\include\apt_pollset.h"
>
@ -309,10 +313,18 @@
RelativePath=".\include\apt_test_suite.h"
>
</File>
<File
RelativePath=".\include\apt_text_message.h"
>
</File>
<File
RelativePath=".\include\apt_text_stream.h"
>
</File>
<File
RelativePath=".\include\apt_timer_queue.h"
>
</File>
</Filter>
<Filter
Name="src"
@ -330,22 +342,22 @@
RelativePath=".\src\apt_dir_layout.c"
>
</File>
<File
RelativePath=".\src\apt_header_field.c"
>
</File>
<File
RelativePath=".\src\apt_log.c"
>
</File>
<File
RelativePath=".\src\apt_multipart_content.c"
>
</File>
<File
RelativePath=".\src\apt_net.c"
>
</File>
<File
RelativePath=".\src\apt_net_client_task.c"
>
</File>
<File
RelativePath=".\src\apt_net_server_task.c"
>
</File>
<File
RelativePath=".\src\apt_nlsml_doc.c"
>
@ -358,6 +370,10 @@
RelativePath=".\src\apt_pair.c"
>
</File>
<File
RelativePath=".\src\apt_poller_task.c"
>
</File>
<File
RelativePath=".\src\apt_pollset.c"
>
@ -382,10 +398,18 @@
RelativePath=".\src\apt_test_suite.c"
>
</File>
<File
RelativePath=".\src\apt_text_message.c"
>
</File>
<File
RelativePath=".\src\apt_text_stream.c"
>
</File>
<File
RelativePath=".\src\apt_timer_queue.c"
>
</File>
</Filter>
</Files>
<Globals>

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_H__
#define __APT_H__
#ifndef APT_H
#define APT_H
/**
* @file apt.h
@ -56,4 +58,4 @@
/** Boolean value */
typedef int apt_bool_t;
#endif /*__APT_H__*/
#endif /* APT_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_consumer_task.h 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifndef __APT_CONSUMER_TASK_H__
#define __APT_CONSUMER_TASK_H__
#ifndef APT_CONSUMER_TASK_H
#define APT_CONSUMER_TASK_H
/**
* @file apt_consumer_task.h
@ -44,7 +46,7 @@ APT_DECLARE(apt_consumer_task_t*) apt_consumer_task_create(
* Get task base.
* @param task the consumer task to get base for
*/
APT_DECLARE(apt_task_t*) apt_consumer_task_base_get(apt_consumer_task_t *task);
APT_DECLARE(apt_task_t*) apt_consumer_task_base_get(const apt_consumer_task_t *task);
/**
* Get task vtable.
@ -56,8 +58,8 @@ APT_DECLARE(apt_task_vtable_t*) apt_consumer_task_vtable_get(apt_consumer_task_t
* Get consumer task object.
* @param task the consumer task to get object from
*/
APT_DECLARE(void*) apt_consumer_task_object_get(apt_consumer_task_t *task);
APT_DECLARE(void*) apt_consumer_task_object_get(const apt_consumer_task_t *task);
APT_END_EXTERN_C
#endif /*__APT_CONSUMER_TASK_H__*/
#endif /* APT_CONSUMER_TASK_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_cyclic_queue.h 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifndef __APT_CYCLIC_QUEUE_H__
#define __APT_CYCLIC_QUEUE_H__
#ifndef APT_CYCLIC_QUEUE_H
#define APT_CYCLIC_QUEUE_H
/**
* @file apt_cyclic_queue.h
@ -69,9 +71,9 @@ APT_DECLARE(void) apt_cyclic_queue_clear(apt_cyclic_queue_t *queue);
* @param queue the queue to query
* @return TRUE if empty, otherwise FALSE
*/
APT_DECLARE(apt_bool_t) apt_cyclic_queue_is_empty(apt_cyclic_queue_t *queue);
APT_DECLARE(apt_bool_t) apt_cyclic_queue_is_empty(const apt_cyclic_queue_t *queue);
APT_END_EXTERN_C
#endif /*__APT_CYCLIC_QUEUE_H__*/
#endif /* APT_CYCLIC_QUEUE_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_dir_layout.h 1524 2010-02-15 20:44:16Z achaloyan $
*/
#ifndef __APT_DIR_LAYOUT_H__
#define __APT_DIR_LAYOUT_H__
#ifndef APT_DIR_LAYOUT_H
#define APT_DIR_LAYOUT_H
/**
* @file apt_dir_layout.h
@ -56,12 +58,13 @@ APT_DECLARE(apt_dir_layout_t*) apt_custom_dir_layout_create(
const char *data_dir_path,
apr_pool_t *pool);
/**
* Construct file path with the given file name relative to data dir.
*/
/** Construct file path relative to data dir using the file name specified. */
APT_DECLARE(char*) apt_datadir_filepath_get(const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool);
/** Construct file path relative to conf dir using the file name specified. */
APT_DECLARE(char*) apt_confdir_filepath_get(const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool);
APT_END_EXTERN_C
#endif /*__APT_DIR_LAYOUT_H__*/
#endif /* APT_DIR_LAYOUT_H */

View File

@ -0,0 +1,178 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_header_field.h 1719 2010-05-31 21:09:51Z achaloyan $
*/
#ifndef APT_HEADER_FIELD_H
#define APT_HEADER_FIELD_H
/**
* @file apt_header_field.h
* @brief Header Field Declaration (RFC5322)
*/
#ifdef WIN32
#pragma warning(disable: 4127)
#endif
#include <apr_ring.h>
#include "apt_string.h"
APT_BEGIN_EXTERN_C
/** Header field declaration */
typedef struct apt_header_field_t apt_header_field_t;
/** Header section declaration */
typedef struct apt_header_section_t apt_header_section_t;
/** Header field */
struct apt_header_field_t {
/** Ring entry */
APR_RING_ENTRY(apt_header_field_t) link;
/** Name of the header field */
apt_str_t name;
/** Value of the header field */
apt_str_t value;
/** Numeric identifier associated with name */
apr_size_t id;
};
/**
* Header section
* @remark The header section is a collection of header fields.
* The header fields are stored in both a ring and an array.
* The goal is to ensure efficient access and manipulation on the header fields.
*/
struct apt_header_section_t {
/** List of header fields (name-value pairs) */
APR_RING_HEAD(apt_head_t, apt_header_field_t) ring;
/** Array of pointers to header fields */
apt_header_field_t **arr;
/** Max number of header fields */
apr_size_t arr_size;
};
/**
* Allocate an empty header field.
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_header_field_t*) apt_header_field_alloc(apr_pool_t *pool);
/**
* Create a header field using given name and value APT strings.
* @param name the name of the header field
* @param value the value of the header field
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_header_field_t*) apt_header_field_create(const apt_str_t *name, const apt_str_t *value, apr_pool_t *pool);
/**
* Create a header field using given name and value C strings.
* @param name the name of the header field
* @param value the value of the header field
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_header_field_t*) apt_header_field_create_c(const char *name, const char *value, apr_pool_t *pool);
/**
* Create a header field from entire text line consisting of a name and value pair.
* @param line the text line, which consists of a name and value pair
* @param separator the name and value separator
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_header_field_t*) apt_header_field_create_from_line(const apt_str_t *line, char separator, apr_pool_t *pool);
/**
* Copy specified header field.
* @param src_header_field the header field to copy
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_header_field_t*) apt_header_field_copy(const apt_header_field_t *src_header_field, apr_pool_t *pool);
/**
* Initialize header section (collection of header fields).
* @param header the header section to initialize
*/
APT_DECLARE(void) apt_header_section_init(apt_header_section_t *header);
/**
* Allocate header section to set/get header fields by numeric identifiers.
* @param header the header section to allocate
* @param max_field_count the max number of header fields in the section (protocol dependent)
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_bool_t) apt_header_section_array_alloc(apt_header_section_t *header, apr_size_t max_field_count, apr_pool_t *pool);
/**
* Add (append) header field to header section.
* @param header the header section to add field to
* @param header_field the header field to add
*/
APT_DECLARE(apt_bool_t) apt_header_section_field_add(apt_header_section_t *header, apt_header_field_t *header_field);
/**
* Insert header field to header section based on numreic identifier if specified.
* @param header the header section to insert field into
* @param header_field the header field to insert
*/
APT_DECLARE(apt_bool_t) apt_header_section_field_insert(apt_header_section_t *header, apt_header_field_t *header_field);
/**
* Set header field in the array of header fields using associated numeric identifier.
* @param header the header section to set field for
* @param header_field the header field to set
* @remark Typically, the header field should be already added to the header section using apt_header_section_field_add()
*/
APT_DECLARE(apt_bool_t) apt_header_section_field_set(apt_header_section_t *header, apt_header_field_t *header_field);
/**
* Remove header field from header section.
* @param header the header section to remove field from
* @param header_field the header field to remove
*/
APT_DECLARE(apt_bool_t) apt_header_section_field_remove(apt_header_section_t *header, apt_header_field_t *header_field);
/**
* Check whether specified header field is set.
* @param header the header section to use
* @param id the identifier associated with the header_field to check
*/
static APR_INLINE apt_bool_t apt_header_section_field_check(const apt_header_section_t *header, apr_size_t id)
{
if(id < header->arr_size) {
return header->arr[id] ? TRUE : FALSE;
}
return FALSE;
}
/**
* Get header field by specified identifier.
* @param header the header section to use
* @param id the identifier associated with the header_field
*/
static APR_INLINE apt_header_field_t* apt_header_section_field_get(const apt_header_section_t *header, apr_size_t id)
{
if(id < header->arr_size) {
return header->arr[id];
}
return NULL;
}
APT_END_EXTERN_C
#endif /* APT_HEADER_FIELD_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_log.h 1792 2011-01-10 21:08:52Z achaloyan $
*/
#ifndef __APT_LOG_H__
#define __APT_LOG_H__
#ifndef APT_LOG_H
#define APT_LOG_H
/**
* @file apt_log.h
@ -44,8 +46,10 @@ APT_BEGIN_EXTERN_C
#define APT_SIDRES_FMT "<%s@%s>"
/** Format to log pointers and identifiers */
#define APT_PTRSID_FMT APT_PTR_FMT" "APT_SID_FMT
/** Format to log pointers, identifiers and resources */
#define APT_PTRSIDRES_FMT APT_PTR_FMT" "APT_SIDRES_FMT
/** Format to log pointers and identifiers */
#define APT_NAMESID_FMT "%s "APT_SID_FMT
/** Format to log names, identifiers and resources */
#define APT_NAMESIDRES_FMT "%s "APT_SIDRES_FMT
/** Priority of log messages ordered from highest priority to lowest (rfc3164) */
@ -69,22 +73,30 @@ typedef enum {
APT_LOG_HEADER_TIME = 0x02, /**< enable time output */
APT_LOG_HEADER_PRIORITY = 0x04, /**< enable priority name output */
APT_LOG_HEADER_MARK = 0x08, /**< enable file:line mark output */
APT_LOG_HEADER_THREAD = 0x10, /**< enable thread identifier output */
APT_LOG_HEADER_DEFAULT = APT_LOG_HEADER_DATE | APT_LOG_HEADER_TIME | APT_LOG_HEADER_PRIORITY
} apt_log_header_e;
/** Log output modes */
/** Mode of log output */
typedef enum {
APT_LOG_OUTPUT_NONE = 0x00, /**< disable logging */
APT_LOG_OUTPUT_CONSOLE = 0x01, /**< enable console output */
APT_LOG_OUTPUT_FILE = 0x02 /**< enable log file output */
} apt_log_output_e;
/** Masking mode of private data */
typedef enum {
APT_LOG_MASKING_NONE, /**< log everything as is */
APT_LOG_MASKING_COMPLETE, /**< mask private data completely */
APT_LOG_MASKING_ENCRYPTED /**< encrypt private data */
} apt_log_masking_e;
/** Opaque logger declaration */
typedef struct apt_logger_t apt_logger_t;
/** Prototype of extended log handler function */
typedef apt_bool_t (*apt_log_ext_handler_f)(const char *file, int line, const char *id,
typedef apt_bool_t (*apt_log_ext_handler_f)(const char *file, int line, const char *obj,
apt_log_priority_e priority, const char *format, va_list arg_ptr);
/**
@ -95,6 +107,13 @@ typedef apt_bool_t (*apt_log_ext_handler_f)(const char *file, int line, const ch
*/
APT_DECLARE(apt_bool_t) apt_log_instance_create(apt_log_output_e mode, apt_log_priority_e priority, apr_pool_t *pool);
/**
* Create and load the singleton instance of the logger.
* @param config_file the path to configuration file to load settings from
* @param pool the memory pool to use
*/
APT_DECLARE(apt_bool_t) apt_log_instance_load(const char *config_file, apr_pool_t *pool);
/**
* Destroy the singleton instance of the logger.
*/
@ -116,13 +135,15 @@ APT_DECLARE(apt_bool_t) apt_log_instance_set(apt_logger_t *logger);
* @param file_name the name of the log file
* @param max_file_size the max size of the log file
* @param max_file_count the max number of files used in log rotation
* @param append whether to append or to truncate (start over) the log file
* @param pool the memory pool to use
*/
APT_DECLARE(apt_bool_t) apt_log_file_open(
const char *dir_path,
const char *file_name,
apr_size_t max_file_size,
apr_size_t max_file_count,
const char *dir_path,
const char *file_name,
apr_size_t max_file_size,
apr_size_t max_file_count,
apt_bool_t append,
apr_pool_t *pool);
/**
@ -131,23 +152,73 @@ APT_DECLARE(apt_bool_t) apt_log_file_open(
APT_DECLARE(apt_bool_t) apt_log_file_close(void);
/**
* Set the logging output.
* Set the logging output mode.
* @param mode the mode to set
*/
APT_DECLARE(apt_bool_t) apt_log_output_mode_set(apt_log_output_e mode);
/**
* Check the logging output mode to be enabled (set) or not.
* @param mode the mode to check
*/
APT_DECLARE(apt_bool_t) apt_log_output_mode_check(apt_log_output_e mode);
/**
* Translate the output mode string to bitmask of apt_log_output_e values.
* @param str the string to translate
*/
APT_DECLARE(int) apt_log_output_mode_translate(char *str);
/**
* Set the logging priority (log level).
* @param priority the priority to set
*/
APT_DECLARE(apt_bool_t) apt_log_priority_set(apt_log_priority_e priority);
/**
* Translate the priority (log level) string to enum.
* @param str the string to translate
*/
APT_DECLARE(apt_log_priority_e) apt_log_priority_translate(const char *str);
/**
* Set the header (format) for log messages.
* @param header the header to set (used as bitmask)
*/
APT_DECLARE(apt_bool_t) apt_log_header_set(int header);
/**
* Translate the header string to bitmask of apt_log_header_e values.
* @param str the string to translate
*/
APT_DECLARE(int) apt_log_header_translate(char *str);
/**
* Set the masking mode of private data.
* @param masking the masking mode to set
*/
APT_DECLARE(apt_bool_t) apt_log_masking_set(apt_log_masking_e masking);
/**
* Get the current masking mode of private data.
*/
APT_DECLARE(apt_log_masking_e) apt_log_masking_get();
/**
* Translate the masking mode string to enum.
* @param str the string to translate
*/
APT_DECLARE(apt_log_masking_e) apt_log_masking_translate(const char *str);
/**
* Mask private data based on the masking mode
* @param data_in the data to mask
* @param length the length of the data to mask on input, the length of the masked data on output
* @param pool the memory pool to use if needed
* @return The masked data.
*/
APT_DECLARE(const char*) apt_log_data_mask(const char *data_in, apr_size_t *length, apr_pool_t *pool);
/**
* Set the extended external log handler.
* @param handler the handler to pass log events to
@ -165,6 +236,16 @@ APT_DECLARE(apt_bool_t) apt_log_ext_handler_set(apt_log_ext_handler_f handler);
*/
APT_DECLARE(apt_bool_t) apt_log(const char *file, int line, apt_log_priority_e priority, const char *format, ...);
/**
* Do logging.
* @param file the file name log entry is generated from
* @param line the line number log entry is generated from
* @param priority the priority of the entire log entry
* @param obj the associated object
* @param format the format of the entire log entry
*/
APT_DECLARE(apt_bool_t) apt_obj_log(const char *file, int line, apt_log_priority_e priority, void *obj, const char *format, ...);
APT_END_EXTERN_C
#endif /*__APT_LOG_H__*/
#endif /* APT_LOG_H */

View File

@ -0,0 +1,108 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_multipart_content.h 1722 2010-06-01 08:40:35Z achaloyan $
*/
#ifndef APT_MULTIPART_CONTENT_H
#define APT_MULTIPART_CONTENT_H
/**
* @file apt_multipart_content.h
* @brief Multipart Content Routine
*/
#include "apt_header_field.h"
APT_BEGIN_EXTERN_C
/** Opaque multipart content declaration */
typedef struct apt_multipart_content_t apt_multipart_content_t;
/** Content part declaration */
typedef struct apt_content_part_t apt_content_part_t;
/** Content part */
struct apt_content_part_t {
/** Header section */
apt_header_section_t header;
/** Body */
apt_str_t body;
/** Pointer to parsed content-type header field */
apt_str_t *type;
/** Pointer to parsed content-id header field */
apt_str_t *id;
/** Pointer to parsed content-length header field */
apt_str_t *length;
};
/**
* Create an empty multipart content
* @param max_content_size the max size of the content (body)
* @param boundary the boundary to separate content parts
* @param pool the pool to allocate memory from
* @return an empty multipart content
*/
APT_DECLARE(apt_multipart_content_t*) apt_multipart_content_create(apr_size_t max_content_size, const apt_str_t *boundary, apr_pool_t *pool);
/**
* Add content part to multipart content
* @param multipart_content the multipart content to add content part to
* @param content_part the content part to add
* @return TRUE on success
*/
APT_DECLARE(apt_bool_t) apt_multipart_content_add(apt_multipart_content_t *multipart_content, const apt_content_part_t *content_part);
/**
* Add content part to multipart content by specified header fields and body
* @param multipart_content the multipart content to add content part to
* @param content_type the type of content part
* @param content_id the identifier of content part
* @param body the body of content part
* @return TRUE on success
*/
APT_DECLARE(apt_bool_t) apt_multipart_content_add2(apt_multipart_content_t *multipart_content, const apt_str_t *content_type, const apt_str_t *content_id, const apt_str_t *body);
/**
* Finalize multipart content generation
* @param multipart_content the multipart content to finalize
* @return generated multipart content
*/
APT_DECLARE(apt_str_t*) apt_multipart_content_finalize(apt_multipart_content_t *multipart_content);
/**
* Assign body to multipart content to get (parse) each content part from
* @param body the body of multipart content to parse
* @param boundary the boundary to separate content parts
* @param pool the pool to allocate memory from
* @return multipart content with assigned body
*/
APT_DECLARE(apt_multipart_content_t*) apt_multipart_content_assign(const apt_str_t *body, const apt_str_t *boundary, apr_pool_t *pool);
/**
* Get the next content part
* @param multipart_content the multipart content to get the next content part from
* @param content_part the parsed content part
* @param is_final indicates the final boundary is reached
* @return TRUE on success
*/
APT_DECLARE(apt_bool_t) apt_multipart_content_get(apt_multipart_content_t *multipart_content, apt_content_part_t *content_part, apt_bool_t *is_final);
APT_END_EXTERN_C
#endif /* APT_MULTIPART_CONTENT_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_net.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_NET_H__
#define __APT_NET_H__
#ifndef APT_NET_H
#define APT_NET_H
/**
* @file apt_net.h
@ -43,4 +45,4 @@ void apt_ntp_time_get(apr_uint32_t *sec, apr_uint32_t *frac);
APT_END_EXTERN_C
#endif /*__APT_NET_H__*/
#endif /* APT_NET_H */

View File

@ -1,127 +0,0 @@
/*
* Copyright 2008 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __APT_NET_CLIENT_TASK_H__
#define __APT_NET_CLIENT_TASK_H__
/**
* @file apt_net_client_task.h
* @brief Network Client Task Base
*/
#include <apr_poll.h>
#include "apt_task.h"
APT_BEGIN_EXTERN_C
/** Opaque network client task declaration */
typedef struct apt_net_client_task_t apt_net_client_task_t;
/** Network client connection declaration */
typedef struct apt_net_client_connection_t apt_net_client_connection_t;
/** Virtual table of network client events */
typedef struct apt_net_client_vtable_t apt_net_client_vtable_t;
/** Network client connection */
struct apt_net_client_connection_t {
/** Memory pool */
apr_pool_t *pool;
/** External object */
void *obj;
/** Connected socket */
apr_socket_t *sock;
/** Socket poll descriptor */
apr_pollfd_t sock_pfd;
/** String identifier used for traces */
const char *id;
};
/** Virtual table of network client events */
struct apt_net_client_vtable_t {
/** Message receive handler */
apt_bool_t (*on_receive)(apt_net_client_task_t *task, apt_net_client_connection_t *connection);
};
/**
* Create network client task.
* @param max_connection_count the number of max connections
* @param obj the external object
* @param client_vtable the table of virtual methods of the net client task
* @param msg_pool the pool of task messages
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_net_client_task_t*) apt_net_client_task_create(
apr_size_t max_connection_count,
void *obj,
const apt_net_client_vtable_t *client_vtable,
apt_task_msg_pool_t *msg_pool,
apr_pool_t *pool);
/**
* Destroy network client task.
* @param task the task to destroy
*/
APT_DECLARE(apt_bool_t) apt_net_client_task_destroy(apt_net_client_task_t *task);
/**
* Start network client task and wait for incoming requests.
* @param task the task to start
*/
APT_DECLARE(apt_bool_t) apt_net_client_task_start(apt_net_client_task_t *task);
/**
* Terminate connection task.
* @param task the task to terminate
*/
APT_DECLARE(apt_bool_t) apt_net_client_task_terminate(apt_net_client_task_t *task);
/**
* Get task base.
* @param task the network client task to get task base from
*/
APT_DECLARE(apt_task_t*) apt_net_client_task_base_get(apt_net_client_task_t *task);
/**
* Get task vtable.
* @param task the network client task to get vtable from
*/
APT_DECLARE(apt_task_vtable_t*) apt_net_client_task_vtable_get(apt_net_client_task_t *task);
/**
* Get external object.
* @param task the task to get object from
*/
APT_DECLARE(void*) apt_net_client_task_object_get(apt_net_client_task_t *task);
/**
* Create connection.
*/
APT_DECLARE(apt_net_client_connection_t*) apt_net_client_connect(apt_net_client_task_t *task, const char *ip, apr_port_t port);
/**
* Close connection.
*/
APT_DECLARE(apt_bool_t) apt_net_client_connection_close(apt_net_client_task_t *task, apt_net_client_connection_t *connection);
/**
* Close and destroy connection.
*/
APT_DECLARE(apt_bool_t) apt_net_client_disconnect(apt_net_client_task_t *task, apt_net_client_connection_t *connection);
APT_END_EXTERN_C
#endif /*__APT_NET_CLIENT_TASK_H__*/

View File

@ -1,132 +0,0 @@
/*
* Copyright 2008 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __APT_NET_SERVER_TASK_H__
#define __APT_NET_SERVER_TASK_H__
/**
* @file apt_net_server_task.h
* @brief Network Server Task Base
*/
#include <apr_poll.h>
#include "apt_task.h"
APT_BEGIN_EXTERN_C
/** Opaque network server task declaration */
typedef struct apt_net_server_task_t apt_net_server_task_t;
/** Network server connection declaration */
typedef struct apt_net_server_connection_t apt_net_server_connection_t;
/** Virtual table of network server events */
typedef struct apt_net_server_vtable_t apt_net_server_vtable_t;
/** Network server connection */
struct apt_net_server_connection_t {
/** Memory pool */
apr_pool_t *pool;
/** External object */
void *obj;
/** Client IP address */
char *client_ip;
/** Accepted socket */
apr_socket_t *sock;
/** Socket poll descriptor */
apr_pollfd_t sock_pfd;
/** String identifier used for traces */
const char *id;
};
/** Virtual table of network server events */
struct apt_net_server_vtable_t {
/** Connect event handler */
apt_bool_t (*on_connect)(apt_net_server_task_t *task, apt_net_server_connection_t *connection);
/** Disconnect event handler */
apt_bool_t (*on_disconnect)(apt_net_server_task_t *task, apt_net_server_connection_t *connection);
/** Message receive handler */
apt_bool_t (*on_receive)(apt_net_server_task_t *task, apt_net_server_connection_t *connection);
};
/**
* Create network server task.
* @param listen_ip the listen IP address
* @param listen_port the listen port
* @param max_connection_count the number of max connections to accept
* @param obj the external object
* @param server_vtable the table of virtual methods of the net server task
* @param msg_pool the pool of task messages
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_net_server_task_t*) apt_net_server_task_create(
const char *listen_ip,
apr_port_t listen_port,
apr_size_t max_connection_count,
void *obj,
const apt_net_server_vtable_t *server_vtable,
apt_task_msg_pool_t *msg_pool,
apr_pool_t *pool);
/**
* Destroy network server task.
* @param task the task to destroy
*/
APT_DECLARE(apt_bool_t) apt_net_server_task_destroy(apt_net_server_task_t *task);
/**
* Start network server task and wait for incoming requests.
* @param task the task to start
*/
APT_DECLARE(apt_bool_t) apt_net_server_task_start(apt_net_server_task_t *task);
/**
* Terminate connection task.
* @param task the task to terminate
*/
APT_DECLARE(apt_bool_t) apt_net_server_task_terminate(apt_net_server_task_t *task);
/**
* Get task base.
* @param task the network server task to get task base from
*/
APT_DECLARE(apt_task_t*) apt_net_server_task_base_get(apt_net_server_task_t *task);
/**
* Get task vtable.
* @param task the network server task to get vtable from
*/
APT_DECLARE(apt_task_vtable_t*) apt_net_server_task_vtable_get(apt_net_server_task_t *task);
/**
* Get external object.
* @param task the task to get object from
*/
APT_DECLARE(void*) apt_net_server_task_object_get(apt_net_server_task_t *task);
/**
* Close connection.
*/
APT_DECLARE(apt_bool_t) apt_net_server_connection_close(apt_net_server_task_t *task, apt_net_server_connection_t *connection);
/**
* Destroy connection.
*/
APT_DECLARE(void) apt_net_server_connection_destroy(apt_net_server_connection_t *connection);
APT_END_EXTERN_C
#endif /*__APT_NET_SERVER_TASK_H__*/

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_nlsml_doc.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_NLSML_DOC_H__
#define __APT_NLSML_DOC_H__
#ifndef APT_NLSML_DOC_H
#define APT_NLSML_DOC_H
/**
* @file apt_nlsml_doc.h
@ -45,4 +47,4 @@ APT_DECLARE(const char *) nlsml_input_attrib_get(const apr_xml_elem *input, cons
APT_END_EXTERN_C
#endif /*__APT_NLSML_DOC_H__*/
#endif /* APT_NLSML_DOC_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_obj_list.h 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifndef __APT_OBJ_LIST_H__
#define __APT_OBJ_LIST_H__
#ifndef APT_OBJ_LIST_H
#define APT_OBJ_LIST_H
/**
* @file apt_obj_list.h
@ -65,40 +67,40 @@ APT_DECLARE(void*) apt_list_pop_front(apt_obj_list_t *list);
* Retrieve object of the first element in the list.
* @param list the list to retrieve from
*/
APT_DECLARE(void*) apt_list_head(apt_obj_list_t *list);
APT_DECLARE(void*) apt_list_head(const apt_obj_list_t *list);
/**
* Retrieve object of the last element in the list.
* @param list the list to retrieve from
*/
APT_DECLARE(void*) apt_obj_list_tail(apt_obj_list_t *list);
APT_DECLARE(void*) apt_obj_list_tail(const apt_obj_list_t *list);
/**
* Retrieve the first element of the list.
* @param list the list to retrieve from
*/
APT_DECLARE(apt_list_elem_t*) apt_list_first_elem_get(apt_obj_list_t *list);
APT_DECLARE(apt_list_elem_t*) apt_list_first_elem_get(const apt_obj_list_t *list);
/**
* Retrieve the last element of the list.
* @param list the list to retrieve from
*/
APT_DECLARE(apt_list_elem_t*) apt_list_last_elem_get(apt_obj_list_t *list);
APT_DECLARE(apt_list_elem_t*) apt_list_last_elem_get(const apt_obj_list_t *list);
/**
* Retrieve the next element of the list.
* @param list the list to retrieve from
* @param elem the element to retrieve next element from
*/
APT_DECLARE(apt_list_elem_t*) apt_list_next_elem_get(apt_obj_list_t *list, apt_list_elem_t *elem);
APT_DECLARE(apt_list_elem_t*) apt_list_next_elem_get(const apt_obj_list_t *list, apt_list_elem_t *elem);
/**
* Retrieve the prev element of the list.
* @param list the list to retrieve from
* @param elem the element to retrieve prev element from
*/
APT_DECLARE(apt_list_elem_t*) apt_list_prev_elem_get(apt_obj_list_t *list, apt_list_elem_t *elem);
APT_DECLARE(apt_list_elem_t*) apt_list_prev_elem_get(const apt_obj_list_t *list, apt_list_elem_t *elem);
/**
* Insert element to the list.
@ -123,15 +125,15 @@ APT_DECLARE(apt_list_elem_t*) apt_list_elem_remove(apt_obj_list_t *list, apt_lis
* @param list the list to query
* @return TRUE if empty, otherwise FALSE
*/
APT_DECLARE(apt_bool_t) apt_list_is_empty(apt_obj_list_t *list);
APT_DECLARE(apt_bool_t) apt_list_is_empty(const apt_obj_list_t *list);
/**
* Retrieve the object associated with element.
* @param elem the element to retrieve object from
*/
APT_DECLARE(void*) apt_list_elem_object_get(apt_list_elem_t *elem);
APT_DECLARE(void*) apt_list_elem_object_get(const apt_list_elem_t *elem);
APT_END_EXTERN_C
#endif /*__APT_OBJ_LIST_H__*/
#endif /* APT_OBJ_LIST_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_pair.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_PAIR_H__
#define __APT_PAIR_H__
#ifndef APT_PAIR_H
#define APT_PAIR_H
/**
* @file apt_pair.h
@ -70,4 +72,4 @@ APT_DECLARE(const apt_pair_t*) apt_pair_array_get(const apt_pair_arr_t *arr, int
APT_END_EXTERN_C
#endif /*__APT_PAIR_H__*/
#endif /* APT_PAIR_H */

View File

@ -0,0 +1,122 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_poller_task.h 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifndef APT_POLLER_TASK_H
#define APT_POLLER_TASK_H
/**
* @file apt_poller_task.h
* @brief Poller Task
*/
#include "apt_pollset.h"
#include "apt_task.h"
#include "apt_timer_queue.h"
APT_BEGIN_EXTERN_C
/** Opaque poller task declaration */
typedef struct apt_poller_task_t apt_poller_task_t;
/** Function prototype to handle signalled descripors */
typedef apt_bool_t (*apt_poll_signal_f)(void *obj, const apr_pollfd_t *descriptor);
/**
* Create poller task.
* @param max_pollset_size the maximum number of descriptors pollset can hold
* @param signal_handler the handler of signalled descriptors
* @param obj the external object to pass to callback
* @param msg_pool the pool of task messages
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_poller_task_t*) apt_poller_task_create(
apr_size_t max_pollset_size,
apt_poll_signal_f signal_handler,
void *obj,
apt_task_msg_pool_t *msg_pool,
apr_pool_t *pool);
/**
* Destroy poller task.
* @param task the task to destroy
*/
APT_DECLARE(apt_bool_t) apt_poller_task_destroy(apt_poller_task_t *task);
/**
* Cleanup poller task.
* @param task the task to cleanup
*
* @remark This function should be considered in protected scope.
* It will be called on task destroy unless you override the behavior.
*/
APT_DECLARE(void) apt_poller_task_cleanup(apt_poller_task_t *task);
/**
* Start poller task and wait for incoming messages.
* @param task the task to start
*/
APT_DECLARE(apt_bool_t) apt_poller_task_start(apt_poller_task_t *task);
/**
* Terminate poller task.
* @param task the task to terminate
*/
APT_DECLARE(apt_bool_t) apt_poller_task_terminate(apt_poller_task_t *task);
/**
* Get task base.
* @param task the poller task to get task base from
*/
APT_DECLARE(apt_task_t*) apt_poller_task_base_get(const apt_poller_task_t *task);
/**
* Get task vtable.
* @param task the poller task to get vtable from
*/
APT_DECLARE(apt_task_vtable_t*) apt_poller_task_vtable_get(apt_poller_task_t *task);
/**
* Get external object.
* @param task the poller task to get object from
*/
APT_DECLARE(void*) apt_poller_task_object_get(const apt_poller_task_t *task);
/**
* Get pollset.
* @param task the poller task to get pollset from
*/
APT_DECLARE(apt_pollset_t*) apt_poller_task_pollset_get(const apt_poller_task_t *task);
/**
* Create timer.
* @param task the poller task to create timer in the scope of
* @param proc the timer callback
* @param obj the object to pass to callback
* @param pool the pool to allocate memory from
*/
APT_DECLARE(apt_timer_t*) apt_poller_task_timer_create(
apt_poller_task_t *task,
apt_timer_proc_f proc,
void *obj,
apr_pool_t *pool);
APT_END_EXTERN_C
#endif /* APT_POLLER_TASK_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_pollset.h 1565 2010-03-06 07:13:04Z achaloyan $
*/
#ifndef __APT_POLLSET_H__
#define __APT_POLLSET_H__
#ifndef APT_POLLSET_H
#define APT_POLLSET_H
/**
* @file apt_pollset.h
@ -39,7 +41,7 @@ APT_BEGIN_EXTERN_C
typedef struct apt_pollset_t apt_pollset_t;
/**
* Create interruptable pollset on top of APR pollset
* Create interruptable pollset on top of APR pollset.
* @param size the maximum number of descriptors pollset can hold
* @param pool the pool to allocate memory from
*/
@ -69,7 +71,7 @@ APT_DECLARE(apt_bool_t) apt_pollset_remove(apt_pollset_t *pollset, const apr_pol
* Block for activity on the descriptor(s) in a pollset.
* @param pollset the pollset to use
* @param timeout the timeout in microseconds
* @param num nthe umber of signalled descriptors (output parameter)
* @param num the number of signalled descriptors (output parameter)
* @param descriptors the array of signalled descriptors (output parameter)
*/
APT_DECLARE(apr_status_t) apt_pollset_poll(
@ -93,4 +95,4 @@ APT_DECLARE(apt_bool_t) apt_pollset_is_wakeup(apt_pollset_t *pollset, const apr_
APT_END_EXTERN_C
#endif /*__APT_POLLSET_H__*/
#endif /* APT_POLLSET_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_pool.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_POOL_H__
#define __APT_POOL_H__
#ifndef APT_POOL_H
#define APT_POOL_H
/**
* @file apt_pool.h
@ -44,4 +46,4 @@ APT_DECLARE(apr_pool_t*) apt_subpool_create(apr_pool_t *parent);
APT_END_EXTERN_C
#endif /*__APT_POOL_H__*/
#endif /* APT_POOL_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_string.h 1531 2010-02-20 14:19:53Z achaloyan $
*/
#ifndef __APT_STRING_H__
#define __APT_STRING_H__
#ifndef APT_STRING_H
#define APT_STRING_H
/**
* @file apt_string.h
@ -65,7 +67,7 @@ static APR_INLINE apr_size_t apt_string_length_get(const apt_str_t *str)
/** Check whether string is empty. */
static APR_INLINE apr_size_t apt_string_is_empty(const apt_str_t *str)
{
return str->length ? TRUE : FALSE;
return str->length ? FALSE : TRUE;
}
/**
@ -140,4 +142,4 @@ static APR_INLINE apt_bool_t apt_string_compare(const apt_str_t *str1, const apt
APT_END_EXTERN_C
#endif /*__APT_STRING_H__*/
#endif /* APT_STRING_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_string_table.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_STRING_TABLE_H__
#define __APT_STRING_TABLE_H__
#ifndef APT_STRING_TABLE_H
#define APT_STRING_TABLE_H
/**
* @file apt_string_table.h
@ -60,4 +62,4 @@ APT_DECLARE(apr_size_t) apt_string_table_id_find(const apt_str_table_item_t tabl
APT_END_EXTERN_C
#endif /*__APT_STRING_TABLE_H__*/
#endif /* APT_STRING_TABLE_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_task.h 1696 2010-05-20 15:44:16Z achaloyan $
*/
#ifndef __APT_TASK_H__
#define __APT_TASK_H__
#ifndef APT_TASK_H
#define APT_TASK_H
/**
* @file apt_task.h
@ -124,19 +126,19 @@ APT_DECLARE(apt_bool_t) apt_task_msg_process(apt_task_t *task, apt_task_msg_t *m
* Get parent (master) task.
* @param task the task to get parent from
*/
APT_DECLARE(apt_task_t*) apt_task_parent_get(apt_task_t *task);
APT_DECLARE(apt_task_t*) apt_task_parent_get(const apt_task_t *task);
/**
* Get memory pool associated with task.
* @param task the task to get pool from
*/
APT_DECLARE(apr_pool_t*) apt_task_pool_get(apt_task_t *task);
APT_DECLARE(apr_pool_t*) apt_task_pool_get(const apt_task_t *task);
/**
* Get external object associated with the task.
* @param task the task to get object from
*/
APT_DECLARE(void*) apt_task_object_get(apt_task_t *task);
APT_DECLARE(void*) apt_task_object_get(const apt_task_t *task);
/**
* Get task vtable.
@ -155,7 +157,7 @@ APT_DECLARE(void) apt_task_name_set(apt_task_t *task, const char *name);
* Get task name.
* @param task the task to get name from
*/
APT_DECLARE(const char*) apt_task_name_get(apt_task_t *task);
APT_DECLARE(const char*) apt_task_name_get(const apt_task_t *task);
/**
* Enable/disable auto ready mode.
@ -170,6 +172,36 @@ APT_DECLARE(void) apt_task_auto_ready_set(apt_task_t *task, apt_bool_t auto_read
*/
APT_DECLARE(apt_bool_t) apt_task_ready(apt_task_t *task);
/**
* Get the running flag.
* @param task the task
*/
APT_DECLARE(apt_bool_t*) apt_task_running_flag_get(apt_task_t *task);
/**
* Add start request.
* @param task the task
*/
APT_DECLARE(apt_bool_t) apt_task_start_request_add(apt_task_t *task);
/**
* Remove start request.
* @param task the task
*/
APT_DECLARE(apt_bool_t) apt_task_start_request_remove(apt_task_t *task);
/**
* Add termination request.
* @param task the task
*/
APT_DECLARE(apt_bool_t) apt_task_terminate_request_add(apt_task_t *task);
/**
* Remove termination request.
* @param task the task
*/
APT_DECLARE(apt_bool_t) apt_task_terminate_request_remove(apt_task_t *task);
/**
* Hold task execution.
* @param msec the time to hold
@ -197,26 +229,16 @@ struct apt_task_vtable_t {
apt_task_event_f on_pre_run;
/** Virtual post-run event handler */
apt_task_event_f on_post_run;
/** Virtual start-request event handler */
apt_task_event_f on_start_request;
/** Virtual start-complete event handler */
apt_task_event_f on_start_complete;
/** Virtual terminate-request event handler */
apt_task_event_f on_terminate_request;
/** Virtual terminate-complete event handler */
apt_task_event_f on_terminate_complete;
};
static APR_INLINE void apt_task_vtable_reset(apt_task_vtable_t *vtable)
{
vtable->destroy = NULL;
vtable->start = NULL;
vtable->terminate = NULL;
vtable->run = NULL;
vtable->signal_msg = NULL;
vtable->process_msg = NULL;
vtable->on_pre_run = NULL;
vtable->on_post_run = NULL;
vtable->on_start_complete = NULL;
vtable->on_terminate_complete = NULL;
}
APT_END_EXTERN_C
#endif /*__APT_TASK_H__*/
#endif /* APT_TASK_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_task_msg.h 1474 2010-02-07 20:51:47Z achaloyan $
*/
#ifndef __APT_TASK_MSG_H__
#define __APT_TASK_MSG_H__
#ifndef APT_TASK_MSG_H
#define APT_TASK_MSG_H
/**
* @file apt_task_msg.h
@ -77,4 +79,4 @@ APT_DECLARE(void) apt_task_msg_release(apt_task_msg_t *task_msg);
APT_END_EXTERN_C
#endif /*__APT_TASK_MSG_H__*/
#endif /* APT_TASK_MSG_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_test_suite.h 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifndef __APT_TEST_SUITE_H__
#define __APT_TEST_SUITE_H__
#ifndef APT_TEST_SUITE_H
#define APT_TEST_SUITE_H
/**
* @file apt_test_suite.h
@ -92,8 +94,8 @@ APT_DECLARE(apt_bool_t) apt_test_framework_run(apt_test_framework_t *framework,
* Retrieve the memory pool.
* @param framework the test framework to retrieve memory pool from
*/
APT_DECLARE(apr_pool_t*) apt_test_framework_pool_get(apt_test_framework_t *framework);
APT_DECLARE(apr_pool_t*) apt_test_framework_pool_get(const apt_test_framework_t *framework);
APT_END_EXTERN_C
#endif /*__APT_TEST_SUITE_H__*/
#endif /* APT_TEST_SUITE_H */

View File

@ -0,0 +1,125 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_text_message.h 1722 2010-06-01 08:40:35Z achaloyan $
*/
#ifndef APT_TEXT_MESSAGE_H
#define APT_TEXT_MESSAGE_H
/**
* @file apt_text_message.h
* @brief Text Message Interface (RFC5322)
*/
#include "apt_header_field.h"
#include "apt_text_stream.h"
APT_BEGIN_EXTERN_C
/** Status of text message processing (parsing/generation) */
typedef enum {
APT_MESSAGE_STATUS_COMPLETE,
APT_MESSAGE_STATUS_INCOMPLETE,
APT_MESSAGE_STATUS_INVALID
} apt_message_status_e;
/** Opaque text message parser */
typedef struct apt_message_parser_t apt_message_parser_t;
/** Vtable of text message parser */
typedef struct apt_message_parser_vtable_t apt_message_parser_vtable_t;
/** Opaque text message generator */
typedef struct apt_message_generator_t apt_message_generator_t;
/** Vtable of text message generator */
typedef struct apt_message_generator_vtable_t apt_message_generator_vtable_t;
/** Temporary context associated with message and used for its parsing or generation */
typedef struct apt_message_context_t apt_message_context_t;
/** Create message parser */
APT_DECLARE(apt_message_parser_t*) apt_message_parser_create(void *obj, const apt_message_parser_vtable_t *vtable, apr_pool_t *pool);
/** Parse message by raising corresponding event handlers */
APT_DECLARE(apt_message_status_e) apt_message_parser_run(apt_message_parser_t *parser, apt_text_stream_t *stream, void **message);
/** Get external object associated with parser */
APT_DECLARE(void*) apt_message_parser_object_get(apt_message_parser_t *parser);
/** Set verbose mode for the parser */
APT_DECLARE(void) apt_message_parser_verbose_set(apt_message_parser_t *parser, apt_bool_t verbose);
/** Create message generator */
APT_DECLARE(apt_message_generator_t*) apt_message_generator_create(void *obj, const apt_message_generator_vtable_t *vtable, apr_pool_t *pool);
/** Generate message */
APT_DECLARE(apt_message_status_e) apt_message_generator_run(apt_message_generator_t *generator, void *message, apt_text_stream_t *stream);
/** Get external object associated with generator */
APT_DECLARE(void*) apt_message_generator_object_get(apt_message_generator_t *generator);
/** Set verbose mode for the parser */
APT_DECLARE(void) apt_message_generator_verbose_set(apt_message_generator_t *generator, apt_bool_t verbose);
/** Parse individual header field (name-value pair) */
APT_DECLARE(apt_header_field_t*) apt_header_field_parse(apt_text_stream_t *stream, apr_pool_t *pool);
/** Generate individual header field (name-value pair) */
APT_DECLARE(apt_bool_t) apt_header_field_generate(const apt_header_field_t *header_field, apt_text_stream_t *stream);
/** Parse header section */
APT_DECLARE(apt_bool_t) apt_header_section_parse(apt_header_section_t *header, apt_text_stream_t *stream, apr_pool_t *pool);
/** Generate header section */
APT_DECLARE(apt_bool_t) apt_header_section_generate(const apt_header_section_t *header, apt_text_stream_t *stream);
/** Temporary context associated with message and used for its parsing or generation */
struct apt_message_context_t {
/** Context or ptotocol specific message */
void *message;
/** Header section of the message */
apt_header_section_t *header;
/** Body or content of the message */
apt_str_t *body;
};
/** Vtable of text message parser */
struct apt_message_parser_vtable_t {
/** Start new message parsing by associating corresponding context and reading its start-line if applicable */
apt_bool_t (*on_start)(apt_message_parser_t *parser, apt_message_context_t *context, apt_text_stream_t *stream, apr_pool_t *pool);
/** Header section handler is invoked when entire header section has been read and parsed into header fields */
apt_bool_t (*on_header_complete)(apt_message_parser_t *parser, apt_message_context_t *context);
/** Body handler is invoked when entire body has been read */
apt_bool_t (*on_body_complete)(apt_message_parser_t *parser, apt_message_context_t *context);
};
/** Vtable of text message generator */
struct apt_message_generator_vtable_t {
/** Start message generation by associating corresponding context and generating message start-line if applicable */
apt_bool_t (*on_start)(apt_message_generator_t *generator, apt_message_context_t *context, apt_text_stream_t *stream);
/** Header section handler is invoked to notify header section has been generated */
apt_bool_t (*on_header_complete)(apt_message_generator_t *generator, apt_message_context_t *context, apt_text_stream_t *stream);
/** Body handler is invoked to notify body has been generated */
apt_bool_t (*on_body_complete)(apt_message_generator_t *generator, apt_message_context_t *context, apt_text_stream_t *stream);
};
APT_END_EXTERN_C
#endif /* APT_TEXT_MESSAGE_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,25 +12,27 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_text_stream.h 1672 2010-04-28 20:37:22Z achaloyan $
*/
#ifndef __APT_TEXT_STREAM_H__
#define __APT_TEXT_STREAM_H__
#ifndef APT_TEXT_STREAM_H
#define APT_TEXT_STREAM_H
/**
* @file apt_text_stream.h
* @brief Text Stream Parse/Generate Routine
*/
#include "apt_string.h"
#include "apt_string_table.h"
#include "apt_pair.h"
APT_BEGIN_EXTERN_C
/** Named tokens */
/** Space */
#define APT_TOKEN_SP ' '
#define APT_TOKEN_SP 0x20
/** Horizontal tab */
#define APT_TOKEN_HTAB 0x09
/** Carrige return */
#define APT_TOKEN_CR 0x0D
/** Line feed */
@ -52,73 +54,77 @@ struct apt_text_stream_t {
apt_bool_t is_eos;
};
/**
* Navigate through the lines of the text stream (message).
* @param stream the text stream to navigate
* Read entire line of the text stream.
* @param stream the text stream to navigate on
* @param line the read line to return
* @return TRUE if the line is successfully read, otherwise FALSE
* @remark To be used to navigate through the lines of the text stream (message).
*/
APT_DECLARE(apt_bool_t) apt_text_line_read(apt_text_stream_t *stream, apt_str_t *line);
/**
* Navigate through the headers (name:value pairs) of the text stream (message).
* Read header field (name-value pair) of the text stream by scanning entire line.
* @param stream the text stream to navigate
* @param pair the read pair to return
* @return TRUE if the header is successfully read, otherwise FALSE
* @remark To be used to navigate through the lines and read header fields
* (name:value pairs) of the text stream (message).
*/
APT_DECLARE(apt_bool_t) apt_text_header_read(apt_text_stream_t *stream, apt_pair_t *pair);
/**
* Navigate through the fields of the line.
* Read the field terminated with specified separator.
* @param stream the text stream to navigate
* @param separator the field separator
* @param skip_spaces whether to skip spaces or not
* @param field the read field to return
* @return TRUE if the length of the field > 0, otherwise FALSE
* @return TRUE if the read field isn't empty, otherwise FALSE
* @remark To be used to navigate through the fields of the text stream (message).
*/
APT_DECLARE(apt_bool_t) apt_text_field_read(apt_text_stream_t *stream, char separator, apt_bool_t skip_spaces, apt_str_t *field);
/** Generate name-value pair line */
APT_DECLARE(apt_bool_t) apt_text_name_value_insert(apt_text_stream_t *stream, const apt_str_t *name, const apt_str_t *value);
/** Generate header */
APT_DECLARE(apt_bool_t) apt_text_header_generate(const apt_pair_t *pair, apt_text_stream_t *text_stream);
/** Generate only the name ("name:") of the header */
APT_DECLARE(apt_bool_t) apt_text_header_name_generate(const apt_str_t *name, apt_text_stream_t *text_stream);
/** Generate only the name ("name:") of the header field */
APT_DECLARE(apt_bool_t) apt_text_header_name_insert(apt_text_stream_t *stream, const apt_str_t *name);
/** Parse array of name-value pairs */
APT_DECLARE(apt_bool_t) apt_pair_array_parse(apt_pair_arr_t *arr, const apt_str_t *value, apr_pool_t *pool);
/** Generate array of name-value pairs */
APT_DECLARE(apt_bool_t) apt_pair_array_generate(apt_pair_arr_t *arr, apt_text_stream_t *text_stream);
APT_DECLARE(apt_bool_t) apt_pair_array_generate(const apt_pair_arr_t *arr, apt_str_t *str, apr_pool_t *pool);
/** Insert array of name-value pairs */
APT_DECLARE(apt_bool_t) apt_text_pair_array_insert(apt_text_stream_t *stream, const apt_pair_arr_t *arr);
/** Parse boolean-value */
APT_DECLARE(apt_bool_t) apt_boolean_value_parse(const apt_str_t *str, apt_bool_t *value);
/** Generate apr_size_t value from pool (buffer is allocated from pool) */
APT_DECLARE(apt_bool_t) apt_boolean_value_generate(apt_bool_t value, apt_str_t *str, apr_pool_t *pool);
/** Generate boolean-value */
APT_DECLARE(apt_bool_t) apt_boolean_value_generate(apt_bool_t value, apt_text_stream_t *str);
/** Insert boolean-value */
APT_DECLARE(apt_bool_t) apt_text_boolean_value_insert(apt_text_stream_t *stream, apt_bool_t value);
/** Parse size_t value */
/** Parse apr_size_t value */
APT_DECLARE(apr_size_t) apt_size_value_parse(const apt_str_t *str);
/** Generate apr_size_t value from pool (buffer is allocated from pool) */
APT_DECLARE(apt_bool_t) apt_size_value_generate(apr_size_t value, apt_str_t *str, apr_pool_t *pool);
/** Generate apr_size_t value */
APT_DECLARE(apt_bool_t) apt_size_value_generate(apr_size_t value, apt_text_stream_t *stream);
/** Insert apr_size_t value */
APT_DECLARE(apt_bool_t) apt_text_size_value_insert(apt_text_stream_t *stream, apr_size_t value);
/** Parse float value */
APT_DECLARE(float) apt_float_value_parse(const apt_str_t *str);
/** Generate float value (buffer is allocated from pool) */
APT_DECLARE(apt_bool_t) apt_float_value_generate(float value, apt_str_t *str, apr_pool_t *pool);
/** Generate float value */
APT_DECLARE(apt_bool_t) apt_float_value_generate(float value, apt_text_stream_t *stream);
/** Generate string value */
static APR_INLINE apt_bool_t apt_string_value_generate(const apt_str_t *str, apt_text_stream_t *stream)
{
if(str->length) {
memcpy(stream->pos,str->buf,str->length);
stream->pos += str->length;
}
return TRUE;
}
/** Insert float value */
APT_DECLARE(apt_bool_t) apt_text_float_value_insert(apt_text_stream_t *stream, float value);
/** Insert string value */
APT_DECLARE(apt_bool_t) apt_text_string_insert(apt_text_stream_t *stream, const apt_str_t *str);
/** Reset navigation related data of the text stream */
static APR_INLINE void apt_text_stream_reset(apt_text_stream_t *stream)
@ -137,36 +143,74 @@ static APR_INLINE void apt_text_stream_init(apt_text_stream_t *stream, char *buf
}
/** Insert end of the line symbol(s) */
static APR_INLINE void apt_text_eol_insert(apt_text_stream_t *stream)
static APR_INLINE apt_bool_t apt_text_eol_insert(apt_text_stream_t *stream)
{
*stream->pos++ = APT_TOKEN_CR;
*stream->pos++ = APT_TOKEN_LF;
if(stream->pos + 2 < stream->end) {
*stream->pos++ = APT_TOKEN_CR;
*stream->pos++ = APT_TOKEN_LF;
return TRUE;
}
return FALSE;
}
/** Insert character */
static APR_INLINE void apt_text_char_insert(apt_text_stream_t *stream, char ch)
static APR_INLINE apt_bool_t apt_text_char_insert(apt_text_stream_t *stream, char ch)
{
*stream->pos++ = ch;
if(stream->pos + 1 < stream->end) {
*stream->pos++ = ch;
return TRUE;
}
return FALSE;
}
/** Insert space */
static APR_INLINE void apt_text_space_insert(apt_text_stream_t *stream)
static APR_INLINE apt_bool_t apt_text_space_insert(apt_text_stream_t *stream)
{
*stream->pos++ = APT_TOKEN_SP;
return apt_text_char_insert(stream,APT_TOKEN_SP);
}
/** Skip spaces */
/** Insert space */
static APR_INLINE apt_bool_t apt_text_htab_insert(apt_text_stream_t *stream)
{
return apt_text_char_insert(stream,APT_TOKEN_HTAB);
}
/** Check whether specified character is a white space (WSP = SP / HTAB) */
static APR_INLINE apt_bool_t apt_text_is_wsp(char ch)
{
return (ch == APT_TOKEN_SP || ch == APT_TOKEN_HTAB) ? TRUE : FALSE;
}
/** Skip sequence of spaces */
static APR_INLINE void apt_text_spaces_skip(apt_text_stream_t *stream)
{
const char *end = stream->text.buf + stream->text.length;
while(stream->pos < end && *stream->pos == APT_TOKEN_SP) stream->pos++;
while(stream->pos < stream->end && *stream->pos == APT_TOKEN_SP)
stream->pos++;
}
/** Skip sequence of white spaces (WSP = SP / HTAB) */
static APR_INLINE void apt_text_white_spaces_skip(apt_text_stream_t *stream)
{
while(stream->pos < stream->end && apt_text_is_wsp(*stream->pos) == TRUE)
stream->pos++;
}
/** Skip specified character */
static APR_INLINE void apt_text_char_skip(apt_text_stream_t *stream, char ch)
{
const char *end = stream->text.buf + stream->text.length;
if(stream->pos < end && *stream->pos == ch) stream->pos++;
if(stream->pos < stream->end && *stream->pos == ch) stream->pos++;
}
/** Skip sequence of specified characters */
static APR_INLINE void apt_text_chars_skip(apt_text_stream_t *stream, char ch)
{
while(stream->pos < stream->end && *stream->pos == ch) stream->pos++;
}
/** Skip to specified character */
static APR_INLINE void apt_text_skip_to_char(apt_text_stream_t *stream, char ch)
{
while(stream->pos < stream->end && *stream->pos != ch) stream->pos++;
}
/** Check whether end of stream is reached */
@ -180,13 +224,14 @@ APT_DECLARE(apt_bool_t) apt_text_stream_scroll(apt_text_stream_t *stream);
/** Parse id at resource string */
APT_DECLARE(apt_bool_t) apt_id_resource_parse(const apt_str_t *str, char separator, apt_str_t *id, apt_str_t *resource, apr_pool_t *pool);
/** Generate id at resource string */
APT_DECLARE(apt_bool_t) apt_id_resource_generate(const apt_str_t *id, const apt_str_t *resource, char separator, apt_str_t *str, apr_pool_t *pool);
/** Generate value plus the length (number of digits) of the value itself */
APT_DECLARE(apt_bool_t) apt_var_length_value_generate(apr_size_t *value, apr_size_t max_count, apt_str_t *str);
/** Generate completion-cause */
APT_DECLARE(apt_bool_t) apt_completion_cause_generate(const apt_str_table_item_t table[], apr_size_t size, apr_size_t cause, apt_str_t *str, apr_pool_t *pool);
/**
* Generate unique identifier (hex string)
@ -199,4 +244,4 @@ APT_DECLARE(apt_bool_t) apt_unique_id_generate(apt_str_t *id, apr_size_t length,
APT_END_EXTERN_C
#endif /*__APT_TEXT_STREAM_H__*/
#endif /* APT_TEXT_STREAM_H */

View File

@ -0,0 +1,68 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_timer_queue.h 1642 2010-04-08 13:37:57Z achaloyan $
*/
#ifndef APT_TIMER_QUEUE_H
#define APT_TIMER_QUEUE_H
/**
* @file apt_timer_queue.h
* @brief Timer Queue
*/
#include "apt.h"
APT_BEGIN_EXTERN_C
/** Opaque timer declaration */
typedef struct apt_timer_t apt_timer_t;
/** Opaque timer queue declaration */
typedef struct apt_timer_queue_t apt_timer_queue_t;
/** Prototype of timer callback */
typedef void (*apt_timer_proc_f)(apt_timer_t *timer, void *obj);
/** Create timer queue */
APT_DECLARE(apt_timer_queue_t*) apt_timer_queue_create(apr_pool_t *pool);
/** Destroy timer queue */
APT_DECLARE(void) apt_timer_queue_destroy(apt_timer_queue_t *timer_queue);
/** Advance scheduled timers */
APT_DECLARE(void) apt_timer_queue_advance(apt_timer_queue_t *timer_queue, apr_uint32_t elapsed_time);
/** Is timer queue empty */
APT_DECLARE(apt_bool_t) apt_timer_queue_is_empty(const apt_timer_queue_t *timer_queue);
/** Get current timeout */
APT_DECLARE(apt_bool_t) apt_timer_queue_timeout_get(const apt_timer_queue_t *timer_queue, apr_uint32_t *timeout);
/** Create timer */
APT_DECLARE(apt_timer_t*) apt_timer_create(apt_timer_queue_t *timer_queue, apt_timer_proc_f proc, void *obj, apr_pool_t *pool);
/** Set one-shot timer */
APT_DECLARE(apt_bool_t) apt_timer_set(apt_timer_t *timer, apr_uint32_t timeout);
/** Kill timer */
APT_DECLARE(apt_bool_t) apt_timer_kill(apt_timer_t *timer);
APT_END_EXTERN_C
#endif /* APT_TIMER_QUEUE_H */

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_consumer_task.c 1708 2010-05-24 17:03:25Z achaloyan $
*/
#include <apr_time.h>
@ -54,7 +56,7 @@ APT_DECLARE(apt_consumer_task_t*) apt_consumer_task_create(
return consumer_task;
}
APT_DECLARE(apt_task_t*) apt_consumer_task_base_get(apt_consumer_task_t *task)
APT_DECLARE(apt_task_t*) apt_consumer_task_base_get(const apt_consumer_task_t *task)
{
return task->base;
}
@ -64,7 +66,7 @@ APT_DECLARE(apt_task_vtable_t*) apt_consumer_task_vtable_get(apt_consumer_task_t
return apt_task_vtable_get(task->base);
}
APT_DECLARE(void*) apt_consumer_task_object_get(apt_consumer_task_t *task)
APT_DECLARE(void*) apt_consumer_task_object_get(const apt_consumer_task_t *task)
{
return task->obj;
}
@ -79,22 +81,25 @@ static apt_bool_t apt_consumer_task_run(apt_task_t *task)
{
apr_status_t rv;
void *msg;
apt_bool_t running = TRUE;
apt_bool_t *running;
apt_consumer_task_t *consumer_task;
consumer_task = apt_task_object_get(task);
if(!consumer_task) {
return FALSE;
}
while(running) {
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Wait for Task Messages [%s]",apt_task_name_get(task));
running = apt_task_running_flag_get(task);
if(!running) {
return FALSE;
}
while(*running) {
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Wait for Messages [%s]",apt_task_name_get(task));
rv = apr_queue_pop(consumer_task->msg_queue,&msg);
if(rv == APR_SUCCESS) {
if(msg) {
apt_task_msg_t *task_msg = msg;
if(apt_task_msg_process(consumer_task->base,task_msg) == FALSE) {
running = FALSE;
}
apt_task_msg_process(consumer_task->base,task_msg);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_cyclic_queue.c 1708 2010-05-24 17:03:25Z achaloyan $
*/
#include <stdlib.h>
@ -78,7 +80,7 @@ APT_DECLARE(void) apt_cyclic_queue_clear(apt_cyclic_queue_t *queue)
queue->head = queue->tail = 0;
}
APT_DECLARE(apt_bool_t) apt_cyclic_queue_is_empty(apt_cyclic_queue_t *queue)
APT_DECLARE(apt_bool_t) apt_cyclic_queue_is_empty(const apt_cyclic_queue_t *queue)
{
return queue->actual_size ? TRUE : FALSE;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_dir_layout.c 1524 2010-02-15 20:44:16Z achaloyan $
*/
#include <apr_file_info.h>
@ -72,3 +74,14 @@ APT_DECLARE(char*) apt_datadir_filepath_get(const apt_dir_layout_t *dir_layout,
}
return NULL;
}
APT_DECLARE(char*) apt_confdir_filepath_get(const apt_dir_layout_t *dir_layout, const char *file_name, apr_pool_t *pool)
{
if(dir_layout && dir_layout->conf_dir_path && file_name) {
char *file_path = NULL;
if(apr_filepath_merge(&file_path,dir_layout->conf_dir_path,file_name,0,pool) == APR_SUCCESS) {
return file_path;
}
}
return NULL;
}

View File

@ -0,0 +1,183 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_header_field.c 1685 2010-05-06 05:34:54Z achaloyan $
*/
#include "apt_header_field.h"
#include "apt_text_stream.h"
#define UNKNOWN_HEADER_FIELD_ID (apr_size_t)-1
/** Allocate an empty header field */
APT_DECLARE(apt_header_field_t*) apt_header_field_alloc(apr_pool_t *pool)
{
apt_header_field_t *header_field = apr_palloc(pool,sizeof(apt_header_field_t));
apt_string_reset(&header_field->name);
apt_string_reset(&header_field->value);
header_field->id = UNKNOWN_HEADER_FIELD_ID;
APR_RING_ELEM_INIT(header_field,link);
return header_field;
}
/** Create a header field using given name and value APT strings */
APT_DECLARE(apt_header_field_t*) apt_header_field_create(const apt_str_t *name, const apt_str_t *value, apr_pool_t *pool)
{
apt_header_field_t *header_field;
if(!name || !value) {
return NULL;
}
header_field = apr_palloc(pool,sizeof(apt_header_field_t));
apt_string_copy(&header_field->name,name,pool);
apt_string_copy(&header_field->value,value,pool);
header_field->id = UNKNOWN_HEADER_FIELD_ID;
APR_RING_ELEM_INIT(header_field,link);
return header_field;
}
/** Create a header field using given name and value C strings */
APT_DECLARE(apt_header_field_t*) apt_header_field_create_c(const char *name, const char *value, apr_pool_t *pool)
{
apt_header_field_t *header_field;
if(!name || !value) {
return NULL;
}
header_field = apr_palloc(pool,sizeof(apt_header_field_t));
apt_string_assign(&header_field->name,name,pool);
apt_string_assign(&header_field->value,value,pool);
header_field->id = UNKNOWN_HEADER_FIELD_ID;
APR_RING_ELEM_INIT(header_field,link);
return header_field;
}
/* Create a header field from entire text line consisting of a name and value pair */
APT_DECLARE(apt_header_field_t*) apt_header_field_create_from_line(const apt_str_t *line, char separator, apr_pool_t *pool)
{
apt_str_t item;
apt_text_stream_t stream;
apt_header_field_t *header_field;
if(!line) {
return NULL;
}
header_field = apr_palloc(pool,sizeof(apt_header_field_t));
stream.text = *line;
apt_text_stream_reset(&stream);
/* read name */
if(apt_text_field_read(&stream,separator,TRUE,&item) == FALSE) {
return NULL;
}
apt_string_copy(&header_field->name,&item,pool);
/* read value */
apt_text_field_read(&stream,0,TRUE,&item);
apt_string_copy(&header_field->value,&item,pool);
header_field->id = UNKNOWN_HEADER_FIELD_ID;
APR_RING_ELEM_INIT(header_field,link);
return header_field;
}
/** Copy specified header field */
APT_DECLARE(apt_header_field_t*) apt_header_field_copy(const apt_header_field_t *src_header_field, apr_pool_t *pool)
{
apt_header_field_t *header_field = apr_palloc(pool,sizeof(apt_header_field_t));
apt_string_copy(&header_field->name,&src_header_field->name,pool);
apt_string_copy(&header_field->value,&src_header_field->value,pool);
header_field->id = src_header_field->id;
APR_RING_ELEM_INIT(header_field,link);
return header_field;
}
/** Initialize header section (collection of header fields) */
APT_DECLARE(void) apt_header_section_init(apt_header_section_t *header)
{
APR_RING_INIT(&header->ring, apt_header_field_t, link);
header->arr = NULL;
header->arr_size = 0;
}
/** Allocate header section to set/get header fields by numeric identifiers */
APT_DECLARE(apt_bool_t) apt_header_section_array_alloc(apt_header_section_t *header, apr_size_t max_field_count, apr_pool_t *pool)
{
if(!max_field_count) {
return FALSE;
}
header->arr = (apt_header_field_t**)apr_pcalloc(pool,sizeof(apt_header_field_t*) * max_field_count);
header->arr_size = max_field_count;
return TRUE;
}
/** Add (append) header field to header section */
APT_DECLARE(apt_bool_t) apt_header_section_field_add(apt_header_section_t *header, apt_header_field_t *header_field)
{
if(header_field->id < header->arr_size) {
if(header->arr[header_field->id]) {
return FALSE;
}
header->arr[header_field->id] = header_field;
}
APR_RING_INSERT_TAIL(&header->ring,header_field,apt_header_field_t,link);
return TRUE;
}
/** Insert header field to header section based on numreic identifier if specified */
APT_DECLARE(apt_bool_t) apt_header_section_field_insert(apt_header_section_t *header, apt_header_field_t *header_field)
{
apt_header_field_t *it;
if(header_field->id < header->arr_size) {
if(header->arr[header_field->id]) {
return FALSE;
}
header->arr[header_field->id] = header_field;
for(it = APR_RING_FIRST(&header->ring);
it != APR_RING_SENTINEL(&header->ring, apt_header_field_t, link);
it = APR_RING_NEXT(it, link)) {
if(header_field->id < it->id) {
APR_RING_INSERT_BEFORE(it,header_field,link);
return TRUE;
}
}
}
APR_RING_INSERT_TAIL(&header->ring,header_field,apt_header_field_t,link);
return TRUE;
}
/** Set header field in the array of header fields using associated numeric identifier */
APT_DECLARE(apt_bool_t) apt_header_section_field_set(apt_header_section_t *header, apt_header_field_t *header_field)
{
if(header_field->id >= header->arr_size) {
return FALSE;
}
if(header->arr[header_field->id]) {
return FALSE;
}
header->arr[header_field->id] = header_field;
return TRUE;
}
/** Remove header field from header section */
APT_DECLARE(apt_bool_t) apt_header_section_field_remove(apt_header_section_t *header, apt_header_field_t *header_field)
{
if(header_field->id < header->arr_size) {
header->arr[header_field->id] = NULL;
}
APR_RING_REMOVE(header_field,link);
return TRUE;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,10 +12,14 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_log.c 1792 2011-01-10 21:08:52Z achaloyan $
*/
#include <apr_time.h>
#include <apr_file_io.h>
#include <apr_portable.h>
#include <apr_xml.h>
#include "apt_log.h"
#define MAX_LOG_ENTRY_SIZE 4096
@ -43,6 +47,7 @@ struct apt_log_file_data_t {
apr_size_t max_size;
apr_size_t cur_file_index;
apr_size_t max_file_count;
apt_bool_t append;
apr_thread_mutex_t *mutex;
apr_pool_t *pool;
};
@ -53,6 +58,7 @@ struct apt_logger_t {
int header;
apt_log_ext_handler_f ext_handler;
apt_log_file_data_t *file_data;
apt_log_masking_e masking;
};
static apt_logger_t *apt_logger = NULL;
@ -61,19 +67,83 @@ static apt_bool_t apt_do_log(const char *file, int line, apt_log_priority_e prio
static const char* apt_log_file_path_make(apt_log_file_data_t *file_data);
static apt_bool_t apt_log_file_dump(apt_log_file_data_t *file_data, const char *log_entry, apr_size_t size);
static apr_xml_doc* apt_log_doc_parse(const char *file_path, apr_pool_t *pool);
static apr_size_t apt_log_file_get_size(apt_log_file_data_t *file_data);
static apr_byte_t apt_log_file_exist(apt_log_file_data_t *file_data);
static apt_logger_t* apt_log_instance_alloc(apr_pool_t *pool)
{
apt_logger_t *logger = apr_palloc(pool,sizeof(apt_logger_t));
logger->mode = APT_LOG_OUTPUT_CONSOLE;
logger->priority = APT_PRIO_INFO;
logger->header = APT_LOG_HEADER_DEFAULT;
logger->ext_handler = NULL;
logger->file_data = NULL;
logger->masking = APT_LOG_MASKING_NONE;
return logger;
}
APT_DECLARE(apt_bool_t) apt_log_instance_create(apt_log_output_e mode, apt_log_priority_e priority, apr_pool_t *pool)
{
if(apt_logger) {
return FALSE;
}
apt_logger = apr_palloc(pool,sizeof(apt_logger_t));
apt_logger = apt_log_instance_alloc(pool);
apt_logger->mode = mode;
apt_logger->priority = priority;
apt_logger->header = APT_LOG_HEADER_DEFAULT;
apt_logger->ext_handler = NULL;
apt_logger->file_data = NULL;
return TRUE;
}
APT_DECLARE(apt_bool_t) apt_log_instance_load(const char *config_file, apr_pool_t *pool)
{
apr_xml_doc *doc;
const apr_xml_elem *elem;
const apr_xml_elem *root;
char *text;
if(apt_logger) {
return FALSE;
}
apt_logger = apt_log_instance_alloc(pool);
/* Parse XML document */
doc = apt_log_doc_parse(config_file,pool);
if(!doc) {
return FALSE;
}
root = doc->root;
/* Match document name */
if(!root || strcasecmp(root->name,"aptlogger") != 0) {
/* Unknown document */
return FALSE;
}
/* Navigate through document */
for(elem = root->first_child; elem; elem = elem->next) {
if(!elem->first_cdata.first || !elem->first_cdata.first->text)
continue;
text = apr_pstrdup(pool,elem->first_cdata.first->text);
apr_collapse_spaces(text,text);
if(strcasecmp(elem->name,"priority") == 0) {
apt_logger->priority = apt_log_priority_translate(text);
}
else if(strcasecmp(elem->name,"output") == 0) {
apt_logger->mode = apt_log_output_mode_translate(text);
}
else if(strcasecmp(elem->name,"headers") == 0) {
apt_logger->header = apt_log_header_translate(text);
}
else if(strcasecmp(elem->name,"masking") == 0) {
apt_logger->masking = apt_log_masking_translate(text);
}
else {
/* Unknown element */
}
}
return TRUE;
}
@ -104,7 +174,13 @@ APT_DECLARE(apt_bool_t) apt_log_instance_set(apt_logger_t *logger)
return TRUE;
}
APT_DECLARE(apt_bool_t) apt_log_file_open(const char *dir_path, const char *file_name, apr_size_t max_file_size, apr_size_t max_file_count, apr_pool_t *pool)
APT_DECLARE(apt_bool_t) apt_log_file_open(
const char *dir_path,
const char *file_name,
apr_size_t max_file_size,
apr_size_t max_file_count,
apt_bool_t append,
apr_pool_t *pool)
{
const char *log_file_path;
apt_log_file_data_t *file_data;
@ -117,29 +193,55 @@ APT_DECLARE(apt_bool_t) apt_log_file_open(const char *dir_path, const char *file
}
file_data = apr_palloc(pool,sizeof(apt_log_file_data_t));
file_data->log_dir_path = dir_path;
file_data->log_file_name = file_name;
file_data->log_dir_path = apr_pstrdup(pool,dir_path);
file_data->log_file_name = apr_pstrdup(pool,file_name);
file_data->cur_file_index = 0;
file_data->cur_size = 0;
file_data->max_file_count = max_file_count;
file_data->max_size = max_file_size;
file_data->append = append;
file_data->mutex = NULL;
file_data->pool = pool;
if(!file_data->max_size) {
file_data->max_file_count = MAX_LOG_FILE_SIZE;
file_data->max_size = MAX_LOG_FILE_SIZE;
}
if(!file_data->max_file_count) {
file_data->max_file_count = MAX_LOG_FILE_COUNT;
}
if(file_data->append == TRUE) {
/* iteratively find the last created file */
while(file_data->cur_file_index<file_data->max_file_count)
{
if(apt_log_file_exist(file_data) == 0)
{
if(file_data->cur_file_index > 0)
file_data->cur_file_index--;
file_data->cur_size = apt_log_file_get_size(file_data);
break;
}
file_data->cur_file_index++;
}
/* if all the files have been created start rewriting from beginning */
if(file_data->cur_file_index>=file_data->max_file_count)
{
file_data->cur_file_index=0;
file_data->cur_size=0;
log_file_path = apt_log_file_path_make(file_data);
file_data->file = fopen(log_file_path,"wb"); /* truncate the first file to zero length */
fclose(file_data->file);
}
}
/* create mutex */
if(apr_thread_mutex_create(&file_data->mutex,APR_THREAD_MUTEX_DEFAULT,pool) != APR_SUCCESS) {
return FALSE;
}
/* open log file */
log_file_path = apt_log_file_path_make(file_data);
file_data->file = fopen(log_file_path,"wb");
file_data->file = fopen(log_file_path,file_data->append == TRUE ? "ab" : "wb");
if(!file_data->file) {
apr_thread_mutex_destroy(file_data->mutex);
return FALSE;
@ -177,6 +279,31 @@ APT_DECLARE(apt_bool_t) apt_log_output_mode_set(apt_log_output_e mode)
return TRUE;
}
APT_DECLARE(apt_bool_t) apt_log_output_mode_check(apt_log_output_e mode)
{
if(!apt_logger) {
return FALSE;
}
return (apt_logger->mode | mode) ? TRUE : FALSE;
}
APT_DECLARE(int) apt_log_output_mode_translate(char *str)
{
int mode = APT_LOG_OUTPUT_NONE;
char *name;
char *last;
name = apr_strtok(str, ",", &last);
while(name) {
if(strcasecmp(name, "CONSOLE") == 0)
mode |= APT_LOG_OUTPUT_CONSOLE;
else if(strcasecmp(name, "FILE") == 0)
mode |= APT_LOG_OUTPUT_FILE;
name = apr_strtok(NULL, ",", &last);
}
return mode;
}
APT_DECLARE(apt_bool_t) apt_log_priority_set(apt_log_priority_e priority)
{
if(!apt_logger || priority >= APT_PRIO_COUNT) {
@ -186,6 +313,28 @@ APT_DECLARE(apt_bool_t) apt_log_priority_set(apt_log_priority_e priority)
return TRUE;
}
APT_DECLARE(apt_log_priority_e) apt_log_priority_translate(const char *str)
{
if(strcasecmp(str, "EMERGENCY") == 0)
return APT_PRIO_EMERGENCY;
else if(strcasecmp(str, "ALERT") == 0)
return APT_PRIO_ALERT;
else if(strcasecmp(str, "CRITICAL") == 0)
return APT_PRIO_CRITICAL;
else if(strcasecmp(str, "ERROR") == 0)
return APT_PRIO_ERROR;
else if(strcasecmp(str, "WARNING") == 0)
return APT_PRIO_WARNING;
else if(strcasecmp(str, "NOTICE") == 0)
return APT_PRIO_NOTICE;
else if(strcasecmp(str, "INFO") == 0)
return APT_PRIO_INFO;
else if(strcasecmp(str, "DEBUG") == 0)
return APT_PRIO_DEBUG;
return APT_PRIO_DEBUG;
}
APT_DECLARE(apt_bool_t) apt_log_header_set(int header)
{
if(!apt_logger) {
@ -195,6 +344,69 @@ APT_DECLARE(apt_bool_t) apt_log_header_set(int header)
return TRUE;
}
APT_DECLARE(int) apt_log_header_translate(char *str)
{
int header = APT_LOG_OUTPUT_NONE;
char *name;
char *last;
name = apr_strtok(str, ",", &last);
while(name) {
if(strcasecmp(name, "DATE") == 0)
header |= APT_LOG_HEADER_DATE;
else if(strcasecmp(name, "TIME") == 0)
header |= APT_LOG_HEADER_TIME;
else if(strcasecmp(name, "PRIORITY") == 0)
header |= APT_LOG_HEADER_PRIORITY;
else if(strcasecmp(name, "MARK") == 0)
header |= APT_LOG_HEADER_MARK;
else if(strcasecmp(name, "THREAD") == 0)
header |= APT_LOG_HEADER_THREAD;
name = apr_strtok(NULL, ",", &last);
}
return header;
}
APT_DECLARE(apt_bool_t) apt_log_masking_set(apt_log_masking_e masking)
{
if(!apt_logger) {
return FALSE;
}
apt_logger->masking = masking;
return TRUE;
}
APT_DECLARE(apt_log_masking_e) apt_log_masking_get()
{
if(!apt_logger) {
return APT_LOG_MASKING_NONE;
}
return apt_logger->masking;
}
APT_DECLARE(apt_log_masking_e) apt_log_masking_translate(const char *str)
{
if(strcasecmp(str, "COMPLETE") == 0)
return APT_LOG_MASKING_COMPLETE;
else if(strcasecmp(str, "ENCRYPTED") == 0)
return APT_LOG_MASKING_ENCRYPTED;
return APT_LOG_MASKING_NONE;
}
#define APT_MASKED_CONTENT "*** masked ***"
APT_DECLARE(const char*) apt_log_data_mask(const char *data_in, apr_size_t *length, apr_pool_t *pool)
{
if(!apt_logger) {
return NULL;
}
if(apt_logger->masking == APT_LOG_MASKING_COMPLETE) {
*length = sizeof(APT_MASKED_CONTENT) - 1;
return APT_MASKED_CONTENT;
}
return data_in;
}
APT_DECLARE(apt_bool_t) apt_log_ext_handler_set(apt_log_ext_handler_f handler)
{
if(!apt_logger) {
@ -224,6 +436,35 @@ APT_DECLARE(apt_bool_t) apt_log(const char *file, int line, apt_log_priority_e p
return status;
}
APT_DECLARE(apt_bool_t) apt_obj_log(const char *file, int line, apt_log_priority_e priority, void *obj, const char *format, ...)
{
apt_bool_t status = TRUE;
if(!apt_logger) {
return FALSE;
}
if(priority <= apt_logger->priority) {
va_list arg_ptr;
va_start(arg_ptr, format);
if(apt_logger->ext_handler) {
status = apt_logger->ext_handler(file,line,obj,priority,format,arg_ptr);
}
else {
status = apt_do_log(file,line,priority,format,arg_ptr);
}
va_end(arg_ptr);
}
return status;
}
static APR_INLINE unsigned long apt_thread_id_get()
{
#ifdef WIN32
return (unsigned long) GetCurrentThreadId();
#else
return (unsigned long) apr_os_thread_current();
#endif
}
static apt_bool_t apt_do_log(const char *file, int line, apt_log_priority_e priority, const char *format, va_list arg_ptr)
{
char log_entry[MAX_LOG_ENTRY_SIZE];
@ -249,6 +490,9 @@ static apt_bool_t apt_do_log(const char *file, int line, apt_log_priority_e prio
if(apt_logger->header & APT_LOG_HEADER_MARK) {
offset += apr_snprintf(log_entry+offset,max_size-offset,"%s:%03d ",file,line);
}
if(apt_logger->header & APT_LOG_HEADER_THREAD) {
offset += apr_snprintf(log_entry+offset,max_size-offset,"%05lu ",apt_thread_id_get());
}
if(apt_logger->header & APT_LOG_HEADER_PRIORITY) {
memcpy(log_entry+offset,priority_snames[priority],MAX_PRIORITY_NAME_LENGTH);
offset += MAX_PRIORITY_NAME_LENGTH;
@ -275,6 +519,40 @@ static const char* apt_log_file_path_make(apt_log_file_data_t *file_data)
return log_file_path;
}
static apr_size_t apt_log_file_get_size(apt_log_file_data_t *file_data)
{
FILE* fp;
const char *log_file_path;
apr_size_t ret;
log_file_path = apt_log_file_path_make(file_data);
fp = fopen(log_file_path,"rb");
if(!fp) return 0;
fseek(fp,0,SEEK_END);
ret = ftell(fp);
fclose(fp);
return ret;
}
static apr_byte_t apt_log_file_exist(apt_log_file_data_t *file_data)
{
FILE* fp;
const char *log_file_path;
log_file_path = apt_log_file_path_make(file_data);
fp = fopen(log_file_path,"rb");
if(!fp) return 0;
fclose(fp);
return 1;
}
static apt_bool_t apt_log_file_dump(apt_log_file_data_t *file_data, const char *log_entry, apr_size_t size)
{
apr_thread_mutex_lock(file_data->mutex);
@ -303,3 +581,24 @@ static apt_bool_t apt_log_file_dump(apt_log_file_data_t *file_data, const char *
apr_thread_mutex_unlock(file_data->mutex);
return TRUE;
}
static apr_xml_doc* apt_log_doc_parse(const char *file_path, apr_pool_t *pool)
{
apr_xml_parser *parser = NULL;
apr_xml_doc *xml_doc = NULL;
apr_file_t *fd = NULL;
apr_status_t rv;
rv = apr_file_open(&fd,file_path,APR_READ|APR_BINARY,0,pool);
if(rv != APR_SUCCESS) {
return NULL;
}
rv = apr_xml_parse_file(pool,&parser,&xml_doc,fd,2000);
if(rv != APR_SUCCESS) {
xml_doc = NULL;
}
apr_file_close(fd);
return xml_doc;
}

View File

@ -0,0 +1,312 @@
/*
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_multipart_content.c 1673 2010-04-28 20:45:47Z achaloyan $
*/
#include <stdlib.h>
#include "apt_multipart_content.h"
#include "apt_text_stream.h"
#include "apt_text_message.h"
#define CONTENT_LENGTH_HEADER "Content-Length"
#define CONTENT_TYPE_HEADER "Content-Type"
#define CONTENT_ID_HEADER "Content-Id"
#define DEFAULT_BOUNDARY "break"
#define DEFAULT_HYPHENS "--"
#define DEFAULT_MULTIPART_CONTENT_SIZE 4096
/** Multipart content */
struct apt_multipart_content_t {
apr_pool_t *pool;
apt_text_stream_t stream;
apt_str_t boundary;
apt_str_t hyphens;
};
/** Create an empty multipart content */
APT_DECLARE(apt_multipart_content_t*) apt_multipart_content_create(apr_size_t max_content_size, const apt_str_t *boundary, apr_pool_t *pool)
{
char *buffer;
apt_multipart_content_t *multipart_content = apr_palloc(pool,sizeof(apt_multipart_content_t));
multipart_content->pool = pool;
if(max_content_size == 0) {
max_content_size = DEFAULT_MULTIPART_CONTENT_SIZE;
}
if(boundary) {
multipart_content->boundary = *boundary;
}
else {
multipart_content->boundary.buf = DEFAULT_BOUNDARY;
multipart_content->boundary.length = sizeof(DEFAULT_BOUNDARY)-1;
}
multipart_content->hyphens.buf = DEFAULT_HYPHENS;
multipart_content->hyphens.length = sizeof(DEFAULT_HYPHENS)-1;
buffer = apr_palloc(pool,max_content_size+1);
apt_text_stream_init(&multipart_content->stream,buffer,max_content_size);
return multipart_content;
}
/** Initialize content part generation */
static apt_bool_t apt_multipart_content_initialize(apt_multipart_content_t *multipart_content)
{
/* insert preceding end-of-line */
if(apt_text_eol_insert(&multipart_content->stream) == FALSE) {
return FALSE;
}
/* insert hyphens */
if(apt_text_string_insert(&multipart_content->stream,&multipart_content->hyphens) == FALSE) {
return FALSE;
}
/* insert boundary */
if(apt_text_string_insert(&multipart_content->stream,&multipart_content->boundary) == FALSE) {
return FALSE;
}
return apt_text_eol_insert(&multipart_content->stream);
}
/** Add content part to multipart content */
APT_DECLARE(apt_bool_t) apt_multipart_content_add(apt_multipart_content_t *multipart_content, const apt_content_part_t *content_part)
{
if(!content_part) {
return FALSE;
}
/* insert preceding eol, hyppens and boudnary */
if(apt_multipart_content_initialize(multipart_content) == FALSE) {
return FALSE;
}
/* insert header fields */
if(apt_header_section_generate(&content_part->header,&multipart_content->stream) == FALSE) {
return FALSE;
}
/* insert body */
return apt_text_string_insert(&multipart_content->stream,&content_part->body);
}
/** Add content part to multipart content by specified header fields and body */
APT_DECLARE(apt_bool_t) apt_multipart_content_add2(apt_multipart_content_t *multipart_content, const apt_str_t *content_type, const apt_str_t *content_id, const apt_str_t *body)
{
/* insert preceding eol, hyppens and boudnary */
if(apt_multipart_content_initialize(multipart_content) == FALSE) {
return FALSE;
}
/* insert content-type */
if(content_type) {
apt_str_t name = {CONTENT_TYPE_HEADER,sizeof(CONTENT_TYPE_HEADER)-1};
if(apt_text_name_value_insert(&multipart_content->stream,&name,content_type) == FALSE) {
return FALSE;
}
}
/* insert content-id */
if(content_id) {
apt_str_t name = {CONTENT_ID_HEADER,sizeof(CONTENT_ID_HEADER)-1};
if(apt_text_name_value_insert(&multipart_content->stream,&name,content_id) == FALSE) {
return FALSE;
}
}
/* insert content-length */
if(body) {
apt_str_t name = {CONTENT_LENGTH_HEADER,sizeof(CONTENT_LENGTH_HEADER)-1};
if(apt_text_header_name_insert(&multipart_content->stream,&name) == FALSE) {
return FALSE;
}
if(apt_text_size_value_insert(&multipart_content->stream,body->length) == FALSE) {
return FALSE;
}
if(apt_text_eol_insert(&multipart_content->stream) == FALSE) {
return FALSE;
}
}
/* insert empty line */
if(apt_text_eol_insert(&multipart_content->stream) == FALSE) {
return FALSE;
}
/* insert body */
if(body) {
if(apt_text_string_insert(&multipart_content->stream,body) == FALSE) {
return FALSE;
}
}
return TRUE;
}
/** Finalize multipart content generation */
APT_DECLARE(apt_str_t*) apt_multipart_content_finalize(apt_multipart_content_t *multipart_content)
{
apt_text_stream_t *stream = &multipart_content->stream;
/* insert preceding end-of-line */
if(apt_text_eol_insert(&multipart_content->stream) == FALSE) {
return NULL;
}
/* insert hyphens */
if(apt_text_string_insert(&multipart_content->stream,&multipart_content->hyphens) == FALSE) {
return NULL;
}
/* insert boundary */
if(apt_text_string_insert(&multipart_content->stream,&multipart_content->boundary) == FALSE) {
return NULL;
}
/* insert final hyphens */
if(apt_text_string_insert(&multipart_content->stream,&multipart_content->hyphens) == FALSE) {
return NULL;
}
if(apt_text_eol_insert(&multipart_content->stream) == FALSE) {
return NULL;
}
stream->text.length = stream->pos - stream->text.buf;
stream->text.buf[stream->text.length] = '\0';
return &stream->text;
}
/** Assign body to multipart content to get (parse) each content part from */
APT_DECLARE(apt_multipart_content_t*) apt_multipart_content_assign(const apt_str_t *body, const apt_str_t *boundary, apr_pool_t *pool)
{
apt_multipart_content_t *multipart_content = apr_palloc(pool,sizeof(apt_multipart_content_t));
multipart_content->pool = pool;
if(!body) {
return FALSE;
}
if(boundary) {
multipart_content->boundary = *boundary;
}
else {
apt_string_reset(&multipart_content->boundary);
}
apt_string_reset(&multipart_content->hyphens);
apt_text_stream_init(&multipart_content->stream,body->buf,body->length);
return multipart_content;
}
static APR_INLINE void apt_content_part_reset(apt_content_part_t *content_part)
{
apt_header_section_init(&content_part->header);
apt_string_reset(&content_part->body);
content_part->type = NULL;
content_part->id = NULL;
content_part->length = NULL;
}
/** Get the next content part */
APT_DECLARE(apt_bool_t) apt_multipart_content_get(apt_multipart_content_t *multipart_content, apt_content_part_t *content_part, apt_bool_t *is_final)
{
apt_str_t boundary;
apt_header_field_t *header_field;
apt_text_stream_t *stream = &multipart_content->stream;
if(!content_part || !is_final) {
return FALSE;
}
*is_final = FALSE;
apt_content_part_reset(content_part);
/* skip preamble */
apt_text_skip_to_char(stream,'-');
if(apt_text_is_eos(stream) == TRUE) {
return FALSE;
}
/* skip initial hyphens */
apt_text_chars_skip(stream,'-');
if(apt_text_is_eos(stream) == TRUE) {
return FALSE;
}
/* read line and the boundary */
if(apt_text_line_read(stream,&boundary) == FALSE) {
return FALSE;
}
/* remove optional trailing spaces */
while(boundary.length && boundary.buf[boundary.length-1] == APT_TOKEN_SP) boundary.length--;
/* check whether this is the final boundary */
if(boundary.length >= 2) {
if(boundary.buf[boundary.length-1] == '-' && boundary.buf[boundary.length-2] == '-') {
/* final boundary */
boundary.length -= 2;
*is_final = TRUE;
}
}
/* compare boundaries */
if(apt_string_is_empty(&multipart_content->boundary) == TRUE) {
/* no boundary was specified from user space,
learn boundary from the content */
multipart_content->boundary = boundary;
}
else {
if(apt_string_compare(&multipart_content->boundary,&boundary) == FALSE) {
/* invalid boundary */
return FALSE;
}
}
if(*is_final == TRUE) {
/* final boundary => return TRUE, content remains empty */
return TRUE;
}
/* read header fields */
if(apt_header_section_parse(&content_part->header,stream,multipart_content->pool) == FALSE) {
return FALSE;
}
for(header_field = APR_RING_FIRST(&content_part->header.ring);
header_field != APR_RING_SENTINEL(&content_part->header.ring, apt_header_field_t, link);
header_field = APR_RING_NEXT(header_field, link)) {
if(strncmp(header_field->name.buf,CONTENT_LENGTH_HEADER,header_field->name.length) == 0) {
content_part->length = &header_field->value;
}
else if(strncmp(header_field->name.buf,CONTENT_TYPE_HEADER,header_field->name.length) == 0) {
content_part->type = &header_field->value;
}
else if(strncmp(header_field->name.buf,CONTENT_ID_HEADER,header_field->name.length) == 0) {
content_part->id = &header_field->value;
}
}
if(content_part->length && apt_string_is_empty(content_part->length) == FALSE) {
apr_size_t length = atoi(content_part->length->buf);
if(length + stream->pos > stream->end) {
return FALSE;
}
/* read content */
apt_string_assign_n(&content_part->body,stream->pos,length,multipart_content->pool);
stream->pos += length;
}
return TRUE;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_net.c 1474 2010-02-07 20:51:47Z achaloyan $
*/
#include <apr_network_io.h>

View File

@ -1,322 +0,0 @@
/*
* Copyright 2008 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apt_net_client_task.h"
#include "apt_task.h"
#include "apt_pool.h"
#include "apt_pollset.h"
#include "apt_cyclic_queue.h"
#include "apt_log.h"
/** Network client task */
struct apt_net_client_task_t {
apr_pool_t *pool;
apt_task_t *base;
void *obj;
apr_size_t max_connection_count;
apr_thread_mutex_t *guard;
apt_cyclic_queue_t *msg_queue;
apt_pollset_t *pollset;
const apt_net_client_vtable_t *client_vtable;
};
static apt_bool_t apt_net_client_task_msg_signal(apt_task_t *task, apt_task_msg_t *msg);
static apt_bool_t apt_net_client_task_run(apt_task_t *task);
static apt_bool_t apt_net_client_task_on_destroy(apt_task_t *task);
/** Create connection task */
APT_DECLARE(apt_net_client_task_t*) apt_net_client_task_create(
apr_size_t max_connection_count,
void *obj,
const apt_net_client_vtable_t *client_vtable,
apt_task_msg_pool_t *msg_pool,
apr_pool_t *pool)
{
apt_task_vtable_t *vtable;
apt_net_client_task_t *task;
task = apr_palloc(pool,sizeof(apt_net_client_task_t));
task->pool = pool;
task->obj = obj;
task->pollset = NULL;
task->max_connection_count = max_connection_count;
if(!client_vtable || !client_vtable->on_receive) {
return NULL;
}
task->client_vtable = client_vtable;
task->base = apt_task_create(task,msg_pool,pool);
if(!task->base) {
return NULL;
}
vtable = apt_task_vtable_get(task->base);
if(vtable) {
vtable->run = apt_net_client_task_run;
vtable->destroy = apt_net_client_task_on_destroy;
vtable->signal_msg = apt_net_client_task_msg_signal;
}
apt_task_auto_ready_set(task->base,FALSE);
task->msg_queue = apt_cyclic_queue_create(CYCLIC_QUEUE_DEFAULT_SIZE);
apr_thread_mutex_create(&task->guard,APR_THREAD_MUTEX_UNNESTED,pool);
return task;
}
/** Virtual destroy handler */
static apt_bool_t apt_net_client_task_on_destroy(apt_task_t *base)
{
apt_net_client_task_t *task = apt_task_object_get(base);
if(task->guard) {
apr_thread_mutex_destroy(task->guard);
task->guard = NULL;
}
if(task->msg_queue) {
apt_cyclic_queue_destroy(task->msg_queue);
task->msg_queue = NULL;
}
return TRUE;
}
/** Destroy connection task. */
APT_DECLARE(apt_bool_t) apt_net_client_task_destroy(apt_net_client_task_t *task)
{
return apt_task_destroy(task->base);
}
/** Start connection task. */
APT_DECLARE(apt_bool_t) apt_net_client_task_start(apt_net_client_task_t *task)
{
return apt_task_start(task->base);
}
/** Terminate connection task. */
APT_DECLARE(apt_bool_t) apt_net_client_task_terminate(apt_net_client_task_t *task)
{
return apt_task_terminate(task->base,TRUE);
}
/** Get task */
APT_DECLARE(apt_task_t*) apt_net_client_task_base_get(apt_net_client_task_t *task)
{
return task->base;
}
/** Get task vtable */
APT_DECLARE(apt_task_vtable_t*) apt_net_client_task_vtable_get(apt_net_client_task_t *task)
{
return apt_task_vtable_get(task->base);
}
/** Get external object */
APT_DECLARE(void*) apt_net_client_task_object_get(apt_net_client_task_t *task)
{
return task->obj;
}
/** Create connection */
APT_DECLARE(apt_net_client_connection_t*) apt_net_client_connect(apt_net_client_task_t *task, const char *ip, apr_port_t port)
{
char *local_ip = NULL;
char *remote_ip = NULL;
apr_sockaddr_t *l_sockaddr = NULL;
apr_sockaddr_t *r_sockaddr = NULL;
apt_net_client_connection_t *connection;
apr_pool_t *pool = apt_pool_create();
if(!pool) {
return NULL;
}
connection = apr_palloc(pool,sizeof(apt_net_client_connection_t));
connection->pool = pool;
connection->obj = NULL;
connection->sock = NULL;
if(apr_sockaddr_info_get(&r_sockaddr,ip,APR_INET,port,0,connection->pool) != APR_SUCCESS) {
apr_pool_destroy(pool);
return NULL;
}
if(apr_socket_create(&connection->sock,r_sockaddr->family,SOCK_STREAM,APR_PROTO_TCP,connection->pool) != APR_SUCCESS) {
apr_pool_destroy(pool);
return NULL;
}
apr_socket_opt_set(connection->sock, APR_SO_NONBLOCK, 0);
apr_socket_timeout_set(connection->sock, -1);
apr_socket_opt_set(connection->sock, APR_SO_REUSEADDR, 1);
if(apr_socket_connect(connection->sock,r_sockaddr) != APR_SUCCESS) {
apr_socket_close(connection->sock);
apr_pool_destroy(pool);
return NULL;
}
if(apr_socket_addr_get(&l_sockaddr,APR_LOCAL,connection->sock) != APR_SUCCESS) {
apr_socket_close(connection->sock);
apr_pool_destroy(pool);
return NULL;
}
apr_sockaddr_ip_get(&local_ip,l_sockaddr);
apr_sockaddr_ip_get(&remote_ip,r_sockaddr);
connection->id = apr_psprintf(pool,"%s:%hu <-> %s:%hu",
local_ip,l_sockaddr->port,
remote_ip,r_sockaddr->port);
memset(&connection->sock_pfd,0,sizeof(apr_pollfd_t));
connection->sock_pfd.desc_type = APR_POLL_SOCKET;
connection->sock_pfd.reqevents = APR_POLLIN;
connection->sock_pfd.desc.s = connection->sock;
connection->sock_pfd.client_data = connection;
if(apt_pollset_add(task->pollset,&connection->sock_pfd) != TRUE) {
apr_socket_close(connection->sock);
apr_pool_destroy(pool);
return NULL;
}
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Established TCP Connection %s",connection->id);
return connection;
}
/** Close connection */
APT_DECLARE(apt_bool_t) apt_net_client_connection_close(apt_net_client_task_t *task, apt_net_client_connection_t *connection)
{
if(connection->sock) {
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Close TCP Connection %s",connection->id);
apt_pollset_remove(task->pollset,&connection->sock_pfd);
apr_socket_close(connection->sock);
connection->sock = NULL;
}
return TRUE;
}
/** Close and destroy connection */
APT_DECLARE(apt_bool_t) apt_net_client_disconnect(apt_net_client_task_t *task, apt_net_client_connection_t *connection)
{
apt_net_client_connection_close(task,connection);
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Destroy TCP Connection %s",connection->id);
apr_pool_destroy(connection->pool);
return TRUE;
}
/** Create the pollset */
static apt_bool_t apt_net_client_task_pollset_create(apt_net_client_task_t *task)
{
/* create pollset */
task->pollset = apt_pollset_create((apr_uint32_t)task->max_connection_count, task->pool);
if(!task->pollset) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Pollset");
return FALSE;
}
return TRUE;
}
/** Destroy the pollset */
static void apt_net_client_task_pollset_destroy(apt_net_client_task_t *task)
{
if(task->pollset) {
apt_pollset_destroy(task->pollset);
task->pollset = NULL;
}
}
static apt_bool_t apt_net_client_task_process(apt_net_client_task_t *task)
{
apt_bool_t status = TRUE;
apt_bool_t running = TRUE;
apt_task_msg_t *msg;
do {
apr_thread_mutex_lock(task->guard);
msg = apt_cyclic_queue_pop(task->msg_queue);
apr_thread_mutex_unlock(task->guard);
if(msg) {
status = apt_task_msg_process(task->base,msg);
}
else {
running = FALSE;
}
}
while(running == TRUE);
return status;
}
static apt_bool_t apt_net_client_task_run(apt_task_t *base)
{
apt_net_client_task_t *task = apt_task_object_get(base);
apt_bool_t running = TRUE;
apr_status_t status;
apr_int32_t num;
const apr_pollfd_t *ret_pfd;
int i;
if(!task) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Start Network Client Task");
return FALSE;
}
if(apt_net_client_task_pollset_create(task) == FALSE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Pollset");
return FALSE;
}
/* explicitly indicate task is ready to process messages */
apt_task_ready(task->base);
while(running) {
status = apt_pollset_poll(task->pollset, -1, &num, &ret_pfd);
if(status != APR_SUCCESS) {
continue;
}
for(i = 0; i < num; i++) {
if(apt_pollset_is_wakeup(task->pollset,&ret_pfd[i])) {
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Process Control Message");
if(apt_net_client_task_process(task) == FALSE) {
running = FALSE;
break;
}
continue;
}
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Process Message");
task->client_vtable->on_receive(task,ret_pfd[i].client_data);
}
}
apt_net_client_task_pollset_destroy(task);
return TRUE;
}
static apt_bool_t apt_net_client_task_msg_signal(apt_task_t *base, apt_task_msg_t *msg)
{
apt_bool_t status;
apt_net_client_task_t *task = apt_task_object_get(base);
apr_thread_mutex_lock(task->guard);
status = apt_cyclic_queue_push(task->msg_queue,msg);
apr_thread_mutex_unlock(task->guard);
if(apt_pollset_wakeup(task->pollset) != TRUE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Signal Control Message");
status = FALSE;
}
return status;
}

View File

@ -1,393 +0,0 @@
/*
* Copyright 2008 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "apt_net_server_task.h"
#include "apt_task.h"
#include "apt_pool.h"
#include "apt_pollset.h"
#include "apt_cyclic_queue.h"
#include "apt_log.h"
/** Network server task */
struct apt_net_server_task_t {
apr_pool_t *pool;
apt_task_t *base;
void *obj;
apr_size_t max_connection_count;
apr_thread_mutex_t *guard;
apt_cyclic_queue_t *msg_queue;
apt_pollset_t *pollset;
/* Listening socket descriptor */
apr_sockaddr_t *sockaddr;
apr_socket_t *listen_sock;
apr_pollfd_t listen_sock_pfd;
const apt_net_server_vtable_t *server_vtable;
};
static apt_bool_t apt_net_server_task_msg_signal(apt_task_t *task, apt_task_msg_t *msg);
static apt_bool_t apt_net_server_task_run(apt_task_t *task);
static apt_bool_t apt_net_server_task_on_destroy(apt_task_t *task);
/** Create connection task */
APT_DECLARE(apt_net_server_task_t*) apt_net_server_task_create(
const char *listen_ip,
apr_port_t listen_port,
apr_size_t max_connection_count,
void *obj,
const apt_net_server_vtable_t *server_vtable,
apt_task_msg_pool_t *msg_pool,
apr_pool_t *pool)
{
apt_task_vtable_t *vtable;
apt_net_server_task_t *task;
task = apr_palloc(pool,sizeof(apt_net_server_task_t));
task->pool = pool;
task->obj = obj;
task->sockaddr = NULL;
task->listen_sock = NULL;
task->pollset = NULL;
task->max_connection_count = max_connection_count;
apr_sockaddr_info_get(&task->sockaddr,listen_ip,APR_INET,listen_port,0,task->pool);
if(!task->sockaddr) {
return NULL;
}
if(!server_vtable || !server_vtable->on_connect ||
!server_vtable->on_disconnect || !server_vtable->on_receive) {
return NULL;
}
task->server_vtable = server_vtable;
task->base = apt_task_create(task,msg_pool,pool);
if(!task->base) {
return NULL;
}
vtable = apt_task_vtable_get(task->base);
if(vtable) {
vtable->run = apt_net_server_task_run;
vtable->destroy = apt_net_server_task_on_destroy;
vtable->signal_msg = apt_net_server_task_msg_signal;
}
apt_task_auto_ready_set(task->base,FALSE);
task->msg_queue = apt_cyclic_queue_create(CYCLIC_QUEUE_DEFAULT_SIZE);
apr_thread_mutex_create(&task->guard,APR_THREAD_MUTEX_UNNESTED,pool);
return task;
}
/** Virtual destroy handler */
static apt_bool_t apt_net_server_task_on_destroy(apt_task_t *base)
{
apt_net_server_task_t *task = apt_task_object_get(base);
if(task->guard) {
apr_thread_mutex_destroy(task->guard);
task->guard = NULL;
}
if(task->msg_queue) {
apt_cyclic_queue_destroy(task->msg_queue);
task->msg_queue = NULL;
}
return TRUE;
}
/** Destroy connection task. */
APT_DECLARE(apt_bool_t) apt_net_server_task_destroy(apt_net_server_task_t *task)
{
return apt_task_destroy(task->base);
}
/** Start connection task. */
APT_DECLARE(apt_bool_t) apt_net_server_task_start(apt_net_server_task_t *task)
{
return apt_task_start(task->base);
}
/** Terminate connection task. */
APT_DECLARE(apt_bool_t) apt_net_server_task_terminate(apt_net_server_task_t *task)
{
return apt_task_terminate(task->base,TRUE);
}
/** Get task */
APT_DECLARE(apt_task_t*) apt_net_server_task_base_get(apt_net_server_task_t *task)
{
return task->base;
}
/** Get task vtable */
APT_DECLARE(apt_task_vtable_t*) apt_net_server_task_vtable_get(apt_net_server_task_t *task)
{
return apt_task_vtable_get(task->base);
}
/** Get external object */
APT_DECLARE(void*) apt_net_server_task_object_get(apt_net_server_task_t *task)
{
return task->obj;
}
/** Create listening socket and add to pollset */
static apt_bool_t apt_net_server_task_listen_socket_create(apt_net_server_task_t *task)
{
apr_status_t status;
if(!task->sockaddr) {
return FALSE;
}
/* create listening socket */
status = apr_socket_create(&task->listen_sock, task->sockaddr->family, SOCK_STREAM, APR_PROTO_TCP, task->pool);
if(status != APR_SUCCESS) {
return FALSE;
}
apr_socket_opt_set(task->listen_sock, APR_SO_NONBLOCK, 0);
apr_socket_timeout_set(task->listen_sock, -1);
apr_socket_opt_set(task->listen_sock, APR_SO_REUSEADDR, 1);
status = apr_socket_bind(task->listen_sock, task->sockaddr);
if(status != APR_SUCCESS) {
apr_socket_close(task->listen_sock);
task->listen_sock = NULL;
return FALSE;
}
status = apr_socket_listen(task->listen_sock, SOMAXCONN);
if(status != APR_SUCCESS) {
apr_socket_close(task->listen_sock);
task->listen_sock = NULL;
return FALSE;
}
memset(&task->listen_sock_pfd,0,sizeof(apr_pollfd_t));
task->listen_sock_pfd.desc_type = APR_POLL_SOCKET;
task->listen_sock_pfd.reqevents = APR_POLLIN;
task->listen_sock_pfd.desc.s = task->listen_sock;
task->listen_sock_pfd.client_data = task->listen_sock;
if(apt_pollset_add(task->pollset, &task->listen_sock_pfd) != TRUE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Add Listen Socket to Pollset");
apr_socket_close(task->listen_sock);
task->listen_sock = NULL;
}
return TRUE;
}
/** Remove from pollset and destroy listening socket */
static void apt_net_server_task_listen_socket_destroy(apt_net_server_task_t *task)
{
apt_pollset_remove(task->pollset,&task->listen_sock_pfd);
if(task->listen_sock) {
apr_socket_close(task->listen_sock);
task->listen_sock = NULL;
}
}
/** Create the pollset */
static apt_bool_t apt_net_server_task_pollset_create(apt_net_server_task_t *task)
{
/* create pollset */
task->pollset = apt_pollset_create((apr_uint32_t)task->max_connection_count + 1, task->pool);
if(!task->pollset) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Pollset");
return FALSE;
}
/* create listening socket */
if(apt_net_server_task_listen_socket_create(task) != TRUE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Listen Socket");
}
return TRUE;
}
/** Destroy the pollset */
static void apt_net_server_task_pollset_destroy(apt_net_server_task_t *task)
{
apt_net_server_task_listen_socket_destroy(task);
if(task->pollset) {
apt_pollset_destroy(task->pollset);
task->pollset = NULL;
}
}
static apt_bool_t apt_net_server_task_process(apt_net_server_task_t *task)
{
apt_bool_t status = TRUE;
apt_bool_t running = TRUE;
apt_task_msg_t *msg;
do {
apr_thread_mutex_lock(task->guard);
msg = apt_cyclic_queue_pop(task->msg_queue);
apr_thread_mutex_unlock(task->guard);
if(msg) {
status = apt_task_msg_process(task->base,msg);
}
else {
running = FALSE;
}
}
while(running == TRUE);
return status;
}
static apt_bool_t apt_net_server_task_accept(apt_net_server_task_t *task)
{
char *local_ip = NULL;
char *remote_ip = NULL;
apr_sockaddr_t *l_sockaddr = NULL;
apr_sockaddr_t *r_sockaddr = NULL;
apt_net_server_connection_t *connection;
apr_pool_t *pool = apt_pool_create();
if(!pool) {
return FALSE;
}
connection = apr_palloc(pool,sizeof(apt_net_server_connection_t));
connection->pool = pool;
connection->obj = NULL;
connection->sock = NULL;
connection->client_ip = NULL;
if(apr_socket_accept(&connection->sock,task->listen_sock,connection->pool) != APR_SUCCESS) {
apr_pool_destroy(pool);
return FALSE;
}
if(apr_socket_addr_get(&l_sockaddr,APR_LOCAL,connection->sock) != APR_SUCCESS ||
apr_socket_addr_get(&r_sockaddr,APR_REMOTE,connection->sock) != APR_SUCCESS) {
apr_pool_destroy(pool);
return FALSE;
}
apr_sockaddr_ip_get(&local_ip,l_sockaddr);
apr_sockaddr_ip_get(&remote_ip,r_sockaddr);
connection->client_ip = remote_ip;
connection->id = apr_psprintf(pool,"%s:%hu <-> %s:%hu",
local_ip,l_sockaddr->port,
remote_ip,r_sockaddr->port);
memset(&connection->sock_pfd,0,sizeof(apr_pollfd_t));
connection->sock_pfd.desc_type = APR_POLL_SOCKET;
connection->sock_pfd.reqevents = APR_POLLIN;
connection->sock_pfd.desc.s = connection->sock;
connection->sock_pfd.client_data = connection;
if(apt_pollset_add(task->pollset,&connection->sock_pfd) != TRUE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Add to Pollset");
apr_socket_close(connection->sock);
apr_pool_destroy(pool);
return FALSE;
}
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Accepted TCP Connection %s",connection->id);
task->server_vtable->on_connect(task,connection);
return TRUE;
}
static apt_bool_t apt_net_server_task_run(apt_task_t *base)
{
apt_net_server_task_t *task = apt_task_object_get(base);
apt_bool_t running = TRUE;
apr_status_t status;
apr_int32_t num;
const apr_pollfd_t *ret_pfd;
int i;
if(!task) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Start Network Server Task");
return FALSE;
}
if(apt_net_server_task_pollset_create(task) == FALSE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Create Pollset");
return FALSE;
}
/* explicitly indicate task is ready to process messages */
apt_task_ready(task->base);
while(running) {
status = apt_pollset_poll(task->pollset, -1, &num, &ret_pfd);
if(status != APR_SUCCESS) {
continue;
}
for(i = 0; i < num; i++) {
if(ret_pfd[i].desc.s == task->listen_sock) {
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Accept Connection");
apt_net_server_task_accept(task);
continue;
}
if(apt_pollset_is_wakeup(task->pollset,&ret_pfd[i])) {
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Process Control Message");
if(apt_net_server_task_process(task) == FALSE) {
running = FALSE;
break;
}
continue;
}
apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Process Message");
task->server_vtable->on_receive(task,ret_pfd[i].client_data);
}
}
apt_net_server_task_pollset_destroy(task);
return TRUE;
}
static apt_bool_t apt_net_server_task_msg_signal(apt_task_t *base, apt_task_msg_t *msg)
{
apt_bool_t status;
apt_net_server_task_t *task = apt_task_object_get(base);
apr_thread_mutex_lock(task->guard);
status = apt_cyclic_queue_push(task->msg_queue,msg);
apr_thread_mutex_unlock(task->guard);
if(apt_pollset_wakeup(task->pollset) != TRUE) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to Signal Control Message");
status = FALSE;
}
return status;
}
/** Close connection */
APT_DECLARE(apt_bool_t) apt_net_server_connection_close(apt_net_server_task_t *task, apt_net_server_connection_t *connection)
{
if(connection->sock) {
apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Close TCP Connection %s",connection->id);
apt_pollset_remove(task->pollset,&connection->sock_pfd);
apr_socket_close(connection->sock);
connection->sock = NULL;
task->server_vtable->on_disconnect(task,connection);
}
return TRUE;
}
/** Destroy connection */
APT_DECLARE(void) apt_net_server_connection_destroy(apt_net_server_connection_t *connection)
{
apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Destroy TCP Connection %s",connection->id);
apr_pool_destroy(connection->pool);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,9 +12,12 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_nlsml_doc.c 1655 2010-04-16 18:36:27Z achaloyan $
*/
#include "apt_nlsml_doc.h"
#include "apt_log.h"
/** Load NLSML document */
APT_DECLARE(apr_xml_doc*) nlsml_doc_load(const apt_str_t *data, apr_pool_t *pool)
@ -26,21 +29,25 @@ APT_DECLARE(apr_xml_doc*) nlsml_doc_load(const apt_str_t *data, apr_pool_t *pool
/* create XML parser */
parser = apr_xml_parser_create(pool);
if(apr_xml_parser_feed(parser,data->buf,data->length) != APR_SUCCESS) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to feed NLSML input to the parser");
return NULL;
}
/* done with XML tree creation */
if(apr_xml_parser_done(parser,&doc) != APR_SUCCESS) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Failed to terminate NLSML parsing");
return NULL;
}
if(!doc || !doc->root) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"No NLSML root element");
return NULL;
}
root = doc->root;
/* NLSML validity check: root element must be <result> */
if(strcmp(root->name,"result") != 0) {
apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unexpected NLSML root element <%s>",root->name);
return NULL;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_obj_list.c 1708 2010-05-24 17:03:25Z achaloyan $
*/
#ifdef WIN32
@ -65,7 +67,7 @@ APT_DECLARE(void*) apt_list_pop_front(apt_obj_list_t *list)
return elem->obj;
}
APT_DECLARE(void*) apt_list_head(apt_obj_list_t *list)
APT_DECLARE(void*) apt_list_head(const apt_obj_list_t *list)
{
apt_list_elem_t *elem;
if(APR_RING_EMPTY(&list->head,apt_list_elem_t,link)) {
@ -75,7 +77,7 @@ APT_DECLARE(void*) apt_list_head(apt_obj_list_t *list)
return elem->obj;
}
APT_DECLARE(void*) apt_obj_list_tail(apt_obj_list_t *list)
APT_DECLARE(void*) apt_obj_list_tail(const apt_obj_list_t *list)
{
apt_list_elem_t *elem;
if(APR_RING_EMPTY(&list->head,apt_list_elem_t,link)) {
@ -85,7 +87,7 @@ APT_DECLARE(void*) apt_obj_list_tail(apt_obj_list_t *list)
return elem->obj;
}
APT_DECLARE(apt_list_elem_t*) apt_list_first_elem_get(apt_obj_list_t *list)
APT_DECLARE(apt_list_elem_t*) apt_list_first_elem_get(const apt_obj_list_t *list)
{
if(APR_RING_EMPTY(&list->head,apt_list_elem_t,link)) {
return NULL;
@ -93,7 +95,7 @@ APT_DECLARE(apt_list_elem_t*) apt_list_first_elem_get(apt_obj_list_t *list)
return APR_RING_FIRST(&list->head);
}
APT_DECLARE(apt_list_elem_t*) apt_list_last_elem_get(apt_obj_list_t *list)
APT_DECLARE(apt_list_elem_t*) apt_list_last_elem_get(const apt_obj_list_t *list)
{
if(APR_RING_EMPTY(&list->head,apt_list_elem_t,link)) {
return NULL;
@ -101,7 +103,7 @@ APT_DECLARE(apt_list_elem_t*) apt_list_last_elem_get(apt_obj_list_t *list)
return APR_RING_LAST(&list->head);
}
APT_DECLARE(apt_list_elem_t*) apt_list_next_elem_get(apt_obj_list_t *list, apt_list_elem_t *elem)
APT_DECLARE(apt_list_elem_t*) apt_list_next_elem_get(const apt_obj_list_t *list, apt_list_elem_t *elem)
{
apt_list_elem_t *next_elem = APR_RING_NEXT(elem,link);
if(next_elem == APR_RING_SENTINEL(&list->head,apt_list_elem_t,link)) {
@ -110,7 +112,7 @@ APT_DECLARE(apt_list_elem_t*) apt_list_next_elem_get(apt_obj_list_t *list, apt_l
return next_elem;
}
APT_DECLARE(apt_list_elem_t*) apt_list_prev_elem_get(apt_obj_list_t *list, apt_list_elem_t *elem)
APT_DECLARE(apt_list_elem_t*) apt_list_prev_elem_get(const apt_obj_list_t *list, apt_list_elem_t *elem)
{
apt_list_elem_t *prev_elem = APR_RING_PREV(elem,link);
if(prev_elem == APR_RING_SENTINEL(&list->head,apt_list_elem_t,link)) {
@ -137,7 +139,7 @@ APT_DECLARE(apt_list_elem_t*) apt_list_elem_remove(apt_obj_list_t *list, apt_lis
return next_elem;
}
APT_DECLARE(apt_bool_t) apt_list_is_empty(apt_obj_list_t *list)
APT_DECLARE(apt_bool_t) apt_list_is_empty(const apt_obj_list_t *list)
{
if(APR_RING_EMPTY(&list->head,apt_list_elem_t,link)) {
return TRUE;
@ -145,7 +147,7 @@ APT_DECLARE(apt_bool_t) apt_list_is_empty(apt_obj_list_t *list)
return FALSE;
}
APT_DECLARE(void*) apt_list_elem_object_get(apt_list_elem_t *elem)
APT_DECLARE(void*) apt_list_elem_object_get(const apt_list_elem_t *elem)
{
return elem->obj;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2008 Arsen Chaloyan
* Copyright 2008-2010 Arsen Chaloyan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -12,6 +12,8 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* $Id: apt_pair.c 1474 2010-02-07 20:51:47Z achaloyan $
*/
#include "apt_pair.h"

Some files were not shown because too many files have changed in this diff Show More