SAF
Loading...
Searching...
No Matches
os_support.h File Reference

Supported OSs for Speex resampler. More...

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define SPEEX_COPY(dst, src, n)   (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
 Copy n elements from src to dst.
 
#define SPEEX_MOVE(dst, src, n)   (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))
 Copy n elements from src to dst, allowing overlapping regions.
 
#define SPEEX_MEMSET(dst, c, n)   (memset((dst), (c), (n)*sizeof(*(dst))))
 For n elements worth of memory, set every byte to the value of c, starting at address dst.
 
#define speex_fatal(str)   _speex_fatal(str, __FILE__, __LINE__);
 

Functions

static void * speex_alloc (int size)
 Speex wrapper for calloc.
 
static void * speex_alloc_scratch (int size)
 Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem with wideband though)
 
static void * speex_realloc (void *ptr, int size)
 Speex wrapper for realloc.
 
static void speex_free (void *ptr)
 Speex wrapper for calloc.
 
static void speex_free_scratch (void *ptr)
 Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with wideband though)
 
static void _speex_fatal (const char *str, const char *file, int line)
 
static void speex_warning (const char *str)
 
static void speex_warning_int (const char *str, int val)
 
static void speex_notify (const char *str)
 
static void _speex_putc (int ch, void *file)
 Speex wrapper for putc.
 
static void print_vec (float *vec, int len, char *name)
 

Detailed Description

Supported OSs for Speex resampler.

License
BSD 3-Clause

Definition in file os_support.h.

Macro Definition Documentation

◆ SPEEX_COPY

#define SPEEX_COPY ( dst,
src,
n )   (memcpy((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))

Copy n elements from src to dst.

The 0* term provides compile-time type checking

Definition at line 100 of file os_support.h.

◆ speex_fatal

#define speex_fatal ( str)    _speex_fatal(str, __FILE__, __LINE__);

Definition at line 159 of file os_support.h.

◆ SPEEX_MEMSET

#define SPEEX_MEMSET ( dst,
c,
n )   (memset((dst), (c), (n)*sizeof(*(dst))))

For n elements worth of memory, set every byte to the value of c, starting at address dst.

Definition at line 111 of file os_support.h.

◆ SPEEX_MOVE

#define SPEEX_MOVE ( dst,
src,
n )   (memmove((dst), (src), (n)*sizeof(*(dst)) + 0*((dst)-(src)) ))

Copy n elements from src to dst, allowing overlapping regions.

The 0* term provides compile-time type checking

Definition at line 106 of file os_support.h.

Function Documentation

◆ _speex_fatal()

static void _speex_fatal ( const char * str,
const char * file,
int line )
inlinestatic

Definition at line 116 of file os_support.h.

◆ _speex_putc()

static void _speex_putc ( int ch,
void * file )
inlinestatic

Speex wrapper for putc.

Definition at line 152 of file os_support.h.

◆ print_vec()

static void print_vec ( float * vec,
int len,
char * name )
inlinestatic

Definition at line 163 of file os_support.h.

◆ speex_alloc()

static void * speex_alloc ( int size)
inlinestatic

Speex wrapper for calloc.

To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_free NOTE: speex_alloc needs to CLEAR THE MEMORY

Definition at line 56 of file os_support.h.

◆ speex_alloc_scratch()

static void * speex_alloc_scratch ( int size)
inlinestatic

Same as speex_alloc, except that the area is only needed inside a Speex call (might cause problem with wideband though)

Definition at line 67 of file os_support.h.

◆ speex_free()

static void speex_free ( void * ptr)
inlinestatic

Speex wrapper for calloc.

To do your own dynamic allocation, all you need to do is replace this function, speex_realloc and speex_alloc

Definition at line 84 of file os_support.h.

◆ speex_free_scratch()

static void speex_free_scratch ( void * ptr)
inlinestatic

Same as speex_free, except that the area is only needed inside a Speex call (might cause problem with wideband though)

Definition at line 92 of file os_support.h.

◆ speex_notify()

static void speex_notify ( const char * str)
inlinestatic

Definition at line 142 of file os_support.h.

◆ speex_realloc()

static void * speex_realloc ( void * ptr,
int size )
inlinestatic

Speex wrapper for realloc.

To do your own dynamic allocation, all you need to do is replace this function, speex_alloc and speex_free

Definition at line 76 of file os_support.h.

◆ speex_warning()

static void speex_warning ( const char * str)
inlinestatic

Definition at line 124 of file os_support.h.

◆ speex_warning_int()

static void speex_warning_int ( const char * str,
int val )
inlinestatic

Definition at line 133 of file os_support.h.