Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libburn
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Libburnia
libburn
Commits
287b59cf
Commit
287b59cf
authored
Sep 22, 2010
by
Thomas Schmitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporarily added test program for burn_offst_source_new()
parent
c49995b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
1 deletion
+138
-1
Makefile.am
Makefile.am
+4
-0
cdrskin_timestamp.h
cdrskin/cdrskin_timestamp.h
+1
-1
offst_source.c
test/offst_source.c
+133
-0
No files found.
Makefile.am
View file @
287b59cf
...
...
@@ -83,6 +83,7 @@ install-exec-hook:
## Build test applications
noinst_PROGRAMS
=
\
test
/libburner
\
test
/offst_source
\
test
/telltoc
\
test
/dewav
\
test
/fake_au
\
...
...
@@ -97,6 +98,9 @@ LIBBURN_EXTRALIBS = $(LIBBURN_ARCH_LIBS) $(THREAD_LIBS)
test_libburner_CPPFLAGS
=
-Ilibburn
test_libburner_LDADD
=
$(libburn_libburn_la_OBJECTS)
$(LIBBURN_EXTRALIBS)
test_libburner_SOURCES
=
test
/libburner.c
test_offst_source_CPPFLAGS
=
-Ilibburn
test_offst_source_LDADD
=
$(libburn_libburn_la_OBJECTS)
$(LIBBURN_EXTRALIBS)
test_offst_source_SOURCES
=
test
/offst_source.c
test_telltoc_CPPFLAGS
=
-Ilibburn
test_telltoc_LDADD
=
$(libburn_libburn_la_OBJECTS)
$(LIBBURN_EXTRALIBS)
test_telltoc_SOURCES
=
test
/telltoc.c
...
...
cdrskin/cdrskin_timestamp.h
View file @
287b59cf
#define Cdrskin_timestamP "2010.09.22.1
75054
"
#define Cdrskin_timestamP "2010.09.22.1
80921
"
test/offst_source.c
0 → 100644
View file @
287b59cf
/*
cc -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS -g -o test/offst_source test/offst_source.c -lburn
*/
#include "../libburn/libburn.h"
/* Just everything from test/libburner.c */
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <sys/stat.h>
#include <fcntl.h>
static
int
create_original
(
struct
burn_source
**
original
,
char
*
path
,
int
flag
)
{
*
original
=
burn_file_source_new
(
path
,
NULL
);
if
(
*
original
==
NULL
)
return
0
;
return
1
;
}
static
int
set_up_offst_sources
(
struct
burn_source
*
original
,
struct
burn_source
*
offsetters
[],
int
count
,
int
flag
)
{
int
i
;
off_t
start
=
3
,
size
=
10
,
gap
=
7
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
offsetters
[
i
]
=
burn_offst_source_new
(
original
,
i
>
0
?
offsetters
[
i
-
1
]
:
NULL
,
start
,
size
,
0
);
if
(
offsetters
[
i
]
==
NULL
)
return
0
;
printf
(
"set_up_offst_sources: idx=%d, start=%d
\n
"
,
i
,
(
int
)
start
);
start
+=
size
+
gap
;
}
return
1
;
}
static
int
consume_source
(
struct
burn_source
*
src
,
int
flag
)
{
int
ret
,
count
=
0
;
unsigned
char
buf
[
1
];
while
(
1
)
{
ret
=
src
->
read_xt
(
src
,
buf
,
1
);
if
(
ret
<
0
)
{
printf
(
"
\n
"
);
fprintf
(
stderr
,
"consume_source: count=%d, ret=%d
\n
"
,
count
,
ret
);
return
0
;
}
if
(
ret
==
0
)
break
;
printf
(
"%u "
,
buf
[
0
]);
count
++
;
}
printf
(
" count=%d
\n
"
,
count
);
return
1
;
}
static
int
consume_all_sources
(
struct
burn_source
*
offsetters
[],
int
count
,
int
flag
)
{
int
i
,
ret
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
printf
(
"consume_source: idx=%d
\n
"
,
i
);
ret
=
consume_source
(
offsetters
[
i
],
0
);
if
(
ret
<=
0
)
return
ret
;
}
return
1
;
}
static
int
free_all_sources
(
struct
burn_source
*
original
,
struct
burn_source
*
offsetters
[],
int
count
,
int
flag
)
{
int
i
;
for
(
i
=
0
;
i
<
count
;
i
++
)
burn_source_free
(
offsetters
[
i
]);
burn_source_free
(
original
);
return
1
;
}
int
main
(
int
argc
,
char
**
argv
)
{
int
ret
;
char
*
path
=
"./README"
;
struct
burn_source
*
original
=
NULL
,
*
offsetters
[
4
];
if
(
argc
>
1
)
path
=
argv
[
1
];
if
(
burn_initialize
()
==
0
)
exit
(
1
);
ret
=
create_original
(
&
original
,
path
,
0
);
if
(
ret
<=
0
)
exit
(
2
);
ret
=
set_up_offst_sources
(
original
,
offsetters
,
4
,
0
);
if
(
ret
<=
0
)
exit
(
3
);
ret
=
consume_all_sources
(
offsetters
,
4
,
0
);
if
(
ret
<=
0
)
exit
(
4
);
ret
=
free_all_sources
(
original
,
offsetters
,
4
,
0
);
if
(
ret
<=
0
)
exit
(
5
);
burn_finish
();
exit
(
0
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment