# FreeSWITCH is trunk is located at ../../
fsdir=../..
set -x
-cp Debug/*.dll $fsdir/Debug/
cp Debug/mod/*.dll $fsdir/Debug/mod/
+cp mod_freetdm/Debug/*.pdb $fsdir/Debug/mod/
+cp Debug/*.dll $fsdir/Debug/
cp Debug/*.pdb $fsdir/Debug/
echo "FRIENDLY REMINDER: RECOMPILE ftmod_wanpipe WHENEVER YOU INSTALL NEW DRIVERS"
set +x
EndProjectSection\r
EndProject\r
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testsangomaboost", "msvc\testboost\testsangomaboost.2008.vcproj", "{0DA69C18-4FA1-4E8C-89CE-12498637C5BE}"\r
+ ProjectSection(ProjectDependencies) = postProject\r
+ {93B8812C-3EC4-4F78-8970-FFBFC99E167D} = {93B8812C-3EC4-4F78-8970-FFBFC99E167D}\r
+ EndProjectSection\r
EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
LinkIncremental="2"
AdditionalLibraryDirectories=""../../../w32/Library/$(OutDir)""
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+ ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
LinkIncremental="1"
AdditionalLibraryDirectories=""../../../w32/Library/$(OutDir)""
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+ ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
LinkIncremental="2"
AdditionalLibraryDirectories=""../../../w32/Library/$(OutDir)""
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+ ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
LinkIncremental="1"
AdditionalLibraryDirectories=""../../../w32/Library/$(OutDir)""
GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)$(TargetName).pdb"
+ ProgramDatabaseFile="$(OutDir)/$(TargetName).pdb"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
}
stream->write_function(stream, "+OK gains set to Rx %f and Tx %f\n", rxgain, txgain);
} else {
+
char *rply = ftdm_api_execute(cmd, NULL);
if (rply) {
stream->write_function(stream, "%s", rply);
- free(rply);
+ ftdm_safe_free(rply);
} else {
stream->write_function(stream, "-ERR Usage: %s\n", FT_SYNTAX);
}
return ptr;
}
+static __inline__ void *ftdm_std_realloc(void *pool, void *buff, ftdm_size_t size)
+{
+ buff = realloc(buff, size);
+ pool = NULL;
+ ftdm_assert_return(buff != NULL, NULL, "Out of memory");
+ return buff;
+}
+
static __inline__ void ftdm_std_free(void *pool, void *ptr)
{
pool = NULL;
/*.pool =*/ NULL,
/*.malloc =*/ ftdm_std_malloc,
/*.calloc =*/ ftdm_std_calloc,
+ /*.realloc =*/ ftdm_std_realloc,
/*.free =*/ ftdm_std_free
};
void *new_data;
new_len = handle->data_size + need + handle->alloc_chunk;
- if ((new_data = realloc(handle->data, new_len))) {
+ if ((new_data = ftdm_realloc(handle->data, new_len))) {
handle->data_size = handle->alloc_len = new_len;
handle->data = new_data;
buf = handle->data;
if (sigmod_iface) {
char *p = strchr(data, ' ');
if (++p) {
- char* mydup = strdup(p);
+ char* mydup = ftdm_strdup(p);
if(sigmod_iface->exec_api == NULL) {
stream->write_function(stream, "%s does not support api functions\n", sigmod_iface->name);
goto done;
if (sigmod_iface->exec_api(stream, mydup) != FTDM_SUCCESS) {
stream->write_function(stream, "-ERR:failed to execute command:%s\n", mydup);
}
- free(mydup);
+ ftdm_safe_free(mydup);
}
goto done;
FT_DECLARE_NONSTD(ftdm_status_t) ftdm_console_stream_write(ftdm_stream_handle_t *handle, const char *fmt, ...);
#define FTDM_CMD_CHUNK_LEN 1024
-#define FTDM_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); s.data = malloc(FTDM_CMD_CHUNK_LEN); \
+#define FTDM_STANDARD_STREAM(s) memset(&s, 0, sizeof(s)); s.data = ftdm_malloc(FTDM_CMD_CHUNK_LEN); \
assert(s.data); \
memset(s.data, 0, FTDM_CMD_CHUNK_LEN); \
s.end = s.data; \
typedef void *(*ftdm_malloc_func_t)(void *pool, ftdm_size_t len);
typedef void *(*ftdm_calloc_func_t)(void *pool, ftdm_size_t elements, ftdm_size_t len);
+typedef void *(*ftdm_realloc_func_t)(void *pool, void *buff, ftdm_size_t len);
typedef void (*ftdm_free_func_t)(void *pool, void *ptr);
typedef struct ftdm_memory_handler {
void *pool;
ftdm_malloc_func_t malloc;
ftdm_calloc_func_t calloc;
+ ftdm_realloc_func_t realloc;
ftdm_free_func_t free;
} ftdm_memory_handler_t;
*/
#define ftdm_malloc(chunksize) g_ftdm_mem_handler.malloc(g_ftdm_mem_handler.pool, chunksize)
+/*!
+ \brief Reallocates memory
+ \command buff the buffer
+ \command chunksize the chunk size
+*/
+#define ftdm_realloc(buff, chunksize) g_ftdm_mem_handler.realloc(g_ftdm_mem_handler.pool, buff, chunksize)
+
/*!
\brief Allocate initialized memory
\command chunksize the chunk size