Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
aribb24
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Ekström
aribb24
Commits
256eb369
Commit
256eb369
authored
10 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
implement logger callback
parent
f8500ca5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure.ac
+1
-1
1 addition, 1 deletion
configure.ac
src/aribb24.c
+35
-0
35 additions, 0 deletions
src/aribb24.c
src/aribb24_private.h
+3
-0
3 additions, 0 deletions
src/aribb24_private.h
src/decoder.c
+1
-0
1 addition, 0 deletions
src/decoder.c
with
40 additions
and
1 deletion
configure.ac
+
1
−
1
View file @
256eb369
...
...
@@ -40,7 +40,7 @@ AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CHECK_FUNCS([memset mkdir sqrt strchr strdup strstr strtoul])
AC_CHECK_FUNCS([memset mkdir sqrt strchr strdup strstr strtoul
vasprintf
])
AC_CONFIG_FILES([Makefile
src/Makefile src/aribb24.pc])
...
...
This diff is collapsed.
Click to expand it.
src/aribb24.c
+
35
−
0
View file @
256eb369
...
...
@@ -23,9 +23,18 @@
#ifndef ARIBB24_MAIN_C
#define ARIBB24_MAIN_C 1
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef HAVE_VASPRINTF
#define _GNU_SOURCE
#endif
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<stdarg.h>
#include
"aribb24/aribb24.h"
#include
"aribb24_private.h"
...
...
@@ -34,6 +43,31 @@
#include
"aribb24/decoder.h"
#include
"decoder_private.h"
void
arib_log
(
arib_instance_t
*
p_instance
,
const
char
*
psz_format
,
...
)
{
#ifdef HAVE_VASPRINTF
va_list
args
;
free
(
p_instance
->
p
->
psz_last_error
);
va_start
(
args
,
psz_format
);
if
(
vasprintf
(
&
p_instance
->
p
->
psz_last_error
,
psz_format
,
args
)
<
0
)
{
p_instance
->
p
->
psz_last_error
=
NULL
;
return
;
}
if
(
p_instance
->
p
->
pf_messages
)
{
p_instance
->
p
->
pf_messages
(
p_instance
->
p
->
p_opaque
,
p_instance
->
p
->
psz_last_error
);
}
else
{
// vprintf ?
}
va_end
(
args
);
#endif
}
arib_instance_t
*
arib_instance_new
(
void
*
p_opaque
)
{
arib_instance_t
*
p_instance
=
calloc
(
1
,
sizeof
(
*
p_instance
)
);
...
...
@@ -56,6 +90,7 @@ void arib_instance_destroy( arib_instance_t *p_instance )
arib_decoder_free
(
p_instance
->
p
->
p_decoder
);
if
(
p_instance
->
p
->
p_parser
)
arib_parser_free
(
p_instance
->
p
->
p_parser
);
free
(
p_instance
->
p
->
psz_last_error
);
free
(
p_instance
);
}
...
...
This diff is collapsed.
Click to expand it.
src/aribb24_private.h
+
3
−
0
View file @
256eb369
...
...
@@ -30,6 +30,9 @@ struct arib_instance_private_t
arib_decoder_t
*
p_decoder
;
arib_parser_t
*
p_parser
;
char
*
psz_base_path
;
char
*
psz_last_error
;
};
void
arib_log
(
arib_instance_t
*
,
const
char
*
,
...
);
#endif
This diff is collapsed.
Click to expand it.
src/decoder.c
+
1
−
0
View file @
256eb369
...
...
@@ -30,6 +30,7 @@
#include
<stdint.h>
#include
"aribb24/decoder.h"
#include
"aribb24_private.h"
#include
"decoder_private.h"
#include
"aribb24/convtable.h"
#include
"aribb24/decoder_macro.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment