6ade7bad859e55ad8802760e88fd780e38860248
4 * Created on: Feb 21, 2011
5 * Copyright (C) Georg Martius - February 2011
7 * This file is part of transcode, a video stream processing tool
9 * transcode is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * transcode is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Make; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "libvidstab.h"
31 /**** default values for memory and logging ****/
33 /// memory allocation with zero initialization
34 void* _zalloc(size_t size
){
35 return memset(malloc(size
),0,size
);
39 int _vs_log(int type
, const char* tag
, const char* format
, ...){
40 fprintf(stderr
,"%s (%s):",
41 type
== VS_ERROR_TYPE
? "Error: " :
42 type
== VS_WARN_TYPE
? "Warn: " :
43 type
== VS_INFO_TYPE
? "Info: " :
44 type
== VS_MSG_TYPE
? "Msg: " : "Unknown",
47 va_start (ap
, format
);
48 vfprintf (stderr
, format
, ap
);
55 vs_malloc_t vs_malloc
= malloc
;
56 vs_realloc_t vs_realloc
= realloc
;
57 vs_free_t vs_free
= free
;
58 vs_zalloc_t vs_zalloc
= _zalloc
;
60 vs_strdup_t vs_strdup
= strdup
;
62 vs_log_t vs_log
= _vs_log
;
63 int VS_ERROR_TYPE
= 0;
73 * c-file-style: "stroustrup"
74 * c-file-offsets: ((case-label . *) (statement-case-intro . *))
75 * indent-tabs-mode: nil
78 * vim: expandtab shiftwidth=4: