Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/libdvdnav
  • thresh/libdvdnav
  • robUx4/libdvdnav
  • jsgh/libdvdnav
  • chouquette/libdvdnav
  • jbk/libdvdnav
  • martymac/libdvdnav
  • Mathias_Couder/libdvdnav
  • DimitriPapadopoulos/libdvdnav
  • hpi/libdvdnav
  • miguelborgesdefreitas/libdvdnav
  • dmahurin/libdvdnav
  • ATinySpaceMarine/libdvdnav
  • masstock/libdvdnav
14 results
Show changes
Commits on Source (68)
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: normal
build-debian:
image: registry.videolan.org/vlc-debian-unstable:20200529132440
stage: build
tags:
- docker
- amd64
script:
- autoreconf -fisv
- mkdir build
- cd build
- ../configure
- make -j $(getconf _NPROCESSORS_ONLN)
build-macos:
stage: build
tags:
- catalina
- amd64
script:
- curl -sS -O https://artifacts.videolan.org/vlc/macos-x86_64/vlc-contrib-x86_64-apple-darwin19-aeb120a889fe12f4636fe470bbc25b0fbc53a4d5.tar.bz2
- tar xf vlc-contrib-x86_64-apple-darwin19-aeb120a889fe12f4636fe470bbc25b0fbc53a4d5.tar.bz2
- cd x86_64-apple-darwin19
- curl -sS -o ./change_prefix.sh 'https://git.videolan.org/?p=vlc.git;a=blob_plain;f=contrib/src/change_prefix.sh;hb=HEAD'
- chmod +x ./change_prefix.sh
- ./change_prefix.sh
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`pwd -P`/lib/pkgconfig/"
- export PATH="$PATH:`pwd -P`/bin/"
- cd ../
- autoreconf -fisv
- mkdir build
- cd build
- ../configure
- make -j $(getconf _NPROCESSORS_ONLN)
- make install DESTDIR=`pwd`/artifacts
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- build/artifacts/
expire_in: 1 week
build-win64:
image: registry.videolan.org/vlc-debian-win64:20201106143728
stage: build
tags:
- docker
- amd64
script:
- wget -nv https://artifacts.videolan.org/vlc/win64/vlc-contrib-x86_64-w64-mingw32-367001997fa588ab18e13c648501667906cc3fb7.tar.bz2
- tar xf vlc-contrib-x86_64-w64-mingw32-367001997fa588ab18e13c648501667906cc3fb7.tar.bz2
- cd x86_64-w64-mingw32
- wget -nv -O ./change_prefix.sh 'https://git.videolan.org/?p=vlc.git;a=blob_plain;f=contrib/src/change_prefix.sh;hb=HEAD'
- chmod +x ./change_prefix.sh
- ./change_prefix.sh
- cd ..
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`realpath x86_64-w64-mingw32`/lib/pkgconfig/"
- export PATH="$PATH:`realpath x86_64-w64-mingw32`/bin/"
- autoreconf -fisv
- mkdir build
- cd build
- ../configure --host=x86_64-w64-mingw32
- make -j $(getconf _NPROCESSORS_ONLN)
- make install DESTDIR=`pwd`/artifacts
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- build/artifacts/
expire_in: 1 week
build-win32:
image: registry.videolan.org/vlc-debian-win32:20201106141924
stage: build
tags:
- docker
- amd64
script:
- wget -nv https://artifacts.videolan.org/vlc/win32/vlc-contrib-i686-w64-mingw32-367001997fa588ab18e13c648501667906cc3fb7.tar.bz2
- tar xf vlc-contrib-i686-w64-mingw32-367001997fa588ab18e13c648501667906cc3fb7.tar.bz2
- cd i686-w64-mingw32
- wget -nv -O ./change_prefix.sh 'https://git.videolan.org/?p=vlc.git;a=blob_plain;f=contrib/src/change_prefix.sh;hb=HEAD'
- chmod +x ./change_prefix.sh
- ./change_prefix.sh
- cd ..
- export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:`realpath i686-w64-mingw32`/lib/pkgconfig/"
- export PATH="$PATH:`realpath i686-w64-mingw32`/bin/"
- autoreconf -fisv
- mkdir build
- cd build
- ../configure --host=i686-w64-mingw32
- make -j $(getconf _NPROCESSORS_ONLN)
- make install DESTDIR=`pwd`/artifacts
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- build/artifacts/
expire_in: 1 week
autom4te.cache
config.status
......@@ -5,3 +5,7 @@ Kees Cook <kees@outflux.net>
Michael Roitzsch <mroi@users.sourceforge.net>
Frantisek Dvorak <valtri@users.sourceforge.net>
Diego Elio Pettenò <flameeyes@flameeyes.eu>
Jean-Baptiste Kempf <jb@videolan.org>
Nico Sabbi <nicola.sabbi@poste.it>
Erik Hovland <erik@hovland.org>
Francois Cartegnie <fcvlcdev@free.fr>
libdvdnav (next)
* add dvdnav_get_volid_string to obtain the volume id of the disc
* add dvdnav_get_number_of_streams API to list tracks
* add dvdnav_set_active_stream API to activate a stream
* add dvdnav_toggle_spu_stream API to enable/disable the current SPU stream
* add dvdnav_get_disk_region_mask API to get the reported version from the disk
libdvdnav (6.1.1)
* fix build issues
* improve CI
libdvdnav (6.1.0)
* add a dvdnav_open2 API to setup a logging mechanism, similar to libdvdread
* add a dvdnav_get_number_of_angles API
* add a dvdnav_version API
* rework the logs in the library and remove direct printf calls
* handle out-of-order ADMAP entries blocking playback
* fix crashes in dvdnav_describe_title_chapters in broken DVDs
* cleanup old code and buildsystem
libdvdnav (6.0.1)
* improve random playback mode, to work-around broken discs
* fix divide-by-zerop issue in tmap search
* fix pthread on OS/2
libdvdnav (6.0.0)
* fix crashes on some DVD on describe_title call
* fix various crashes related to PGC validity
* fix compilation issues
* fix API return codes
* fix API return codes (and bump release)
libdvdnav (5.0.3)
* added dvdnav_open_stream to read from external read/seek callbacks
......@@ -44,12 +69,12 @@ libdvdnav (4.2.0)
more reliable playback
* fixed deadlock between dvdnav_reset() and dvd_clear()
* fixed pthread_mutex_destroy macro for Win32
* fixed numerous assertion failures occuring when playing DVDs with
* fixed numerous assertion failures occurring when playing DVDs with
new "copy protection" schemes
* fixed forward seeks to always move forward
libdvdnav (4.1.3)
* an embarassing amount of fixes regarding potential memory and resource leaks
* an embarrassing amount of fixes regarding potential memory and resource leaks
(patches contributed by Erik Hovland)
* added dvdread-config (dvdnav-config's younger brother)
* added pkg-config support
......@@ -74,7 +99,7 @@ libdvdnav (4.1.1)
dvdnav_{title,part}_play() works again
* removed wrong SPU stream change event filter
(fixes unwanted subtitles in the trailer of "Girl, interrupted", RC2)
* fixed error "Expected NAV packet but none found." occuring sometimes
* fixed error "Expected NAV packet but none found." occurring sometimes
on resume from menu
libdvdnav (0.1.10)
......@@ -108,7 +133,7 @@ libdvdnav (0.1.6) unstable; urgency=low
* method to try-run VM operations, now used for safer chapter skipping and menu jumps
* fixed detection of current PTT to not assume a 1:1 mapping between PTTs and PGs
* releasing stills when jumping to menu fixes some state inconsistencies
* do not assume PGs to be physically layed out in sequence on the disc
* do not assume PGs to be physically laid out in sequence on the disc
* optional PGC based seeking
* new event on cell changes for timing info
......
ACLOCAL_AMFLAGS = -Im4
AM_CPPFLAGS = -I$(top_srcdir)/src $(THREAD_CFLAGS) $(DVDREAD_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir)/src \
-I$(top_builddir)/src/dvdnav \
$(THREAD_CFLAGS) \
$(DVDREAD_CFLAGS)
dist_doc_DATA = AUTHORS ChangeLog COPYING README TODO
dist_doc_DATA = AUTHORS ChangeLog COPYING README.md TODO
EXTRA_DIST = msvc/ \
doc/doxy.conf \
......@@ -18,6 +21,8 @@ libdvdnav_la_SOURCES = \
src/read_cache.c \
src/navigation.c \
src/highlight.c \
src/logger.c \
src/logger.h \
src/searching.c \
src/settings.c \
src/dvdnav_internal.h \
......@@ -44,7 +49,8 @@ pkgincludedir = $(includedir)/dvdnav
pkginclude_HEADERS = \
src/dvdnav/dvdnav.h \
src/dvdnav/dvdnav_events.h \
src/dvdnav/dvd_types.h
src/dvdnav/dvd_types.h \
src/dvdnav/version.h
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = misc/dvdnav.pc
......
What is this all about?
-----------------------
## Libdvdnav
libdvdnav is a library that allows easy use of sophisticated DVD navigation
features such as DVD menus, multiangle playback and even interactive DVD games.
All this functionality is provided through a simple API which provides the
**Libdvdnav** is a library that allows **easy use** of sophisticated DVD navigation
features such as **DVD menus**, **multiangle playback** and even **interactive DVD games**.
All this functionality is provided through a **simple API** which provides the
DVD playback as a single logical stream of blocks, intermitted by special
dvdnav events to report certain conditions. The main usage of libdvdnav is a
dvdnav events to report certain conditions. The main usage of **libdvdnav** is a
loop regularly calling a function to get the next block, surrounded by
additional calls to tell the library of user interaction.
The whole DVD virtual machine and internal playback states are completely
encapsulated.
The whole DVD virtual machine and internal playback states are **completely
encapsulated**.
Where does it come from?
------------------------
## Where does it come from?
This library was based on a lot of code and expertise from the Ogle project.
Ogle was the first DVD player who implemented free DVD navigation. The
This library was based on a lot of code and expertise from the **Ogle project**.
**Ogle** was the first DVD player who implemented **free DVD navigation**. The
libdvdnav developers wish to express their gratitude to the Ogle people
for all the valuable research work they have done.
for all the **valuable research work** they have done.
Initially, the dvdnav code was part of a plugin to the xine media player
called xine-dvdnav. Later on, the DVD VM specific code was split
from xine-dvdnav and went into the first version of libdvdnav.
Initially, the **dvdnav** code was part of a plugin to the **xine media player**
called **xine-dvdnav**. Later on, the DVD VM specific code was split
from xine-dvdnav and went into the first version of **libdvdnav**.
Then, it was forked, and forked again on MPlayer repositories.
libdvdnav and libdvdread were merged, and then split again.
......@@ -35,11 +33,12 @@ numerous crashes and maintain a correct player-agnostic library for DVD playback
This fork will try to maintain correct authorship tracking, by using git and a
proper history.
How can I use it?
-----------------
## License
libdvdnav is completely licensed under GPL. You may use it at wish within the
bounds of this license. See the file "COPYING" for a copy of the GPL.
Libdvdnav is completely licensed under GPL. You may use it at wish within the
bounds of this license. See the [here](https://code.videolan.org/videolan/libdvdnav/-/blob/master/COPYING) for a copy of the GPL.
## Documentation
Sources for documentation on libdvdnav are:
* the examples directory contains a simple program using libdvdnav
......@@ -50,7 +49,14 @@ Sources for documentation on libdvdnav are:
Sources for documentation on DVD terminology, structure and surrounding concepts:
* doc/dvd_structures briefly explains DVD terms and organization
* a more detailed description of DVD structures is available at
http://www.mpucoder.com/dvd/
* a more detailed description of DVD structures is available [here](http://www.mpucoder.com/dvd/)
* the ifo_types.h and nav_types.h headers are also interesting if you
are already used to the sometimes cryptical abbreviations
## CoC
The [VideoLAN Code of Conduct](https://wiki.videolan.org/CoC) applies to this project.
## Support
You can have a direct access to VideoLAN support [here](https://www.videolan.org/support/)
* Support DVDs with errors on them. So we can recover from corrupt sectors in the .VOB. Also, handle corrupt .IFO files by using the backup .BUP files.
* Support Random and Shuffle Titles. Only sequencial Titles are currently supported.
* rework documentation
* Support Random and Shuffle Titles. Only sequential Titles are currently supported.
* implement restriction levels:
0 - execute everything as the app commands
1 - do some sensible sanity checking
2 - be more careful, when operations are prohibited (like not seeking/jumping in the presence of stills or cell commands)
3 - fully respect user prohibitions
* cleanup public API and fix libtool versioning
* Update decoder.c with some of the more rare commands. Update already done to vmcmd.c
* RELEASE! (maybe it's time for libdvdnav 0.5?)
......@@ -4,8 +4,8 @@ dnl
dnl These are defined in m4 so they can be passed to AC_INIT
dnl --------------------------------------------------------------
m4_define([dvdnav_major], [6])
m4_define([dvdnav_minor], [0])
m4_define([dvdnav_sub], [0])
m4_define([dvdnav_minor], [1])
m4_define([dvdnav_sub], [1])
m4_define([dvdnav_pre], [])
AC_INIT([libdvdnav], [dvdnav_major.dvdnav_minor.dvdnav_sub[]dvdnav_pre])
......@@ -27,9 +27,12 @@ DVDNAV_MINOR="dvdnav_minor"
DVDNAV_SUB="dvdnav_sub"
DVDNAV_PRE="dvdnav_pre"
DVDREAD_MIN_VERSION="6.0.0"
AC_SUBST(DVDNAV_MAJOR)
AC_SUBST(DVDNAV_MINOR)
AC_SUBST(DVDNAV_SUB)
AC_SUBST(DVDREAD_MIN_VERSION)
dnl The libtool version numbers (DVDNAV_LT_*); Don't even think about faking this!
dnl
......@@ -56,15 +59,15 @@ dnl are platform dependent
dnl * in Linux, the library will be named
dnl libname.so.(DVDNAV_LT_CURRENT - DVDNAV_LT_AGE).DVDNAV_LT_AGE.DVDNAV_LT_REVISION
DVDNAV_LT_CURRENT=6
DVDNAV_LT_AGE=2
DVDNAV_LT_CURRENT=8
DVDNAV_LT_AGE=4
DVDNAV_LT_REVISION=0
AC_SUBST(DVDNAV_LT_CURRENT)
AC_SUBST(DVDNAV_LT_AGE)
AC_SUBST(DVDNAV_LT_REVISION)
AC_PROG_CC
AC_PROG_CC_C99
AC_SYS_LARGEFILE
AC_C_BIGENDIAN
......@@ -72,9 +75,6 @@ AC_C_BIGENDIAN
AS_CASE([$host],
[*mingw32* | *cygwin*], [AC_CHECK_FUNCS(gettimeofday)])
AS_CASE([$host],
[*os2*], [LDFLAGS="$LDFLAGS -no-undefined"])
dnl ---------------------------------------------
dnl threads
dnl ---------------------------------------------
......@@ -97,7 +97,7 @@ esac
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)
PKG_CHECK_MODULES([DVDREAD], [dvdread >= 5.0.3])
PKG_CHECK_MODULES([DVDREAD], [dvdread >= ${DVDREAD_MIN_VERSION}])
dnl ---------------------------------------------
dnl Check for bitfield compiler flag
......@@ -112,6 +112,14 @@ dnl Check for doxygen (dynamic documentation generator)
dnl ---------------------------------------------
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)
dnl ---------------------------------------------
dnl -no-undefined libtool flag
dnl
dnl This should be after all checks
dnl ---------------------------------------------
AS_CASE([$host_os],
[os2*], [LDFLAGS="$LDFLAGS -no-undefined"])
dnl ---------------------------------------------
dnl Output configuration files
dnl ---------------------------------------------
......@@ -119,4 +127,5 @@ AC_OUTPUT([
Makefile
misc/dvdnav.pc
misc/libdvdnav.spec
src/dvdnav/version.h
])
......@@ -138,7 +138,7 @@ STRIP_CODE_COMMENTS = YES
# file names in lower case letters. If set to YES upper case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# users are adviced to set this option to NO.
# users are advised to set this option to NO.
CASE_SENSE_NAMES = YES
......@@ -170,7 +170,7 @@ SHOW_INCLUDE_FILES = YES
# will interpret the first line (until the first dot) of a JavaDoc-style
# comment as the brief description. If set to NO, the JavaDoc
# comments will behave just like the Qt-style comments (thus requiring an
# explict @brief command for a brief description.
# explicit @brief command for a brief description.
JAVADOC_AUTOBRIEF = YES
......@@ -639,7 +639,7 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# config file, i.e. a series of assigments. You only have to provide
# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
RTF_STYLESHEET_FILE =
......@@ -801,7 +801,7 @@ PERL_PATH = /usr/bin/perl
# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
# generate a inheritance diagram (in Html, RTF and LaTeX) for classes with base or
# super classes. Setting the tag to NO turns the diagrams off. Note that this
# option is superceded by the HAVE_DOT option below. This is only a fallback. It is
# option is superseded by the HAVE_DOT option below. This is only a fallback. It is
# recommended to install and use dot, since it yield more powerful graphs.
CLASS_DIAGRAMS = YES
......
......@@ -27,7 +27,7 @@ not know), but they are practically proven in libdvdnav.
NAV packet used for menu button highlight and command information
and to detect PTS discontinuities
- ILVU (interleaved video unit)
* contains multiple VOBUs (ususally only one)
* contains multiple VOBUs (usually only one)
* blocking multiple VOBUs of multiple interleaved MPEG streams for
multiangle features
- VOB (video object)
......@@ -41,11 +41,11 @@ not know), but they are practically proven in libdvdnav.
* all block addressing is done within the scope of the VOBS
2. navigational structure - logical playback control
- Cell
* smallest unit which is layed out in sequence
* smallest unit which is laid out in sequence
* points to a first and last VOBU (by sector)
* also points to the corresponding CellID and VOB_ID
* smallest unit to execute VM commands (cell_post commands)
* smallest unit accesible by VM commands (apart from LinkRSM)
* smallest unit accessible by VM commands (apart from LinkRSM)
- PG (program)
* points to a Cell
* usually the mapping between PG and Cells is 1:1, but not always
......
......@@ -25,7 +25,7 @@ DVD allows the user to jump about at will (much like those
popular a while back).
Such features are usually referred to under the moniker
'interactive' by marketting people but you aren't in marketting
'interactive' by marketing people but you aren't in marketing
since you are reading the <tt>libdvdnav</tt> tutorial. We'll
assume you actually want to know precisely what DVD can do.
......@@ -91,7 +91,7 @@ multiple Cells per Part.
A VOBU (<I>V</I>ideo <I>OB</I>ject <I>U</I>nit) is a small (typically a few
seconds) of video. It must be a self contained 'Group of Pictures' which
can be understood by the MPEG decoder. All seeking, jumping, etc is guaranteed
to occurr at a VOBU boundary so that the decoder need not be restarted and that
to occur at a VOBU boundary so that the decoder need not be restarted and that
the location jumped to is always the start of a valid MPEG stream. For multiple-angle
DVDs VOBUs for each angle can be interleaved into one Interleaved Video Unit (ILVU).
In this case when the player get to the end of the VOBU for angle <i>n</i> instead of
......
......@@ -32,7 +32,7 @@
/* which is the default language for menus/audio/subpictures? */
#define DVD_LANGUAGE "en"
#ifdef WIN32
#ifdef _WIN32
#define S_IRWXG 0
#endif
......@@ -228,7 +228,7 @@ int main(int argc, char **argv) {
printf("Found %i DVD menu buttons...\n", pci->hli.hl_gi.btn_ns);
for (button = 0; button < pci->hli.hl_gi.btn_ns; button++) {
btni_t *btni = &(pci->hli.btnit[button]);
const btni_t *btni = &(pci->hli.btnit[button]);
printf("Button %i top-left @ (%i,%i), bottom-right @ (%i,%i)\n",
button + 1, btni->x_start, btni->y_start,
btni->x_end, btni->y_end);
......
......@@ -7,6 +7,6 @@ Name: libdvdnav
Description: DVD Navigation library
Version: @VERSION@
Requires.private: dvdread >= 4.1.2
Requires.private: dvdread >= @DVDREAD_MIN_VERSION@
Cflags: -I${includedir} @THREAD_CFLAGS@
Libs: -L${libdir} -ldvdnav @THREAD_LIBS@
#include <string.h>
void bcopy(const void *IN, void *OUT, size_t N);
void bcopy(const void *IN, void *OUT, size_t N)
{
memcpy(OUT, IN, N);
}
/*
Implementation of POSIX directory browsing functions and types for Win32.
Kevlin Henney (mailto:kevlin@acm.org), March 1997.
Copyright Kevlin Henney, 1997. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
This software is supplied "as is" without express or implied warranty.
But that said, if there are any problems please get in touch.
*/
#include <dirent.h>
#include <errno.h>
#include <io.h>
#include <stdlib.h>
#include <string.h>
#ifndef DIR
struct DIR
{
long handle; /* -1 for failed rewind */
struct _finddata_t info;
struct dirent result; /* d_name null iff first time */
char *name; /* NTBS */
};
#endif
DIR *opendir(const char *name)
{
DIR *dir = 0;
if(name && name[0])
{
size_t base_length = strlen(name);
const char *all = /* the root directory is a special case... */
strchr("/\\", name[base_length - 1]) ? "*" : "/*";
if((dir = (DIR *) malloc(sizeof *dir)) != 0 &&
(dir->name = (char *) malloc(base_length + strlen(all) + 1)) != 0)
{
strcat(strcpy(dir->name, name), all);
if((dir->handle = _findfirst(dir->name, &dir->info)) != -1)
{
dir->result.d_name = 0;
}
else /* rollback */
{
free(dir->name);
free(dir);
dir = 0;
}
}
else /* rollback */
{
free(dir);
dir = 0;
errno = ENOMEM;
}
}
else
{
errno = EINVAL;
}
return dir;
}
int closedir(DIR *dir)
{
int result = -1;
if(dir)
{
if(dir->handle != -1)
{
result = _findclose(dir->handle);
}
free(dir->name);
free(dir);
}
if(result == -1) /* map all errors to EBADF */
{
errno = EBADF;
}
return result;
}
struct dirent *readdir(DIR *dir)
{
struct dirent *result = 0;
if(dir && dir->handle != -1)
{
if(!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1)
{
result = &dir->result;
result->d_name = dir->info.name;
}
}
else
{
errno = EBADF;
}
return result;
}
void rewinddir(DIR *dir)
{
if(dir && dir->handle != -1)
{
_findclose(dir->handle);
dir->handle = _findfirst(dir->name, &dir->info);
dir->result.d_name = 0;
}
else
{
errno = EBADF;
}
}
/*
Declaration of POSIX directory browsing functions and types for Win32.
Kevlin Henney (mailto:kevlin@acm.org), March 1997.
Copyright Kevlin Henney, 1997. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose is hereby granted without fee, provided
that this copyright and permissions notice appear in all copies and
derivatives, and that no charge may be made for the software and its
documentation except to cover cost of distribution.
*/
#ifndef DIRENT_INCLUDED
#define DIRENT_INCLUDED
typedef struct DIR DIR;
struct dirent
{
char *d_name;
};
DIR *opendir(const char *);
int closedir(DIR *);
struct dirent *readdir(DIR *);
void rewinddir(DIR *);
#endif
/*
* Adopted from Apache DSO code.
* Portions copyright Apache Software Foundation
*
* Structures and types used to implement dlopen, dlsym, etc.
* on Windows 95/NT.
*/
#include <windows.h>
#include <string.h>
#include <stdio.h>
#include "dlfcn.h"
#include "os_types.h"
void *dlopen(const char *module_name, int mode)
{
UINT em;
HINSTANCE dsoh;
char path[MAX_PATH], *p;
/* Load the module...
* per PR2555, the LoadLibraryEx function is very picky about slashes.
* Debugging on NT 4 SP 6a reveals First Chance Exception within NTDLL.
* LoadLibrary in the MS PSDK also reveals that it -explicitly- states
* that backslashes must be used.
*
* Transpose '\' for '/' in the filename.
*/
(void)strncpy(path, module_name, MAX_PATH);
p = path;
while (p = strchr(p, '/'))
*p = '\\';
/* First assume the dso/dll's required by -this- dso are sitting in the
* same path or can be found in the usual places. Failing that, let's
* let that dso look in the apache root.
*/
em = SetErrorMode(SEM_FAILCRITICALERRORS);
dsoh = LoadLibraryEx(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
if (!dsoh)
{
SetLastError(0); // clear the last error
dsoh = LoadLibraryEx(path, NULL, 0);
}
SetErrorMode(em);
SetLastError(0); // clear the last error
return (void *)dsoh;
}
char *dlerror(void)
{
int len, nErrorCode;
static char errstr[120];
/* This is -not- threadsafe code, but it's about the best we can do.
* mostly a potential problem for isapi modules, since LoadModule
* errors are handled within a single config thread.
*/
if((nErrorCode = GetLastError()) == 0)
return((char *)0);
SetLastError(0); // clear the last error
len = snprintf(errstr, sizeof(errstr), "(%d) ", nErrorCode);
len += FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
nErrorCode,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
(LPTSTR) errstr + len,
sizeof(errstr) - len,
NULL
);
/* FormatMessage may have appended a newline (\r\n). So remove it
* and use ": " instead like the Unix errors. The error may also
* end with a . before the return - if so, trash it.
*/
if (len > 1 && errstr[len-2] == '\r' && errstr[len-1] == '\n') {
if (len > 2 && errstr[len-3] == '.')
len--;
errstr[len-2] = ':';
errstr[len-1] = ' ';
}
return errstr;
}
int dlclose(void *handle)
{
return FreeLibrary(handle);
}
void *dlsym(void *handle, const char *name)
{
return GetProcAddress(handle, name);
}
......@@ -32,7 +32,7 @@
accurate unix time with the data
accurate to the first call to get
of day and the resolution accurate
to ~ miliseconds.
to ~ milliseconds.
*/
static time_t startseconds = 0;
......@@ -41,7 +41,7 @@ int gettimeofday( struct timeval *tp, struct timezone *tzp )
{
MMTIME mmtime;
// clock() returns time in miliseconds
// clock() returns time in milliseconds
if( !startseconds )
startseconds = time( 0 );
......@@ -55,7 +55,7 @@ int gettimeofday( struct timeval *tp, struct timezone *tzp )
};
/*
These functions are designed to mimick
These functions are designed to mimic
a subset of itimer for use with the
alarm signal on win32. This is just
enough for xine to work.
......@@ -65,14 +65,14 @@ static HANDLE sigalarm = 0;
int setitimer( int which, struct itimerval * value, struct itimerval *ovalue )
{
long int miliseconds;
long int milliseconds;
if( !sigalarm )
sigalarm = CreateEvent( 0, FALSE, TRUE, "SIGALARM" );
miliseconds = value->it_value.tv_usec / 1000;
milliseconds = value->it_value.tv_usec / 1000;
timeSetEvent( miliseconds, 0, ( LPTIMECALLBACK ) sigalarm, 0, TIME_PERIODIC | TIME_CALLBACK_EVENT_PULSE );
timeSetEvent( milliseconds, 0, ( LPTIMECALLBACK ) sigalarm, 0, TIME_PERIODIC | TIME_CALLBACK_EVENT_PULSE );
return 0;
}
......
#ifndef __DLFCN_H__
# define __DLFCN_H__
extern void *dlopen (const char *file, int mode);
extern int dlclose (void *handle);
extern void *dlsym (void * handle, const char * name);
extern char *dlerror (void);
/* These don't mean anything on windows */
#define RTLD_NEXT ((void *) -1l)
#define RTLD_DEFAULT ((void *) 0)
#define RTLD_LAZY -1
#define RTLD_NOW -1
#define RTLD_BINDING_MASK -1
#define RTLD_NOLOAD -1
#define RTLD_GLOBAL -1
#endif /* __DLFCN_H__ */
......@@ -37,7 +37,6 @@
#include "dvd_reader.h"
#include "ifo_read.h"
#include "ifo_types.h"
/* Uncomment for VM command tracing */
/* #define TRACE */
......