Commit 2f2c115e authored by Mario Danic's avatar Mario Danic

Initial import

parents
Developers:
Mario Đanić
Luke Biddell
Anant Narayanan
This diff is collapsed.
Derek Foreman <derek@signalmarketing.com> and Ben Jansens <xor@orodu.net>
Copyright (C) 2002-2004 Derek Foreman and Ben Jansens
Mario Đanić <mario.danic@gmail.com>, Luke Biddell <luke.biddell@gmail.com>, Anant Narayanan <anant@kix.in>
Copyright (C) 2006 Mario Đanić, Luke Biddell, Anant Narayanan
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
pkgconfigdir=$(libdir)/pkgconfig
libincludedir=$(includedir)/libburn/@BURN_MAJOR_VERSION@/libburn
lib_LTLIBRARIES = libburn/libburn.la libisofs/libisofs.la
## ========================================================================= ##
# Build libraries
libburn_libburn_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
libburn_libburn_la_SOURCES = \
libburn/async.c \
libburn/async.h \
libburn/crc.c \
libburn/crc.h \
libburn/debug.c \
libburn/debug.h \
libburn/drive.c \
libburn/drive.h \
libburn/error.h \
libburn/file.c \
libburn/file.h \
libburn/init.c \
libburn/init.h \
libburn/lec.c \
libburn/lec.h \
libburn/libburn.h \
libburn/message.c \
libburn/message.h \
libburn/mmc.c \
libburn/mmc.h \
libburn/null.c \
libburn/null.h \
libburn/options.c \
libburn/options.h \
libburn/read.c \
libburn/read.h \
libburn/sbc.c \
libburn/sbc.h \
libburn/sector.c \
libburn/sector.h \
libburn/sg.c \
libburn/sg.h \
libburn/source.h \
libburn/source.c \
libburn/spc.c \
libburn/spc.h \
libburn/structure.c \
libburn/structure.h \
libburn/toc.c \
libburn/toc.h \
libburn/transport.h \
libburn/util.c \
libburn/util.h \
libburn/write.c \
libburn/write.h \
version.h
libisofs_libisofs_la_LDFLAGS = \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
libisofs_libisofs_la_SOURCES = \
libisofs/errors.h \
libisofs/errors.c \
libisofs/tree.h \
libisofs/tree.c \
libisofs/volume.h \
libisofs/volume.c \
libisofs/util.h \
libisofs/util.c \
libisofs/ecma119.c \
libisofs/ecma119.h \
libisofs/struct.h \
libisofs/struct.c \
libisofs/susp.h \
libisofs/susp.c \
libisofs/rockridge.h \
libisofs/rockridge.c \
libisofs/libisofs.h
libinclude_HEADERS = \
libburn/libburn.h \
libisofs/libisofs.h
## ========================================================================= ##
## Build test applications
noinst_PROGRAMS = \
test/blank \
test/burn \
test/burniso \
test/devices \
test/iso \
test/master \
test/poll \
test/rip \
test/toc \
test/structest
test_devices_CPPFLAGS = -Ilibburn
test_devices_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_devices_SOURCES = test/devices.c
test_poll_CPPFLAGS = -Ilibburn
test_poll_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_poll_SOURCES = test/poll.c
test_toc_CPPFLAGS = -Ilibburn
test_toc_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_toc_SOURCES = test/toc.c
test_rip_CPPFLAGS = -Ilibburn
test_rip_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_rip_SOURCES = test/rip.c
test_burn_CPPFLAGS = -Ilibburn
test_burn_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_burn_SOURCES = test/burn.c
test_burniso_CPPFLAGS = -Ilibburn
test_burniso_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_burniso_SOURCES = test/burniso.c
test_master_CPPFLAGS = -Ilibburn
test_master_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_master_SOURCES = test/master.c
test_structest_CPPFLAGS = -Ilibburn
test_structest_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_structest_SOURCES = test/structest.c
test_blank_CPPFLAGS = -Ilibburn
test_blank_LDADD = $(libburn_libburn_la_OBJECTS) $(THREAD_LIBS)
test_blank_SOURCES = test/blank.c
test_iso_CPPFLAGS = -Ilibisofs
test_iso_LDADD = $(libisofs_libisofs_la_OBJECTS) $(THREAD_LIBS)
test_iso_SOURCES = test/iso.c
## ========================================================================= ##
## Build documentation (You need Doxygen for this to work)
webhost = http://libburn-api.pykix.org
webpath = /
docdeps = \
doc/doxygen.conf \
doc/comments \
libburn/libburn.h \
libisofs/libisofs.h \
test/burniso.c
doc: doc/html
doc/html: $(docdeps)
$(RM) -r $@
doxygen doc/doxygen.conf
doc-upload: doc/html
scp -r $</* $(webhost):$(webpath)
.PHONY: doc
## ========================================================================= ##
# Indent source files
indent_files = \
$(libisofs_libisofs_la_SOURCES) \
$(libburn_libburn_la_SOURCES) \
$(test_devices_SOURCES) \
$(test_poll_SOURCES) \
$(test_toc_SOURCES) \
$(test_rip_SOURCES) \
$(test_burn_SOURCES) \
$(test_burniso_SOURCES) \
$(test_master_SOURCES) \
$(test_structest_SOURCES) \
$(test_blank_SOURCES)
indent: $(indent_files)
indent -bad -bap -nbbb -nbbo -nbc -bli0 -br -bls \
-cdw -ce -cli0 -ncs -nbfda -i8 -l79 -lc79 \
-lp -saf -sai -nprs -npsl -saw -sob -ss -ut \
-sbi0 -nsc -ts8 -npcs -ncdb -fca \
$^
.PHONY: indent
## ========================================================================= ##
# Extra things
nodist_pkgconfig_DATA = \
libburn-1.pc \
libisofs-1.pc
EXTRA_DIST = \
libburn-1.pc.in \
libisofs-1.pc.in \
version.h.in \
doc/doxygen.conf.in \
README \
COPYING
dnl Function to link an architecture specific file
dnl LINK_ARCH_SRC(source_dir, arch, source_file)
AC_DEFUN([COPY_ARCH_SRC],
[
echo "copying $1/$2/$3 -> $1/$3"
old="$srcdir/$1/$2/$3"
new="$srcdir/$1/$3"
cat >$new <<__EOF__
/* WARNING: This file was automatically generated!
* Original: $old
*/
__EOF__
cat >>$new <$old
])
AC_DEFUN([TARGET_SHIZZLE],
[
ARCH=""
AC_MSG_CHECKING([target operating system])
case $target in
*-*-linux*)
ARCH=linux
;;
*)
AC_ERROR([You are attempting to compile for an unsupported platform])
;;
esac
AC_MSG_RESULT([$ARCH])
# this doesn't actually do anything yet.. but it will someday when we port
# libburn
#COPY_ARCH_SRC(libburn, $ARCH, transport.c)
])
#!/bin/sh -x
aclocal-1.7
libtoolize --copy --force
autoconf
automake-1.7 --foreign --add-missing --copy --include-deps
AC_INIT([libburn], [0.2.1], [http://libburn.pykix.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
dnl Making releases:
dnl BURN_MICRO_VERSION += 1;
dnl BURN_INTERFACE_AGE += 1;
dnl BURN_BINARY_AGE += 1;
dnl if any functions have been added, set BURN_INTERFACE_AGE to 0.
dnl if backwards compatibility has been broken,
dnl set BURN_BINARY_AGE and BURN_INTERFACE_AGE to 0.
dnl
dnl if MAJOR or MINOR version changes, be sure to change AC_INIT above to match
dnl
BURN_MAJOR_VERSION=0
BURN_MINOR_VERSION=2
BURN_MICRO_VERSION=1
BURN_INTERFACE_AGE=0
BURN_BINARY_AGE=0
BURN_VERSION=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION.$BURN_MICRO_VERSION
AC_SUBST(BURN_MAJOR_VERSION)
AC_SUBST(BURN_MINOR_VERSION)
AC_SUBST(BURN_MICRO_VERSION)
AC_SUBST(BURN_INTERFACE_AGE)
AC_SUBST(BURN_BINARY_AGE)
AC_SUBST(BURN_VERSION)
dnl Libtool versioning
LT_RELEASE=$BURN_MAJOR_VERSION.$BURN_MINOR_VERSION
LT_CURRENT=`expr $BURN_MICRO_VERSION - $BURN_INTERFACE_AGE`
LT_REVISION=$BURN_INTERFACE_AGE
LT_AGE=`expr $BURN_BINARY_AGE - $BURN_INTERFACE_AGE`
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_CURRENT_MINUS_AGE)
AC_PREFIX_DEFAULT([/usr/local])
test "$prefix" = "NONE" && prefix=$ac_default_prefix
AM_MAINTAINER_MODE
AM_PROG_CC_C_O
AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN
dnl Large file support
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
if test ! $ac_cv_func_fseeko; then
AC_ERROR([Libburn requires largefile support.])
fi
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
LIBTOOL="$LIBTOOL --silent"
AC_PROG_INSTALL
AC_CHECK_HEADERS()
THREAD_LIBS=-lpthread
AC_SUBST(THREAD_LIBS)
TARGET_SHIZZLE
dnl Add compiler-specific flags
dnl See if the user wants aggressive optimizations of the code
AC_ARG_ENABLE(debug,
[ --enable-debug Disable aggressive optimizations [default=yes]],
, enable_debug=yes)
if test x$enable_debug != xyes; then
if test x$GCC = xyes; then
CFLAGS="$CFLAGS -O3"
CFLAGS="$CFLAGS -fexpensive-optimizations"
fi
CFLAGS="$CFLAGS -DNDEBUG"
else
if test x$GCC = xyes; then
CFLAGS="$CFLAGS -g -pedantic -Wall"
fi
CFLAGS="$CFLAGS -DDEBUG"
fi
AC_CONFIG_FILES([
Makefile
doc/doxygen.conf
version.h
libburn-1.pc
libisofs-1.pc
])
AC_OUTPUT
all clean:
$(MAKE) -C .. -$(MAKEFLAGS) $@
.PHONY: all clean
/**
@author Dana Jansens, Derek Foreman
@mainpage Libburn Documentation Index
@section intro Introduction
Libburn is an open source library suite for reading, mastering and writing
optical discs.
@section using Using the library
@subsection concepts Library concepts
There are a few concepts to introduce in order for you to understand how to
use Libburn. So, lets start with them:
<ol>
<li> Read - The process of reading the data on a disc for storage or
copying.
<li> Write - The process of writing data onto a disc to create a new
disc image or append to an existing one.
<li> Drive - A Drive is a hardware device used to reading and/or writing
discs. CD burners and CD-ROMs are examples of Drives.
</ol>
@subsection working Working with the library
Now that you understand the above @ref concepts, you're ready to look at the
actual use of the library.
In general, using the library to perform a process consists of the following
steps:
<ol>
<li> Initialize the library. (If not already done; a single instance of
the library can perform multiple operations simultaneously with
multiple drives.)
<li> Scan for available Drives.
<li> Choose and grab a Drive for reading/writing.
<li> Fill in the options for the operation.
<li> Wait for the operation to complete, displaying status along the way
if desired.
<li> Release the Drive.
<li> Destroy the library instance. (If you're done working with the
library.)
</ol>
Here's a very simple example of burning an ISO file
@include burniso.c
*/
# Doxyfile 1.2.18
#---------------------------------------------------------------------------
# General configuration options
#---------------------------------------------------------------------------
PROJECT_NAME = @PACKAGE_NAME@
PROJECT_NUMBER = @PACKAGE_VERSION@
OUTPUT_DIRECTORY =
OUTPUT_LANGUAGE = English
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = @top_srcdir@
INTERNAL_DOCS = NO
STRIP_CODE_COMMENTS = NO
CASE_SENSE_NAMES = NO
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = YES
SHOW_INCLUDE_FILES = YES
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = YES
DETAILS_AT_TOP = YES
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 4
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SHOW_USED_FILES = YES
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = YES
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = libburn libisofs doc
FILE_PATTERNS = libburn.h libisofs.h comments
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH = test
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX = OB OTK _
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = doc/html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 200
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = NO
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = letter
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = NO
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_SCHEMA =
XML_DTD =
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED = DOXYGEN
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = YES
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
TEMPLATE_RELATIONS = YES
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
GRAPHICAL_HIERARCHY = NO
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 1024
MAX_DOT_GRAPH_HEIGHT = 1024
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::addtions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libburn
Description: Disc reading/writing library
Version: @VERSION@
Requires:
Libs: -L${libdir} -lburn @THREAD_LIBS@
Cflags: -I${includedir}/libburn/@BURN_MAJOR_VERSION@
all clean:
$(MAKE) -C .. -$(MAKEFLAGS) $@
.PHONY: all clean
pkgconfigdir=$(libdir)/pkgconfig
libincludedir=$(includedir)/libburn/@BURN_MAJOR_VERSION@
lib_LTLIBRARIES = libburn.la
libburn_la_SOURCES = \
async.c \
async.h \
crc.c \
crc.h \
debug.c \
debug.h \
drive.c \
drive.h \
file.c \
file.h \
init.c \
init.h \
lec.c \
lec.h \
message.c \
message.h \
mmc.c \
mmc.h \
null.c \
null.h \
options.c \
options.h \
read.c \
read.h \
sbc.c \
sbc.h \
sector.c \
sector.h \
sg.c \
sg.h \
spc.c \
spc.h \
source.h \
source.c \
structure.c \
structure.h \
toc.c \
toc.h \
transport.h \
util.c \
util.h \
write.c \
write.h
libinclude_HEADERS = libburn.h
## ========================================================================= ##
indent_files = $(libburn_la_SOURCES)
indent: $(indent_files)
indent -bad -bap -nbbb -nbbo -nbc -bli0 -br -bls \
-cdw -ce -cli0 -ncs -nbfda -i8 -l79 -lc79 \
-lp -saf -sai -nprs -npsl -saw -sob -ss -ut \
-sbi0 -nsc -ts8 -npcs -ncdb -fca \
$^
.PHONY: indent
## ========================================================================= ##
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
#include "libburn.h"
#include "transport.h"
#include "drive.h"
#include "write.h"
#include "options.h"
#include "async.h"
#include <pthread.h>
#include <assert.h>
#include <stdlib.h>
#define SCAN_GOING() (workers && !workers->drive)
typedef void *(*WorkerFunc) (void *);
struct scan_opts
{
struct burn_drive_info **drives;
unsigned int *n_drives;
int done;
};
struct erase_opts
{
struct burn_drive *drive;
int fast;
};
struct write_opts
{
struct burn_drive *drive;
struct burn_write_opts *opts;
struct burn_disc *disc;
};
struct w_list
{
struct burn_drive *drive;
pthread_t thread;
struct w_list *next;
union w_list_data
{
struct scan_opts scan;
struct erase_opts erase;
struct write_opts write;
} u;