summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore1
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac17
-rw-r--r--debian/changelog2
-rw-r--r--debian/control3
-rw-r--r--include/xine.h.in54
-rw-r--r--lib/os_internal.h4
-rw-r--r--m4/Makefile.am2
-rw-r--r--m4/attributes.m4403
-rw-r--r--m4/libtool15.m46168
-rw-r--r--m4/misc.m455
-rw-r--r--m4/pthreads.m439
-rw-r--r--misc/xine-config.in5
-rw-r--r--po/cs.po133
-rw-r--r--po/de.po133
-rw-r--r--po/eo.po134
-rw-r--r--po/es.po134
-rw-r--r--po/eu.po133
-rw-r--r--po/fr.po128
-rw-r--r--po/it.po134
-rw-r--r--po/libxine1.pot93
-rw-r--r--po/sk.po130
-rw-r--r--po/tr.po132
-rw-r--r--src/audio_out/audio_alsa_out.c48
-rw-r--r--src/audio_out/audio_arts_out.c4
-rw-r--r--src/audio_out/audio_coreaudio_out.c4
-rw-r--r--src/audio_out/audio_directx2_out.c4
-rw-r--r--src/audio_out/audio_directx_out.c4
-rw-r--r--src/audio_out/audio_esd_out.c4
-rw-r--r--src/audio_out/audio_file_out.c4
-rw-r--r--src/audio_out/audio_fusionsound_out.c6
-rw-r--r--src/audio_out/audio_jack_out.c1141
-rw-r--r--src/audio_out/audio_none_out.c4
-rw-r--r--src/audio_out/audio_oss_out.c54
-rw-r--r--src/audio_out/audio_pulse_out.c4
-rw-r--r--src/audio_out/audio_sun_out.c4
-rw-r--r--src/combined/combined_wavpack.h3
-rw-r--r--src/combined/decoder_flac.c6
-rw-r--r--src/combined/decoder_wavpack.c4
-rw-r--r--src/combined/demux_flac.c4
-rw-r--r--src/combined/demux_wavpack.c4
-rw-r--r--src/combined/ffmpeg/ff_audio_decoder.c18
-rw-r--r--src/combined/ffmpeg/ff_dvaudio_decoder.c8
-rw-r--r--src/combined/ffmpeg/ff_mpeg_parser.c2
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c18
-rw-r--r--src/combined/ffmpeg/ffmpeg_encoder.c2
-rw-r--r--src/demuxers/asfheader.c9
-rw-r--r--src/demuxers/asfheader.h2
-rw-r--r--src/demuxers/demux_4xm.c6
-rw-r--r--src/demuxers/demux_aac.c4
-rw-r--r--src/demuxers/demux_ac3.c4
-rw-r--r--src/demuxers/demux_aiff.c6
-rw-r--r--src/demuxers/demux_asf.c4
-rw-r--r--src/demuxers/demux_aud.c4
-rw-r--r--src/demuxers/demux_avi.c20
-rw-r--r--src/demuxers/demux_cdda.c4
-rw-r--r--src/demuxers/demux_dts.c4
-rw-r--r--src/demuxers/demux_eawve.c4
-rw-r--r--src/demuxers/demux_elem.c4
-rw-r--r--src/demuxers/demux_film.c12
-rw-r--r--src/demuxers/demux_flac.c4
-rw-r--r--src/demuxers/demux_fli.c4
-rw-r--r--src/demuxers/demux_flv.c6
-rw-r--r--src/demuxers/demux_idcin.c4
-rw-r--r--src/demuxers/demux_iff.c28
-rw-r--r--src/demuxers/demux_image.c4
-rw-r--r--src/demuxers/demux_ipmovie.c4
-rw-r--r--src/demuxers/demux_matroska.c17
-rw-r--r--src/demuxers/demux_mng.c4
-rw-r--r--src/demuxers/demux_mod.c4
-rw-r--r--src/demuxers/demux_mpc.c4
-rw-r--r--src/demuxers/demux_mpeg.c4
-rw-r--r--src/demuxers/demux_mpeg_block.c4
-rw-r--r--src/demuxers/demux_mpeg_pes.c9
-rw-r--r--src/demuxers/demux_mpgaudio.c16
-rw-r--r--src/demuxers/demux_nsf.c4
-rw-r--r--src/demuxers/demux_nsv.c4
-rw-r--r--src/demuxers/demux_ogg.c75
-rw-r--r--src/demuxers/demux_pva.c4
-rw-r--r--src/demuxers/demux_qt.c13
-rw-r--r--src/demuxers/demux_rawdv.c4
-rw-r--r--src/demuxers/demux_real.c6
-rw-r--r--src/demuxers/demux_realaudio.c6
-rw-r--r--src/demuxers/demux_roq.c4
-rw-r--r--src/demuxers/demux_shn.c4
-rw-r--r--src/demuxers/demux_slave.c10
-rw-r--r--src/demuxers/demux_smjpeg.c4
-rw-r--r--src/demuxers/demux_snd.c4
-rw-r--r--src/demuxers/demux_str.c8
-rw-r--r--src/demuxers/demux_ts.c38
-rw-r--r--src/demuxers/demux_tta.c4
-rw-r--r--src/demuxers/demux_vmd.c4
-rw-r--r--src/demuxers/demux_voc.c4
-rw-r--r--src/demuxers/demux_vox.c4
-rw-r--r--src/demuxers/demux_vqa.c4
-rw-r--r--src/demuxers/demux_wav.c6
-rw-r--r--src/demuxers/demux_wc3movie.c8
-rw-r--r--src/demuxers/demux_yuv4mpeg2.c4
-rw-r--r--src/demuxers/demux_yuv_frames.c4
-rw-r--r--src/demuxers/ebml.h2
-rw-r--r--src/dxr3/dxr3_decode_spu.c6
-rw-r--r--src/dxr3/dxr3_decode_video.c4
-rw-r--r--src/dxr3/dxr3_mpeg_encoders.c4
-rw-r--r--src/dxr3/dxr3_scr.c2
-rw-r--r--src/dxr3/video_out_dxr3.c16
-rw-r--r--src/input/http_helper.c3
-rw-r--r--src/input/input_cdda.c73
-rw-r--r--src/input/input_dvb.c85
-rw-r--r--src/input/input_dvd.c61
-rw-r--r--src/input/input_file.c42
-rw-r--r--src/input/input_http.c89
-rw-r--r--src/input/input_mms.c4
-rw-r--r--src/input/input_net.c4
-rw-r--r--src/input/input_plugin.h83
-rw-r--r--src/input/input_pnm.c4
-rw-r--r--src/input/input_pvr.c29
-rw-r--r--src/input/input_rtp.c4
-rw-r--r--src/input/input_rtsp.c7
-rw-r--r--src/input/input_smb.c38
-rw-r--r--src/input/input_stdin_fifo.c4
-rw-r--r--src/input/input_v4l.c139
-rw-r--r--src/input/input_vcd.c67
-rw-r--r--src/input/libreal/asmrp.c2
-rw-r--r--src/input/libreal/real.c7
-rw-r--r--src/input/libreal/rmff.h6
-rw-r--r--src/input/libreal/sdpplin.c8
-rw-r--r--src/input/libreal/sdpplin.h2
-rw-r--r--src/input/librtsp/rtsp.c60
-rw-r--r--src/input/librtsp/rtsp.h2
-rw-r--r--src/input/librtsp/rtsp_session.c2
-rw-r--r--src/input/librtsp/rtsp_session.h2
-rw-r--r--src/input/mms.c14
-rw-r--r--src/input/mmsh.c6
-rw-r--r--src/input/net_buf_ctrl.c6
-rw-r--r--src/input/net_buf_ctrl.h2
-rw-r--r--src/input/pnm.c23
-rw-r--r--src/input/vcd/xine-extra.c10
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c6
-rw-r--r--src/liba52/parse.c2
-rw-r--r--src/liba52/xine_a52_decoder.c4
-rw-r--r--src/libdts/xine_dts_decoder.c4
-rw-r--r--src/libfaad/xine_faad_decoder.c8
-rw-r--r--src/libmad/xine_mad_decoder.c4
-rw-r--r--src/libmpeg2/xine_mpeg2_decoder.c4
-rw-r--r--src/libmpeg2new/xine_mpeg2new_decoder.c4
-rw-r--r--src/libmusepack/xine_musepack_decoder.c6
-rw-r--r--src/libreal/xine_real_audio_decoder.c10
-rw-r--r--src/libreal/xine_real_video_decoder.c6
-rw-r--r--src/libspucc/cc_decoder.c6
-rw-r--r--src/libspucc/xine_cc_decoder.c4
-rw-r--r--src/libspucmml/xine_cmml_decoder.c54
-rw-r--r--src/libspudec/spu.c2
-rw-r--r--src/libspudec/xine_spu_decoder.c10
-rw-r--r--src/libspudvb/xine_spudvb_decoder.c10
-rw-r--r--src/libsputext/demux_sputext.c59
-rw-r--r--src/libsputext/xine_sputext_decoder.c6
-rw-r--r--src/libw32dll/qt_decoder.c8
-rw-r--r--src/libw32dll/w32codec.c8
-rw-r--r--src/libw32dll/wine/registry.c3
-rw-r--r--src/libw32dll/wine/win32.c4
-rw-r--r--src/libxineadec/fooaudio.c4
-rw-r--r--src/libxineadec/gsm610.c6
-rw-r--r--src/libxineadec/nsf.c6
-rw-r--r--src/libxineadec/xine_lpcm_decoder.c4
-rw-r--r--src/libxineadec/xine_speex_decoder.c10
-rw-r--r--src/libxineadec/xine_vorbis_decoder.c6
-rw-r--r--src/libxinevdec/bitplane.c24
-rw-r--r--src/libxinevdec/foovideo.c4
-rw-r--r--src/libxinevdec/gdkpixbuf.c4
-rw-r--r--src/libxinevdec/image.c4
-rw-r--r--src/libxinevdec/rgb.c6
-rw-r--r--src/libxinevdec/xine_theora_decoder.c4
-rw-r--r--src/libxinevdec/yuv.c4
-rw-r--r--src/post/audio/stretch.c6
-rw-r--r--src/post/audio/upmix.c4
-rw-r--r--src/post/audio/upmix_mono.c34
-rw-r--r--src/post/audio/volnorm.c7
-rw-r--r--src/post/deinterlace/xine_plugin.c4
-rw-r--r--src/post/goom/goom_core.c4
-rw-r--r--src/post/goom/xine_goom.c4
-rw-r--r--src/post/mosaico/mosaico.c11
-rw-r--r--src/post/mosaico/switch.c4
-rw-r--r--src/post/planar/boxblur.c2
-rw-r--r--src/post/planar/denoise3d.c2
-rw-r--r--src/post/planar/eq.c2
-rw-r--r--src/post/planar/eq2.c29
-rw-r--r--src/post/planar/expand.c2
-rw-r--r--src/post/planar/fill.c2
-rw-r--r--src/post/planar/invert.c2
-rw-r--r--src/post/planar/noise.c2
-rw-r--r--src/post/planar/pp.c15
-rw-r--r--src/post/planar/unsharp.c9
-rw-r--r--src/post/visualizations/fftgraph.c2
-rw-r--r--src/post/visualizations/fftscope.c2
-rw-r--r--src/post/visualizations/fooviz.c2
-rw-r--r--src/post/visualizations/oscope.c2
-rw-r--r--src/video_out/video_out_aa.c6
-rw-r--r--src/video_out/video_out_caca.c6
-rw-r--r--src/video_out/video_out_directfb.c14
-rw-r--r--src/video_out/video_out_directx.c6
-rw-r--r--src/video_out/video_out_fb.c6
-rw-r--r--src/video_out/video_out_macosx.m6
-rw-r--r--src/video_out/video_out_none.c6
-rw-r--r--src/video_out/video_out_opengl.c18
-rw-r--r--src/video_out/video_out_pgx32.c6
-rw-r--r--src/video_out/video_out_pgx64.c6
-rw-r--r--src/video_out/video_out_raw.c6
-rw-r--r--src/video_out/video_out_sdl.c6
-rw-r--r--src/video_out/video_out_stk.c6
-rw-r--r--src/video_out/video_out_syncfb.c6
-rw-r--r--src/video_out/video_out_vidix.c6
-rw-r--r--src/video_out/video_out_xcbshm.c6
-rw-r--r--src/video_out/video_out_xcbxv.c6
-rw-r--r--src/video_out/video_out_xshm.c6
-rw-r--r--src/video_out/video_out_xv.c6
-rw-r--r--src/video_out/video_out_xvmc.c8
-rw-r--r--src/video_out/video_out_xxmc.c18
-rw-r--r--src/video_out/x11osd.c2
-rw-r--r--src/video_out/xcbosd.c2
-rw-r--r--src/video_out/yuv2rgb.c2
-rw-r--r--src/video_out/yuv2rgb_mlib.c2
-rw-r--r--src/xine-engine/alphablend.c8
-rw-r--r--src/xine-engine/alphablend.h21
-rw-r--r--src/xine-engine/audio_out.c16
-rw-r--r--src/xine-engine/audio_out.h2
-rw-r--r--src/xine-engine/broadcaster.c2
-rw-r--r--src/xine-engine/broadcaster.h2
-rw-r--r--src/xine-engine/buffer.c4
-rw-r--r--src/xine-engine/buffer.h12
-rw-r--r--src/xine-engine/configfile.c11
-rw-r--r--src/xine-engine/configfile.h2
-rw-r--r--src/xine-engine/demux.c9
-rw-r--r--src/xine-engine/info_helper.c13
-rw-r--r--src/xine-engine/input_cache.c4
-rw-r--r--src/xine-engine/input_rip.c9
-rw-r--r--src/xine-engine/load_plugins.c272
-rw-r--r--src/xine-engine/lrb.c2
-rw-r--r--src/xine-engine/metronom.c9
-rw-r--r--src/xine-engine/metronom.h4
-rw-r--r--src/xine-engine/osd.c30
-rw-r--r--src/xine-engine/osd.h2
-rw-r--r--src/xine-engine/post.c14
-rw-r--r--src/xine-engine/refcounter.c2
-rw-r--r--src/xine-engine/refcounter.h2
-rw-r--r--src/xine-engine/scratch.c7
-rw-r--r--src/xine-engine/scratch.h2
-rw-r--r--src/xine-engine/video_out.c6
-rw-r--r--src/xine-engine/video_out.h2
-rw-r--r--src/xine-engine/video_overlay.c6
-rw-r--r--src/xine-engine/video_overlay.h2
-rw-r--r--src/xine-engine/xine.c174
-rw-r--r--src/xine-engine/xine_interface.c4
-rw-r--r--src/xine-engine/xine_internal.h7
-rw-r--r--src/xine-utils/Makefile.am2
-rw-r--r--src/xine-utils/array.h2
-rw-r--r--src/xine-utils/attributes.h51
-rw-r--r--src/xine-utils/list.c4
-rw-r--r--src/xine-utils/list.h2
-rw-r--r--src/xine-utils/monitor.c10
-rw-r--r--src/xine-utils/pool.c2
-rw-r--r--src/xine-utils/pool.h2
-rw-r--r--src/xine-utils/ring_buffer.h2
-rw-r--r--src/xine-utils/sorted_array.h2
-rw-r--r--src/xine-utils/utils.c32
-rw-r--r--src/xine-utils/xine_buffer.c4
-rw-r--r--src/xine-utils/xine_check.c79
-rw-r--r--src/xine-utils/xine_check.h39
-rw-r--r--src/xine-utils/xineutils.h17
-rw-r--r--src/xine-utils/xmllexer.c3
-rw-r--r--src/xine-utils/xmlparser.c15
270 files changed, 3252 insertions, 9068 deletions
diff --git a/.hgignore b/.hgignore
index d310df4af..f5788f1cc 100644
--- a/.hgignore
+++ b/.hgignore
@@ -40,6 +40,7 @@ debian/libxine1-dbg
debian/libxine1-doc
debian/tmp
debian/*.debhelper
+debian/*.debhelper.log
debian/*.substvars
doc/faq/faq.html
diff --git a/ChangeLog b/ChangeLog
index 1d86a99f3..1ddd6c3a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,4 @@
-xine-lib (1.1.12.1) 2008-??-??
+xine-lib (1.1.13) 2008-??-??
* Security fixes:
- Buffer overflow in the NSF demuxer which may allow remote attackers to
cause a denial of service (crash) or possibly execute arbitrary code
@@ -7,6 +7,9 @@ xine-lib (1.1.12.1) 2008-??-??
in CVE-2008-1482, backport more calloc usage from 1.2 branch.
* Added MIME types and .mpp for musepack.
* Fixed display of some MJPEG streams (YUVJ420P).
+ * Deprecate xine_xmalloc() function, see src/xine-utils/utils.c for more
+ information about the reason.
+ * Provide a useful implementation of xine_register_log_cb().
xine-lib (1.1.12) 2008-04-14
* Security fixes:
diff --git a/configure.ac b/configure.ac
index de176fc9e..2a3689fdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl XINE_SUB += 1; XINE_PATCH = ''; continue with XINE_LT_* values below
dnl
XINE_MAJOR=1
XINE_MINOR=1
-XINE_SUB=12
+XINE_SUB=13
dnl XINE_PATCH should be left empty or set to ".1" or ".2" or something similar
XINE_PATCH=
dnl Release series number (usually $XINE_MAJOR.$XINE_MINOR)
@@ -53,9 +53,9 @@ dnl are platform dependent
dnl * in Linux, the library will be named
dnl libname.so.(XINE_LT_CURRENT - XINE_LT_AGE).XINE_LT_AGE.XINE_LT_REVISION
-XINE_LT_CURRENT=22
+XINE_LT_CURRENT=23
XINE_LT_REVISION=0
-XINE_LT_AGE=21
+XINE_LT_AGE=22
dnl for a release tarball do "rm .cvsversion" before "make dist"
if test -f "${srcdir-.}/.cvsversion"; then
@@ -2177,6 +2177,10 @@ AC_CHECK_FUNC(opendir,
AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)])
fi])
+XINE_CHECK_MINMAX([], [
+ AC_DEFINE([MIN(x, y)], [(x > y) ? y : x], [Get the minimum value between two])
+ AC_DEFINE([MAX(x, y)], [(x > y) ? x : y], [Get the maximum value between two])
+ ])
dnl ---------------------------------------------
dnl cflags and debug cflags
@@ -2217,6 +2221,9 @@ CC_ATTRIBUTE_FORMAT
CC_ATTRIBUTE_FORMAT_ARG
CC_ATTRIBUTE_DEPRECATED
CC_ATTRIBUTE_UNUSED
+CC_ATTRIBUTE_MALLOC
+CC_ATTRIBUTE_PACKED
+CC_ATTRIBUTE_CONST
AC_OPTIMIZATIONS
@@ -2295,19 +2302,21 @@ case "$host_or_hostalias" in
esac
AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
else
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
fi
+ AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
;;
mips-*)
AC_DEFINE_UNQUOTED(FPM_MIPS,,[Define to select libmad fixed point arithmetic implementation])
;;
alphaev56-* | alpha* | ia64-* | hppa*-linux-*)
AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
+ AC_DEFINE_UNQUOTED(ARCH_ALPHA,,[Define this if you're running Alpha architecture])
;;
armv4l-*-linux*)
AC_DEFINE_UNQUOTED(FPM_ARM,,[Define to select libmad fixed point arithmetic implementation])
+ AC_DEFINE_UNQUOTED(ARCH_ARM,,[Define this if you're running ARM architecture])
enable_armv4l="yes"
;;
*)
diff --git a/debian/changelog b/debian/changelog
index cd6e353a3..b2a4a7fba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xine-lib (1.1.12~hg-0) unstable; urgency=low
+xine-lib (1.1.13~hg-0) unstable; urgency=low
[ Darren Salt ]
* Hg snapshot.
diff --git a/debian/control b/debian/control
index f83f8f650..f111cd087 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,8 @@ Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config,
libcam-dev [kfreebsd-i386 kfreebsd-amd64],
libaa1-dev, libcaca-dev, libmodplug-dev,
libjack-dev, libpulse-dev, libartsc0-dev,
- libmagick9-dev | libmagick-dev, libpng12-dev, libfreetype6-dev,
+ libmagick9-dev | libmagick-dev |libmagickwand-dev,
+ libpng12-dev, libfreetype6-dev,
libogg-dev, libvorbis-dev, libtheora-dev,
libesd0-dev, libgnomevfs2-dev,
liblircclient-dev,
diff --git a/include/xine.h.in b/include/xine.h.in
index ad79bebc6..62cfa8747 100644
--- a/include/xine.h.in
+++ b/include/xine.h.in
@@ -431,8 +431,13 @@ int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED;
* image data into a too small buffer.
*
* xine_get_current_frame_alloc() takes care of allocating
- * a buffer on it's own, so image data can be retrieved by
+ * a buffer on its own, so image data can be retrieved by
* a single call without the need to pause the stream.
+ *
+ * xine_get_current_frame_data() passes the parameters of the
+ * previously mentioned functions plus further information in
+ * a structure and can work like the _s or _alloc function
+ * respectively depending on the passed flags.
*
* all functions return 1 on success, 0 failure.
*/
@@ -444,12 +449,33 @@ int xine_get_current_frame (xine_stream_t *stream,
int xine_get_current_frame_s (xine_stream_t *stream,
int *width, int *height,
int *ratio_code, int *format,
- uint8_t *img, int *size) XINE_PROTECTED;
+ uint8_t *img, int *img_size) XINE_PROTECTED;
int xine_get_current_frame_alloc (xine_stream_t *stream,
int *width, int *height,
int *ratio_code, int *format,
- uint8_t **img, int *size) XINE_PROTECTED;
+ uint8_t **img, int *img_size) XINE_PROTECTED;
+
+typedef struct {
+
+ int width;
+ int height;
+ int crop_left;
+ int crop_right;
+ int crop_top;
+ int crop_bottom;
+ int ratio_code;
+ int interlaced;
+ int format;
+ int img_size;
+ uint8_t *img;
+} xine_current_frame_data_t;
+
+#define XINE_FRAME_DATA_ALLOCATE_IMG (1<<0)
+
+int xine_get_current_frame_data (xine_stream_t *stream,
+ xine_current_frame_data_t *data,
+ int flags) XINE_PROTECTED;
/* xine image formats */
#define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y')
@@ -826,7 +852,7 @@ char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED;
/* log callback will be called whenever something is logged */
typedef void (*xine_log_cb_t) (void *user_data, int section);
void xine_register_log_cb (xine_t *self, xine_log_cb_t cb,
- void *user_data) XINE_PROTECTED XINE_DEPRECATED;
+ void *user_data) XINE_PROTECTED;
/*
* error handling / engine status
@@ -1133,7 +1159,7 @@ typedef struct {
*
* this will be called by the video driver to find out
* how big the video output area size will be for a
- * given video size. The ui should _not_ adjust it's
+ * given video size. The ui should _not_ adjust its
* video out area, just do some calculations and return
* the size. This will be called for every frame, ui
* implementation should be fast.
@@ -1157,12 +1183,12 @@ typedef struct {
* frame output callback
*
* this will be called by the video driver for every frame
- * it's about to draw. ui can adapt it's size if necessary
+ * it's about to draw. ui can adapt its size if necessary
* here.
* note: the ui doesn't have to adjust itself to this
* size, this is just to be taken as a hint.
* ui must return the actual size of the video output
- * area and the video output driver will do it's best
+ * area and the video output driver will do its best
* to adjust the video frames to that size (while
* preserving aspect ratio and stuff).
* dest_x, dest_y: offset inside window
@@ -1233,7 +1259,7 @@ typedef struct {
*
* this will be called by the video driver to find out
* how big the video output area size will be for a
- * given video size. The ui should _not_ adjust it's
+ * given video size. The ui should _not_ adjust its
* video out area, just do some calculations and return
* the size. This will be called for every frame, ui
* implementation should be fast.
@@ -1257,12 +1283,12 @@ typedef struct {
* frame output callback
*
* this will be called by the video driver for every frame
- * it's about to draw. ui can adapt it's size if necessary
+ * it's about to draw. ui can adapt its size if necessary
* here.
* note: the ui doesn't have to adjust itself to this
* size, this is just to be taken as a hint.
* ui must return the actual size of the video output
- * area and the video output driver will do it's best
+ * area and the video output driver will do its best
* to adjust the video frames to that size (while
* preserving aspect ratio and stuff).
* dest_x, dest_y: offset inside window
@@ -1319,7 +1345,7 @@ typedef struct {
* So a frontend must at least support rgb.
* Be aware that rgb requires more cpu than yuv,
* so avoid its usage for video playback.
- * However, it's usefull for single frame capture (e.g. thumbs)
+ * However, it's useful for single frame capture (e.g. thumbs)
*/
int supported_formats;
@@ -1618,7 +1644,7 @@ int xine_config_lookup_entry (xine_t *self, const char *key,
/*
* update a config entry (which was returned from lookup_entry() )
*
- * xine will make a deep copy of the data in the entry into it's internal
+ * xine will make a deep copy of the data in the entry into its internal
* config database.
*/
void xine_config_update_entry (xine_t *self,
@@ -2013,8 +2039,8 @@ typedef struct {
* This is the mechanism to report async errors from engine.
*
* If frontend knows about the XINE_MSG_xxx type it may safely
- * ignore the 'explanation' field and provide it's own custom
- * dialog to the 'parameters'.
+ * ignore the 'explanation' field and provide its own custom
+ * dialogue to the 'parameters'.
*
* right column specifies the usual parameters.
*/
diff --git a/lib/os_internal.h b/lib/os_internal.h
index 11601bbdf..6e6e14a3d 100644
--- a/lib/os_internal.h
+++ b/lib/os_internal.h
@@ -4,6 +4,10 @@
#include <stddef.h>
#include <stdarg.h>
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
+
#ifdef HOST_OS_DARWIN
/* Darwin (Mac OS X) needs __STDC_LIBRARY_SUPPORTED__ for SCNx64 and
* SCNxMAX macros */
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 3a5209dc3..bcaa78a49 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST = glibc2.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-p
lcmessage.m4 \
libFLAC.m4 \
libfame.m4 \
- libtool15.m4 \
+ misc.m4 \
opengl.m4 \
optimizations.m4 \
pkg.m4 \
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index a74280696..3fee49ab5 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -32,22 +32,43 @@ dnl distribute a modified version of the Autoconf Macro, you may extend
dnl this special exception to the GPL to apply to your modified version as
dnl well.
-AC_DEFUN([CC_CHECK_CFLAGS], [
- AC_CACHE_CHECK([if $CC supports $1 flag],
- AS_TR_SH([cc_cv_cflags_$1]),
+AC_DEFUN([CC_CHECK_CFLAGS_SILENT], [
+ AC_CACHE_VAL(AS_TR_SH([cc_cv_cflags_$1]),
[ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $1"
AC_COMPILE_IFELSE([int a;],
[eval "AS_TR_SH([cc_cv_cflags_$1])='yes'"],
- [eval "AS_TR_SH([cc_cv_cflags_$1])="])
+ [eval "AS_TR_SH([cc_cv_cflags_$1])='no'"])
CFLAGS="$ac_save_CFLAGS"
])
- if eval test [x$]AS_TR_SH([cc_cv_cflags_$1]) = xyes; then
- ifelse([$2], , [:], [$2])
- else
- ifelse([$3], , [:], [$3])
- fi
+ AS_IF([test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
+ [$2], [$3])
+])
+
+AC_DEFUN([CC_CHECK_CFLAGS], [
+ AC_CACHE_CHECK([if $CC supports $1 flag],
+ AS_TR_SH([cc_cv_cflags_$1]),
+ CC_CHECK_CFLAGS_SILENT([$1]) dnl Don't execute actions here!
+ )
+
+ AS_IF([test x$]AS_TR_SH([cc_cv_cflags_$1])[ = xyes],
+ [$2], [$3])
+])
+
+AC_DEFUN([CC_CHECK_LDFLAGS], [
+ AC_CACHE_CHECK([if $CC supports $1 flag],
+ AS_TR_SH([cc_cv_ldflags_$1]),
+ [ac_save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $1"
+ AC_LINK_IFELSE([int main() { return 1; }],
+ [eval "AS_TR_SH([cc_cv_ldflags_$1])='yes'"],
+ [eval "AS_TR_SH([cc_cv_ldflags_$1])="])
+ LDFLAGS="$ac_save_LDFLAGS"
+ ])
+
+ AS_IF([test x$]AS_TR_SH([cc_cv_ldflags_$1])[ = xyes],
+ [$2], [$3])
])
dnl Check for a -Werror flag or equivalent. -Werror is the GCC
@@ -59,246 +80,159 @@ dnl Other compilers don't support -Werror per se, but they support
dnl an equivalent flag:
dnl - Sun Studio compiler supports -errwarn=%all
AC_DEFUN([CC_CHECK_WERROR], [
- AC_CACHE_VAL([cc_cv_werror],
- [CC_CHECK_CFLAGS([-Werror], [cc_cv_werror=-Werror],
- [CC_CHECK_CFLAGS([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
+ AC_CACHE_CHECK(
+ [for $CC way to treat warnings as errors],
+ [cc_cv_werror],
+ [CC_CHECK_CFLAGS_SILENT([-Werror], [cc_cv_werror=-Werror],
+ [CC_CHECK_CFLAGS_SILENT([-errwarn=%all], [cc_cv_werror=-errwarn=%all])])
])
])
+AC_DEFUN([CC_CHECK_ATTRIBUTE], [
+ AC_REQUIRE([CC_CHECK_WERROR])
+ AC_CACHE_CHECK([if $CC supports __attribute__(( ifelse([$2], , [$1], [$2]) ))],
+ AS_TR_SH([cc_cv_attribute_$1]),
+ [ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $cc_cv_werror"
+ AC_COMPILE_IFELSE([$3],
+ [eval "AS_TR_SH([cc_cv_attribute_$1])='yes'"],
+ [eval "AS_TR_SH([cc_cv_attribute_$1])='no'"])
+ CFLAGS="$ac_save_CFLAGS"
+ ])
+
+ AS_IF([test x$]AS_TR_SH([cc_cv_attribute_$1])[ = xyes],
+ [AC_DEFINE(
+ AS_TR_CPP([SUPPORT_ATTRIBUTE_$1]), 1,
+ [Define this if the compiler supports __attribute__(( ifelse([$2], , [$1], [$2]) ))]
+ )
+ $4],
+ [$5])
+])
+
AC_DEFUN([CC_ATTRIBUTE_CONSTRUCTOR], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((constructor))],
- [cc_cv_attribute_constructor],
- [AC_COMPILE_IFELSE([
- void ctor() __attribute__((constructor));
- void ctor() { int a; };
- ],
- [cc_cv_attribute_constructor=yes],
- [cc_cv_attribute_constructor=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_constructor" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_CONSTRUCTOR], 1, [Define this if the compiler supports the constructor attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [constructor],,
+ [void __attribute__((constructor)) ctor() { int a; }],
+ [$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((format(printf, n, n)))],
- [cc_cv_attribute_format],
- [AC_COMPILE_IFELSE([
- void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }
- ],
- [cc_cv_attribute_format=yes],
- [cc_cv_attribute_format=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_format" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_FORMAT], 1, [Define this if the compiler supports the format attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [format], [format(printf, n, n)],
+ [void __attribute__((format(printf, 1, 2))) printflike(const char *fmt, ...) { fmt = (void *)0; }],
+ [$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_FORMAT_ARG], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((format_arg(printf)))],
- [cc_cv_attribute_format_arg],
- [AC_COMPILE_IFELSE([
- char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }
- ],
- [cc_cv_attribute_format_arg=yes],
- [cc_cv_attribute_format_arg=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_format_arg" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_FORMAT_ARG], 1, [Define this if the compiler supports the format_arg attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [format_arg], [format_arg(printf)],
+ [char *__attribute__((format_arg(1))) gettextlike(const char *fmt) { fmt = (void *)0; }],
+ [$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_VISIBILITY], [
- AC_REQUIRE([CC_CHECK_WERROR])
- AC_CACHE_CHECK([if $CC supports __attribute__((visibility("$1")))],
- AS_TR_SH([cc_cv_attribute_visibility_$1]),
- [ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_COMPILE_IFELSE([void __attribute__((visibility("$1"))) $1_function() { }],
- [eval "AS_TR_SH([cc_cv_attribute_visibility_$1])='yes'"],
- [eval "AS_TR_SH([cc_cv_attribute_visibility_$1])='no'"])
- CFLAGS="$ac_save_CFLAGS"
- ])
-
- if eval test [x$]AS_TR_SH([cc_cv_attribute_visibility_$1]) = xyes; then
- AC_DEFINE(AS_TR_CPP([SUPPORT_ATTRIBUTE_VISIBILITY_$1]), 1, [Define this if the compiler supports __attribute__((visibility("$1")))])
- ifelse([$2], , [:], [$2])
- else
- ifelse([$3], , [:], [$3])
- fi
-])
-
-AC_DEFUN([CC_FLAG_VISIBILITY], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports -fvisibility=hidden],
- [cc_cv_flag_visibility],
- [
- save_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -fvisibility=hidden"
- AC_COMPILE_IFELSE([int a;],
- [cc_cv_flag_visibility=yes],
- [cc_cv_flag_visibility=no])
- CFLAGS="$save_CFLAGS"
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_flag_visibility" = "xyes"; then
- AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1, [Define this if the compiler supports the -fvisibility flag])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [visibility_$1], [visibility("$1")],
+ [void __attribute__((visibility("$1"))) $1_function() { }],
+ [$2], [$3])
])
AC_DEFUN([CC_ATTRIBUTE_NONNULL], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((nonnull()))],
- [cc_cv_attribute_nonnull],
- [AC_COMPILE_IFELSE([
- void some_function(void *foo, void *bar) __attribute__((nonnull()));
- void some_function(void *foo, void *bar) { foo = (void *)0; bar = (void *)0; }
- ],
- [cc_cv_attribute_nonnull=yes],
- [cc_cv_attribute_nonnull=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_nonnull" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_NONNULL], 1, [Define this if the compiler supports the nonnull attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [nonnull], [nonnull()],
+ [void __attribute__((nonnull())) some_function(void *foo, void *bar) { foo = (void*)0; bar = (void*)0; }],
+ [$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_UNUSED], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((unused))],
- [cc_cv_attribute_unused],
- [AC_COMPILE_IFELSE([
- void some_function(void *foo, __attribute__((unused)) void *bar);
- ],
- [cc_cv_attribute_unused=yes],
- [cc_cv_attribute_unused=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_unused" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_UNUSED], 1, [Define this if the compiler supports the unused attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [unused], ,
+ [void some_function(void *foo, __attribute__((unused)) void *bar);],
+ [$1], [$2])
])
-AC_DEFUN([CC_FUNC_EXPECT], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler has __builtin_expect function],
- [cc_cv_func_expect],
- [AC_COMPILE_IFELSE([
- int some_function()
- {
- int a = 3;
- return (int)__builtin_expect(a, 3);
- }
- ],
- [cc_cv_func_expect=yes],
- [cc_cv_func_expect=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_func_expect" = "xyes"; then
- AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1, [Define this if the compiler supports __builtin_expect() function])
- $1
- else
- true
- $2
- fi
+AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
+ CC_CHECK_ATTRIBUTE(
+ [sentinel], ,
+ [void some_function(void *foo, ...) __attribute__((sentinel));],
+ [$1], [$2])
])
-AC_DEFUN([CC_ATTRIBUTE_SENTINEL], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((sentinel))],
- [cc_cv_attribute_sentinel],
- [AC_COMPILE_IFELSE([
- void some_function(void *foo, ...) __attribute__((sentinel));
- ],
- [cc_cv_attribute_sentinel=yes],
- [cc_cv_attribute_sentinel=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_sentinel" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_SENTINEL], 1, [Define this if the compiler supports the sentinel attribute])
- $1
- else
- true
- $2
- fi
+AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
+ CC_CHECK_ATTRIBUTE(
+ [deprecated], ,
+ [void some_function(void *foo, ...) __attribute__((deprecated));],
+ [$1], [$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIAS], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((weak, alias))],
- [cc_cv_attribute_alias],
- [AC_COMPILE_IFELSE([
- void other_function(void *foo) { }
- void some_function(void *foo) __attribute__((weak, alias("other_function")));
- ],
- [cc_cv_attribute_alias=yes],
- [cc_cv_attribute_alias=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_alias" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_ALIAS], 1, [Define this if the compiler supports the alias attribute])
- $1
- else
- true
- $2
- fi
+ CC_CHECK_ATTRIBUTE(
+ [alias], [weak, alias],
+ [void other_function(void *foo) { }
+ void some_function(void *foo) __attribute__((weak, alias("other_function")));],
+ [$1], [$2])
+])
+
+AC_DEFUN([CC_ATTRIBUTE_MALLOC], [
+ CC_CHECK_ATTRIBUTE(
+ [malloc], ,
+ [void * __attribute__((malloc)) my_alloc(int n);],
+ [$1], [$2])
+])
+
+AC_DEFUN([CC_ATTRIBUTE_PACKED], [
+ CC_CHECK_ATTRIBUTE(
+ [packed], ,
+ [struct astructure { char a; int b; long c; void *d; } __attribute__((packed));],
+ [$1], [$2])
+])
+
+AC_DEFUN([CC_ATTRIBUTE_CONST], [
+ CC_CHECK_ATTRIBUTE(
+ [const], ,
+ [int __attribute__((const)) twopow(int n) { return 1 << n; } ],
+ [$1], [$2])
+])
+
+AC_DEFUN([CC_FLAG_VISIBILITY], [
+ AC_REQUIRE([CC_CHECK_WERROR])
+ AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],
+ [cc_cv_flag_visibility],
+ [cc_flag_visibility_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $cc_cv_werror"
+ CC_CHECK_CFLAGS_SILENT([-fvisibility=hidden],
+ cc_cv_flag_visibility='yes',
+ cc_cv_flag_visibility='no')
+ CFLAGS="$cc_flag_visibility_save_CFLAGS"])
+
+ AS_IF([test "x$cc_cv_flag_visibility" = "xyes"],
+ [AC_DEFINE([SUPPORT_FLAG_VISIBILITY], 1,
+ [Define this if the compiler supports the -fvisibility flag])
+ $1],
+ [$2])
+])
+
+AC_DEFUN([CC_FUNC_EXPECT], [
+ AC_REQUIRE([CC_CHECK_WERROR])
+ AC_CACHE_CHECK([if compiler has __builtin_expect function],
+ [cc_cv_func_expect],
+ [ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $cc_cv_werror"
+ AC_COMPILE_IFELSE(
+ [int some_function() {
+ int a = 3;
+ return (int)__builtin_expect(a, 3);
+ }],
+ [cc_cv_func_expect=yes],
+ [cc_cv_func_expect=no])
+ CFLAGS="$ac_save_CFLAGS"
+ ])
+
+ AS_IF([test "x$cc_cv_func_expect" = "xyes"],
+ [AC_DEFINE([SUPPORT__BUILTIN_EXPECT], 1,
+ [Define this if the compiler supports __builtin_expect() function])
+ $1],
+ [$2])
])
AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
@@ -322,26 +256,3 @@ AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [
[Define the highest alignment supported])
fi
])
-
-AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [
- AC_REQUIRE([CC_CHECK_WERROR])
- ac_save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $cc_cv_werror"
- AC_CACHE_CHECK([if compiler supports __attribute__((deprecated))],
- [cc_cv_attribute_alias],
- [AC_COMPILE_IFELSE([
- void some_function(void) __attribute__((deprecated));
- ],
- [cc_cv_attribute_deprecated=yes],
- [cc_cv_attribute_deprecated=no])
- ])
- CFLAGS="$ac_save_CFLAGS"
-
- if test "x$cc_cv_attribute_deprecated" = "xyes"; then
- AC_DEFINE([SUPPORT_ATTRIBUTE_DEPRECATED], 1, [Define this if the compiler supports the deprecated attribute])
- $1
- else
- true
- $2
- fi
-])
diff --git a/m4/libtool15.m4 b/m4/libtool15.m4
deleted file mode 100644
index 1f0567787..000000000
--- a/m4/libtool15.m4
+++ /dev/null
@@ -1,6168 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-##
-## This file is free software; the Free Software Foundation gives
-## unlimited permission to copy and/or distribute it, with or without
-## modifications, as long as this notice is preserved.
-
-# serial 47 AC_PROG_LIBTOOL
-
-
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
- [],
- [m4_define([AC_PROVIDE_IFELSE],
- [m4_ifdef([AC_PROVIDE_$1],
- [$2], [$3])])])
-
-
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
- AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [AC_LIBTOOL_CXX],
- [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
- ])])
-dnl And a similar setup for Fortran 77 support
- AC_PROVIDE_IFELSE([AC_PROG_F77],
- [AC_LIBTOOL_F77],
- [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
-
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
- AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
- ifdef([LT_AC_PROG_GCJ],
- [define([LT_AC_PROG_GCJ],
- defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
-
-
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
-
-
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
-
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
-
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
-
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
-
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
- ;;
- *)
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- AC_PATH_MAGIC
- fi
- ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
-
-
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
-
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-[$]*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string="`eval $cmd`") 2>/dev/null &&
- echo_test_string="`eval $cmd`" &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
-
-
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case "`/usr/bin/file conftest.o`" in
- *32-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
- ])
-esac
-
-need_locks="$enable_libtool_lock"
-
-])# _LT_AC_LOCK
-
-
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$5], , :, [$5])
-else
- ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
- $SED '/^$/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $rm conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- ifelse([$4], , :, [$4])
-else
- ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for *BSD
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- *)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
- = "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
-
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_unknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $rm -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
- $SED '/^$/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w .
- $rm conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
- $rm out/* && rmdir out
- cd ..
- rmdir conftest
- $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
-
-
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
-
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-
-
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
-
-
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
- test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
- test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existant directories.
- if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_AC_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_AC_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
-
-
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
-fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
-
-
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"; shrext="$shrext_cmds"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- shrext_cmds=".dll"; shrext="$shrext_cmds"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $rm \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'; shrext="$shrext_cmds"
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- *) # from 3.2 on
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case "$host_cpu" in
- ia64*)
- shrext_cmds='.so'; shrext="$shrext_cmds"
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'; shrext="$shrext_cmds"
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'; shrext="$shrext_cmds"
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-nto-qnx*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-openbsd*)
- version_type=sunos
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"; shrext="$shrext_cmds"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- export_dynamic_flag_spec='${wl}-Blargedynsym'
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-
-
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
- [AS_HELP_STRING([--with-tags@<:@=TAGS@:>@],
- [include additional configurations @<:@automatic@:>@])],
- [tagnames="$withval"])
-
-if test -f "$ltmain" && test -n "$tagnames"; then
- if test ! -f "${ofile}"; then
- AC_MSG_WARN([output file `$ofile' does not exist])
- fi
-
- if test -z "$LTCC"; then
- eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
- if test -z "$LTCC"; then
- AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
- else
- AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
- fi
- fi
-
- # Extract list of available tagged configurations in $ofile.
- # Note that this assumes the entire list is on one line.
- available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
-
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for tagname in $tagnames; do
- IFS="$lt_save_ifs"
- # Check whether tagname contains only valid characters
- case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
- "") ;;
- *) AC_MSG_ERROR([invalid tag name: $tagname])
- ;;
- esac
-
- if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
- then
- AC_MSG_ERROR([tag name \"$tagname\" already exists])
- fi
-
- # Update the list of available tags.
- if test -n "$tagname"; then
- echo appending configuration tag \"$tagname\" to $ofile
-
- case $tagname in
- CXX)
- if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_LIBTOOL_LANG_CXX_CONFIG
- else
- tagname=""
- fi
- ;;
-
- F77)
- if test -n "$F77" && test "X$F77" != "Xno"; then
- AC_LIBTOOL_LANG_F77_CONFIG
- else
- tagname=""
- fi
- ;;
-
- GCJ)
- if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
- AC_LIBTOOL_LANG_GCJ_CONFIG
- else
- tagname=""
- fi
- ;;
-
- RC)
- AC_LIBTOOL_LANG_RC_CONFIG
- ;;
-
- *)
- AC_MSG_ERROR([Unsupported tag name: $tagname])
- ;;
- esac
-
- # Append the new tag name to the list of available tags.
- if test -n "$tagname" ; then
- available_tags="$available_tags $tagname"
- fi
- fi
- done
- IFS="$lt_save_ifs"
-
- # Now substitute the updated list of available tags.
- if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
- mv "${ofile}T" "$ofile"
- chmod +x "$ofile"
- else
- rm -f "${ofile}T"
- AC_MSG_ERROR([unable to update list of available tagged configurations.])
- fi
-fi
-])# _LT_AC_TAGCONFIG
-
-
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
-
-
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 dll's
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
-
-
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-#- set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
-
-
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
-
-
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
-
-
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
-
-
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
- [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
-
-
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# AC_PATH_MAGIC
-
-
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
-
-
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
-
-
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-])# AC_PROG_LD_RELOAD_FLAG
-
-
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | kfreebsd*-gnu | dragonfly*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case "$host_cpu" in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-nto-qnx*)
- lt_cv_deplibs_check_method=unknown
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sco3.2v5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
-
-
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/${ac_tool_prefix}nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- esac
- fi
- done
- IFS="$lt_save_ifs"
- test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
-
-
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-])# AC_CHECK_LIBM
-
-
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
-# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
-# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
-# '${top_srcdir}/' (note the single quotes!). If your package is not
-# flat and you're not using automake, define top_builddir and
-# top_srcdir appropriately in the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- case $enable_ltdl_convenience in
- no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
- "") enable_ltdl_convenience=yes
- ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
- esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
-
-
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
-# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
-# DIRECTORY is not provided and an installed libltdl is not found, it is
-# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
-# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
-# quotes!). If your package is not flat and you're not using automake,
-# define top_builddir and top_srcdir appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
- AC_CHECK_LIB(ltdl, lt_dlinit,
- [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
- [if test x"$enable_ltdl_install" = xno; then
- AC_MSG_WARN([libltdl not installed, but installation disabled])
- else
- enable_ltdl_install=yes
- fi
- ])
- if test x"$enable_ltdl_install" = x"yes"; then
- ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
- else
- ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
- LIBLTDL="-lltdl"
- LTDLINCL=
- fi
- # For backwards non-gettext consistent compatibility...
- INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
-
-
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
-
-
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ---------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
-
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
-
-
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
-
-
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
-
-
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
-
-
-# AC_LIBTOOL_RC
-# --------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
-
-
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
-
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
- case $host_os in
- sco3.2v5*)
- _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
- ;;
- esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
- AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
- if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then :
- else
- AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
- _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
- fi
-fi
-
-
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
- $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
- [],
- [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
-
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-# Report which librarie types wil actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
-
-
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
-
-# Source file extension for C++ test sources.
-ac_ext=cc
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
- unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
-else
- unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
-
-if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- AC_PROG_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
- grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
-else
- GXX=no
- with_gnu_ld=no
- wlarc=
-fi
-
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds it's shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- case "$host_os" in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
- output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
- fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before switch to ELF
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- freebsd-elf*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- ;;
- gnu*)
- ;;
- hpux9*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- case "$host_cpu" in
- hppa*64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case "$host_cpu" in
- hppa*64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case "$host_cpu" in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case "$host_cpu" in
- ia64*|hppa*64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
- fi
- fi
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc*)
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC*)
- # Portland Group C++ compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- esac
- ;;
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd='echo'
- ;;
- osf3*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
- $rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
- psos*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- sco*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
- ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | grep -v '^2\.7' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
- fi
-
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- fi
- ;;
- esac
- ;;
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
-
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- # The `*' in the case matches for architectures that use `case' in
- # $output_verbose_cmd can trigger glob expansion during the loop
- # eval without this substitution.
- output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
-
- for p in `eval $output_verbose_link_cmd`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" \
- || test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
- _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
- _LT_AC_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
- _LT_AC_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$rm -f confest.$objext
-
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
-
-# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
-
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
-
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case "$host_os" in
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-aix4* | aix5*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
-
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
-
-
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
-
-
-# AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined. Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
-
-
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars. Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- # See if we are running on zsh, and set the options which allow our commands through
- # without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
- SED SHELL STRIP \
- libname_spec library_names_spec soname_spec extract_expsyms_cmds \
- old_striplib striplib file_magic_cmd finish_cmds finish_eval \
- deplibs_check_method reload_flag reload_cmds need_locks \
- lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
- lt_cv_sys_global_symbol_to_c_name_address \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- old_postinstall_cmds old_postuninstall_cmds \
- _LT_AC_TAGVAR(compiler, $1) \
- _LT_AC_TAGVAR(CC, $1) \
- _LT_AC_TAGVAR(LD, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
- _LT_AC_TAGVAR(old_archive_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
- _LT_AC_TAGVAR(predep_objects, $1) \
- _LT_AC_TAGVAR(postdep_objects, $1) \
- _LT_AC_TAGVAR(predeps, $1) \
- _LT_AC_TAGVAR(postdeps, $1) \
- _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
- _LT_AC_TAGVAR(archive_cmds, $1) \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
- _LT_AC_TAGVAR(postinstall_cmds, $1) \
- _LT_AC_TAGVAR(postuninstall_cmds, $1) \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
- _LT_AC_TAGVAR(allow_undefined_flag, $1) \
- _LT_AC_TAGVAR(no_undefined_flag, $1) \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
- _LT_AC_TAGVAR(hardcode_automatic, $1) \
- _LT_AC_TAGVAR(module_cmds, $1) \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) \
- _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
- _LT_AC_TAGVAR(exclude_expsyms, $1) \
- _LT_AC_TAGVAR(include_expsyms, $1); do
-
- case $var in
- _LT_AC_TAGVAR(old_archive_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
- _LT_AC_TAGVAR(archive_cmds, $1) | \
- _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(module_cmds, $1) | \
- _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
- _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
- extract_expsyms_cmds | reload_cmds | finish_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- old_postinstall_cmds | old_postuninstall_cmds | \
- sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- case $lt_echo in
- *'\[$]0 --fallback-echo"')
- lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
- ;;
- esac
-
-ifelse([$1], [],
- [cfgfile="${ofile}T"
- trap "$rm \"$cfgfile\"; exit 1" 1 2 15
- $rm -f "$cfgfile"
- AC_MSG_NOTICE([creating $ofile])],
- [cfgfile="$ofile"])
-
- cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'; shrext="$shrext_cmds"
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
-
-# If ld is used when linking, flag to hardcode \$libdir into
-# a binary during linking. This must work even if \$libdir does
-# not exist.
-hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
-
-# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
-
-# Set to yes if building a shared library automatically hardcodes DIR into the library
-# and all subsequent libraries and executables linked against it.
-hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
-
-# Symbols that must always be exported.
-include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
-
-ifelse([$1],[],
-[# ### END LIBTOOL CONFIG],
-[# ### END LIBTOOL TAG CONFIG: $tagname])
-
-__EOF__
-
-ifelse([$1],[], [
- case $host_os in
- aix3*)
- cat <<\EOF >> "$cfgfile"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" || \
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-])
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
- if test -f "$ltmain_in"; then
- test -f Makefile && make "$ltmain"
- fi
-fi
-])# AC_LIBTOOL_CONFIG
-
-
-# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-
-_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-linux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDGIRSTW]]'
- lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris* | sysv5*)
- symcode='[[BDRT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if grep ' nm_test_var$' "$nlist" >/dev/null; then
- if grep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr_t) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-
-# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
-# ---------------------------------------
-AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
-[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
- ifelse([$1],[CXX],[
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | os2* | pw32*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case "$host_cpu" in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix4* | aix5*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
- case "$host_cpu" in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux*)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- icpc* | ecpc*)
- # Intel C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC*)
- # Portland Group C++ compiler.
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd*)
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- sco*)
- case $cc_basename in
- CC*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- *)
- ;;
- esac
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- unixware*)
- ;;
- vxworks*)
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
-
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- hpux*)
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case "$host_cpu" in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- darwin*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- case $cc_basename in
- xlc*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- esac
- ;;
-
- mingw* | pw32* | os2*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case "$host_cpu" in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- linux*)
- case $cc_basename in
- icc* | ecc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgcc* | pgf77* | pgf90*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- ccc*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- esac
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- sco3.2v5*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- unicos*)
- _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
- [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-case "$host_os" in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-])
-
-
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix4* | aix5*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- *)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
-],[
- runpath_var=
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_AC_TAGVAR(archive_cmds, $1)=
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
- _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_AC_TAGVAR(hardcode_automatic, $1)=no
- _LT_AC_TAGVAR(module_cmds, $1)=
- _LT_AC_TAGVAR(module_expsym_cmds, $1)=
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_AC_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- extract_expsyms_cmds=
- # Just being paranoid about ensuring that cc_basename is set.
- _LT_CC_BASENAME([$compiler])
- case $host_os in
- cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- esac
-
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>/dev/null` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can't use
- # them.
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=no
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- linux*)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- tmp_addflag=
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* ) # Portland Group f77 and f90 compilers
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test $supports_anon_versioning = yes; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- $echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris* | sysv5*)
- if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sunos4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_AC_TAGVAR(archive_cmds, $1)=''
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" && \
- strings "$collect2name" | grep resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- else
- # We have old collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an empty executable.
- _LT_AC_SYS_LIBPATH_AIX
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # -bexpall does not export symbols beginning with underscore (_)
- _LT_AC_TAGVAR(always_export_symbols, $1)=yes
- # Exported symbols can be pulled into shared objects from archives
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds it's shared libraries.
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- # see comment about different semantics on the GNU ld section
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- bsdi[[45]]*)
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"; shrext="$shrext_cmds"
- # FIXME: Setting linknames here is a bad hack.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
- _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- case "$host_os" in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- if test "$GCC" = yes ; then
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- case $cc_basename in
- xlc*)
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- ;;
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
- ;;
-
- dgux*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10* | hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case "$host_cpu" in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case "$host_cpu" in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- case "$host_cpu" in
- hppa*64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- *)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- openbsd*)
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
- $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- sco3.2v5*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ;;
-
- solaris*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
- else
- wlarc=''
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
- esac
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_AC_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4.2uw2*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
-
- sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
- if test "$GCC" = yes; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- runpath_var='LD_RUN_PATH'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv5*)
- _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
- # $CC -shared without GNU ld will not create a library from C++
- # object files and a static libstdc++, better avoid it by now
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
- ;;
-
- uts4*)
- _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_AC_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $rm conftest*
- AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
-
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
-
-
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
-
-
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
-
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
-
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_MSG_RESULT([$SED])
-])
diff --git a/m4/misc.m4 b/m4/misc.m4
new file mode 100644
index 000000000..83246f36c
--- /dev/null
+++ b/m4/misc.m4
@@ -0,0 +1,55 @@
+dnl Miscellaneous M4 macros for configure
+dnl Copyright (c) 2008 Diego Pettenò <flameeyes@gmail.com>
+dnl Copyright (c) 2008 xine project
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2, or (at your option)
+dnl any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+dnl 02110-1301, USA.
+dnl
+dnl As a special exception, the copyright owners of the
+dnl macro gives unlimited permission to copy, distribute and modify the
+dnl configure scripts that are the output of Autoconf when processing the
+dnl Macro. You need not follow the terms of the GNU General Public
+dnl License when using or distributing such scripts, even though portions
+dnl of the text of the Macro appear in them. The GNU General Public
+dnl License (GPL) does govern all other use of the material that
+dnl constitutes the Autoconf Macro.
+dnl
+dnl This special exception to the GPL applies to versions of the
+dnl Autoconf Macro released by this project. When you make and
+dnl distribute a modified version of the Autoconf Macro, you may extend
+dnl this special exception to the GPL to apply to your modified version as
+dnl well.
+
+AC_DEFUN([XINE_CHECK_MINMAX], [
+ AC_CHECK_HEADERS([sys/param.h])
+ AC_CACHE_CHECK([for MIN()/MAX() macros],
+ xine_cv_minmax,
+ [
+ AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([
+ #ifdef HAVE_SYS_PARAM_H
+ # include <sys/param.h>
+ #endif
+ ], [
+ int a = MIN(1, 3);
+ int b = MAX(2, 3);
+ ])],
+ [xine_cv_minmax=yes],
+ [xine_cv_minmax=no])
+ ])
+
+ AS_IF([test x$xine_cv_minmax = xyes],
+ [$1], [$2])
+])
diff --git a/m4/pthreads.m4 b/m4/pthreads.m4
index ecc580e9a..653a496da 100644
--- a/m4/pthreads.m4
+++ b/m4/pthreads.m4
@@ -20,9 +20,10 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
case $host in
*-hpux11*) PTHREAD_CFLAGS="" ;;
*-darwin*) PTHREAD_CFLAGS="" ;;
- *-solaris*)
- # Handle Studio compiler
+ *-solaris*|*-linux-gnu)
+ dnl Handle Sun Studio compiler (also on Linux)
CC_CHECK_CFLAGS([-mt], [PTHREAD_CFLAGS="-mt"]);;
+
*) PTHREAD_CFLAGS="-pthread" ;;
esac
fi
@@ -31,10 +32,15 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
*-hpux11*) PTHREAD_LIBS="-lpthread" ;;
*-darwin*) PTHREAD_LIBS="" ;;
*-solaris*)
- # Use the same libraries for gcc and sun studio cc
+ dnl Use the same libraries for gcc and Sun Studio cc
PTHREAD_LIBS="-lpthread -lposix4 -lrt";;
*) PTHREAD_LIBS="-pthread" ;;
esac
+
+ dnl Again, handle Sun Studio compiler
+ if test "x${PTHREAD_CFLAGS}" = "x-mt"; then
+ PTHREAD_LIBS="-mt"
+ fi
fi
AC_CACHE_CHECK([if $CC supports Pthread],
@@ -67,3 +73,30 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
ifelse([$2], , [:], [$2])
fi
])
+
+AC_DEFUN([CC_PTHREAD_RECURSIVE_MUTEX], [
+ AC_REQUIRE([CC_PTHREAD_FLAGS])
+ AC_CACHE_CHECK(
+ [for recursive mutex support in pthread],
+ [cc_cv_pthread_recursive_mutex],
+ [ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $PTHREAD_LIBS"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+#include <pthread.h>
+ ], [
+int main() {
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ return 0;
+}
+ ])
+ ],
+ [cc_cv_pthread_recursive_mutex=yes],
+ [cc_cv_pthread_recursive_mutex=no])
+ LIBS="$ac_save_LIBS"
+ ])
+
+ AS_IF([test x"$cc_cv_pthread_recursive_mutex" = x"yes"],
+ [$1], [$2])
+])
diff --git a/misc/xine-config.in b/misc/xine-config.in
index 735631f8b..700f1169c 100644
--- a/misc/xine-config.in
+++ b/misc/xine-config.in
@@ -6,10 +6,11 @@ unset prefix
unset exec_prefix
unset args
-export PKG_CONFIG_PATH="$(cat <<'EOF'
+PKG_CONFIG_PATH="`cat <<'EOF'
@XINE_PKGCONFIG_DIR@
EOF
-)${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
+`${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
+export PKG_CONFIG_PATH
usage()
{
diff --git a/po/cs.po b/po/cs.po
index 5e2d257aa..c7a964255 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.0.1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2005-12-11 20:47+0100\n"
"Last-Translator: František Dvořák <valtri@atlas.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
@@ -237,74 +237,74 @@ msgstr ""
"surround dekodér schopný dekódovat formáty, které chcete přehrát."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : podporované režimy jsou "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : podporované režimy jsou"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bitový"
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bitový"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bitový"
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bitový"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bitový"
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bitový"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bitový"
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bitový"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono"
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stereo"
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4kanálový"
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4kanálový"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4kanálový není povolen v konfiguraci xine)"
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1kanálový"
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4kanálový není povolen v konfiguraci xine)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1kanálový není povolen v konfiguraci xine)"
+msgid " 4.1-channel"
+msgstr " 4.1kanálový"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5kanálový"
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1kanálový není povolen v konfiguraci xine)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5kanálový není povolen v kondifuraci xine)"
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5kanálový"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1kanálový"
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5kanálový není povolen v kondifuraci xine)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1kanálový není povolen v konfiguraci xine)"
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1kanálový"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "a/52 a DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1kanálový není povolen v konfiguraci xine)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(a/52 a DTS pass-through nejsou povoleny v konfiguraci xine)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 a DTS pass-through"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 a DTS pass-through nejsou povoleny v konfiguraci xine)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "mixovací zařízení alsa"
@@ -750,24 +750,31 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "zpoždění zvukového výstupu OSS (upraví synchronizaci zvuku a videa)"
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-"audio_oss_out: synchronizace reálného času zvukového zařízení zakázána...\n"
-" audio_oss_out: ...zkouší se velikost výstupní vyrovnávací paměti: "
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-"%d bytů\n"
+"audio_oss_out: synchronizace reálného času zvukového zařízení zakázána...\n"
+"audio_oss_out: ...zkouší se velikost výstupní vyrovnávací paměti: %d bytů\n"
"audio_oss_out: ...mohou zde být problémy se synchronizací zvuku a videa\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: podporované režimy jsou"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (a/52 pass-through nejsou povoleny v konfiguraci xine)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "číslo zvukového mixeru OSS, -1 pro žádné"
diff --git a/po/de.po b/po/de.po
index cd839faaa..34e6534bf 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.1.6\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2007-04-18 11:00+0200\n"
"Last-Translator: Philipp Hahn <pmhahn@users.sf.net>\n"
"Language-Team: German <de@li.org>\n"
@@ -234,74 +234,74 @@ msgstr ""
"kann, die Sie über den digitalen Ausgang Ihrer Soundkarte abspielen wollen."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : Unterstützte Modi sind "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : Unterstützte Modi sind"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8Bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8Bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16Bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16Bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24Bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24Bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32Bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32Bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "Mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " Mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "Stereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " Stereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-Kanal "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-Kanal"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-Kanal nicht aktiviert in xine Konfiguration) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-Kanal "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-Kanal nicht aktiviert in xine Konfiguration)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-Kanal nicht aktiviert in xine Konfiguration) "
+msgid " 4.1-channel"
+msgstr " 4.1-Kanal"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-Kanal "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-Kanal nicht aktiviert in xine Konfiguration)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-Kanal nicht aktiviert in xine Konfiguration) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-Kanal"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-Kanal "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-Kanal nicht aktiviert in xine Konfiguration)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-Kanal nicht aktiviert in xine Konfiguration) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-Kanal"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "a/52 und DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-Kanal nicht aktiviert in xine Konfiguration)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(a/52 und DTS pass-through nicht aktiviert in xine Konfiguration)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 und DTS pass-through"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 und DTS pass-through nicht aktiviert in xine Konfiguration)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "ALSA Mixergerät"
@@ -743,24 +743,31 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "Verzögerung der OSS Audioausgabe (Verändert A/V Synchronisation)"
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-"audio_oss_out: Audio-Realzeit-Synchronisation deaktiviert...\n"
-"audio_oss_out: ...Untersuche Größe des Ausgabepuffers: "
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-"%d Bytes\n"
+"audio_oss_out: Audio-Realzeit-Synchronisation deaktiviert...\n"
+"audio_oss_out: ...Untersuche Größe des Ausgabepuffers: %d Bytes\n"
"audio_oss_out: ...es könnn Audio/Video-Synchronisationsprobleme auftreten\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: Unterstützte Modi sind"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (a/52 pass-through nicht aktiviert in xine Konfiguration)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "OSS Mixernummer, -1 für keine"
diff --git a/po/eo.po b/po/eo.po
index e4930fc13..70d8ec536 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: eo\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2007-05-24 17:57+0200\n"
"Last-Translator: Antonio C. Codazzi <f_sophia@libero.it>\n"
"Language-Team: <it@li.org>\n"
@@ -191,74 +191,74 @@ msgid ""
msgstr ""
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : subtenitaj modusoj estas "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : subtenitaj modusoj estas"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bitoj "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bitoj"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bitoj "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bitoj"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bitoj "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bitoj"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bitoj "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bitoj"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "unufonio"
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " unufonio"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stereofonio"
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stereofonio"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "kvarfonio"
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " kvarfonio"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(kvarfonio ne estas ebligita en xine-agordoj) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-kanalo "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (kvarfonio ne estas ebligita en xine-agordoj)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-kanaloj ne estas ebligita en xine-agordoj) "
+msgid " 4.1-channel"
+msgstr " 4.1-kanalo"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "kvinfonio"
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-kanaloj ne estas ebligita en xine-agordoj)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(kvinfonio ne estas ebligita en xine-agordoj) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " kvinfonio"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-kanalo "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (kvinfonio ne estas ebligita en xine-agordoj)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-kanaloj ne estas ebligita en xine-agordoj) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-kanalo"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "rektotrajro de a/52 kaj DTS\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-kanaloj ne estas ebligita en xine-agordoj)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(rektotrajro de a/52 kaj DTS ne estas ebligita en xine-agordoj)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " rektotrajro de a/52 kaj DTS"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (rektotrajro de a/52 kaj DTS ne estas ebligita en xine-agordoj)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "alsa-miksilo"
@@ -656,24 +656,32 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "latenco de OSS aŭdeligo (aranĝo de a/v sinkro)"
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-"audio_oss_out: Aŭdozorgilo por realtempa sinkronigo estas malebligita...\n"
-"audio_oss_out: ...sondante grandon de eliga bufro: "
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-"%d bajtoj\n"
+"audio_oss_out: Aŭdozorgilo por realtempa sinkronigo estas malebligita...\n"
+"audio_oss_out: ...sondante grandon de eliga bufro: %d bajtoj\n"
"audio_oss_out: ...eble ĝi estas problemo de aŭdo/video sinkronigo\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: subtenitaj modusoj estas"
+
+#: src/audio_out/audio_oss_out.c:1009
+#, fuzzy
+msgid " a/52 pass-through"
+msgstr " rektotrajro de a/52"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (rektotrajro de a/52 ne estas ebligita en xine-agordoj)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "numero de OSS aŭdomiksilo, -1 por nenio"
diff --git a/po/es.po b/po/es.po
index 4c320e6ef..e28e2169a 100644
--- a/po/es.po
+++ b/po/es.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib.hg\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-04-02 01:36+0100\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2008-04-02 01:05+0200\n"
"Last-Translator: Carlos E. R. M. <carloser@users.sourceforge.net>\n"
"Language-Team: Spanish <none>\n"
@@ -245,74 +245,74 @@ msgstr ""
"su tarjeta de sonido."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : los modos soportados son "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : los modos soportados son"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "estéreo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " estéreo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-canales "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-canales"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-canales no activado en la configuración de xine) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-canales "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-canales no activado en la configuración de xine)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-canales no activado en la configuración de xine) "
+msgid " 4.1-channel"
+msgstr " 4.1-canales"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-canales "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-canales no activado en la configuración de xine)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-canales no activado en la configuración de xine) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-canales"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-canales "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-canales no activado en la configuración de xine)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-canales no activado en la configuración de xine) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-canales"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "travesía a/52 y DTS\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-canales no activado en la configuración de xine)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(travesía a/52 and DTS no activada en la configuración de xine)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " travesía a/52 y DTS"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (travesía a/52 and DTS no activada en la configuración de xine)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "dispositivo mezclador alsa"
@@ -762,24 +762,32 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "Latencia de salida de audio OSS audio (ajuste sincronismo a/v)"
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-"audio_oss_out: Sincronismo tiempo real driver de audio desactivado...\n"
-"audio_oss_out: ...ensayando tamaño del búfer de salida: "
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-"%d bytes\n"
+"audio_oss_out: Sincronismo tiempo real driver de audio desactivado...\n"
+"audio_oss_out: ...ensayando tamaño del búfer de salida: %d bytes\n"
"audio_oss_out: ...puede haber problemas de sincronización audio/vídeo\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: los modos soportados son"
+
+#: src/audio_out/audio_oss_out.c:1009
+#, fuzzy
+msgid " a/52 pass-through"
+msgstr " travesía a/52"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (travesía a/52 no activada en la configuración de xine)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "número de mezclador audio OSS, -1 para ninguno"
diff --git a/po/eu.po b/po/eu.po
index cafd5055a..2c6f01e79 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib-1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2005-02-17 14:29+0100\n"
"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
"Language-Team: lubrezale <librezale@librezale.org>\n"
@@ -237,74 +237,74 @@ msgstr ""
"formats you want to play to your sound card's digital output."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : Onartutako moduak: "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : Onartutako moduak:"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "estereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " estereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-kanal "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-kanal"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-kanal ez dago gaiturik xine konfigruaketan)"
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-kanal "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-kanal ez dago gaiturik xine konfigruaketan)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-kanal ez dago gaiturik xine konfigruaketan)"
+msgid " 4.1-channel"
+msgstr " 4.1-kanal"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-kanal "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-kanal ez dago gaiturik xine konfigruaketan)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-kanal ez dago gaiturik xine konfigruaketan)"
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-kanal"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-kanal "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-kanal ez dago gaiturik xine konfigruaketan)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-kanal ez dago gaiturik xine konfigruaketan)"
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-kanal"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "a/52 eta DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-kanal ez dago gaiturik xine konfigruaketan)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(a/52 eta DTS pass-through ez daude gaiturik xine konfiguraketan)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 eta DTS pass-through"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 eta DTS pass-through ez daude gaiturik xine konfiguraketan)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "alsa nahasle gailua"
@@ -750,25 +750,32 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "OSS audio irteera atzerapena(a/b synk ezarri)"
-#: src/audio_out/audio_oss_out.c:882
+#: src/audio_out/audio_oss_out.c:894
+#, c-format
msgid ""
"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
"audio_oss_out: Audio kontrolatzailearen denbora errealeko sinkronia "
"ezgaitu...\n"
-"audio_oss_out: ...irteera bufffer tamaina frogatzen: "
-
-#: src/audio_out/audio_oss_out.c:899
-#, c-format
-msgid ""
-"%d bytes\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
-msgstr ""
-"%d bite\n"
+"audio_oss_out: ...irteera bufffer tamaina frogatzen: %d bite\n"
"audio_oss_out: ...audio/bideo sinkronismo arazoak egon daitezke\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: Onartutako moduak:"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (a/52 pass-through ez daude gaiturik xine konfiguraketan)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "OSS audio nahasle zenbakia, -1 ez erabiltzeko"
diff --git a/po/fr.po b/po/fr.po
index bd6cd8ea7..286166f66 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.1.9\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2008-01-01 15:18+0100\n"
"Last-Translator: Christophe Giraud <chris256gnu@gmail.com>\n"
"Language-Team: french <fr@li.org>\n"
@@ -246,74 +246,74 @@ msgstr ""
"surround capable de traiter le signal envoyé par votre carte son. "
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : les modes supportés sont "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : les modes supportés sont"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stéréo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stéréo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-canaux"
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-canaux"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(sortie 4 canaux non activée dans la configuration de xine)"
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "sortie 4.1 canaux"
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (sortie 4 canaux non activée dans la configuration de xine)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(sortie 4.1 canaux non activée dans la configuration de xine)"
+msgid " 4.1-channel"
+msgstr " sortie 4.1 canaux"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "Sortie 5 canaux"
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (sortie 4.1 canaux non activée dans la configuration de xine)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(Sortie 5 canaux non activée dans la configuration de xine)"
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " Sortie 5 canaux"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "Sortie 5.1 canaux"
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (Sortie 5 canaux non activée dans la configuration de xine)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(Sortie 5.1 canaux non activée dans la configuration de xine)"
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " Sortie 5.1 canaux"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr ""
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (Sortie 5.1 canaux non activée dans la configuration de xine)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(a/52 et DTS pass-through non activés dans la configuration de xine)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 et DTS pass-through"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 et DTS pass-through non activés dans la configuration de xine)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "périphérique du mixeur alsa"
@@ -716,20 +716,28 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "Temps de latence de la sortie audio OSS (ajustement de a/v sync) "
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out : les modes supportés sont"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (a/52 pass-through non activé dans la configuration de xine)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr ""
diff --git a/po/it.po b/po/it.po
index cc4bb79b9..7e9fbe32d 100644
--- a/po/it.po
+++ b/po/it.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: it\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2007-12-24 16:09+0100\n"
"Last-Translator: Diego 'Flameeyes' Pettenò <flameeyes@gentoo.org>\n"
"Language-Team: Italian\n"
@@ -238,75 +238,75 @@ msgstr ""
"formati che si vogliono riprodurre."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : i modi supportati sono "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : i modi supportati sono"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8-bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8-bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16-bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16-bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24-bit"
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24-bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32-bit"
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32-bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-canali "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-canali"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-canali non abilitato nella configurazione di xine) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-canali "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-canali non abilitato nella configurazione di xine)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-canali non abilitati nella configurazione di xine) "
+msgid " 4.1-channel"
+msgstr " 4.1-canali"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-canali "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-canali non abilitati nella configurazione di xine)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-canali non abilitati nella configurazione di xine) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-canali"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-canali "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-canali non abilitati nella configurazione di xine)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-canali non abilitati nella configurazione di xine) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-canali"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "passaggio diretto a/52 e DTS\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-canali non abilitati nella configurazione di xine)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " passaggio diretto a/52 e DTS"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
msgstr ""
-"(passaggio diretto a/53 e DTS non abilitato nella configurazione di xine)\n"
+" (passaggio diretto a/52 e DTS non abilitato nella configurazione di xine)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "dispositivo mixer di alsa"
@@ -753,24 +753,34 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "latenza nell'uscita audio OSS (calibra sincronia audio/video)"
-#: src/audio_out/audio_oss_out.c:882
+#: src/audio_out/audio_oss_out.c:894
+#, c-format
msgid ""
"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
"audio_oss_out: driver audio real time con sincronizzazione disabilitato...\n"
-"audio_oss_out: ...si sta provando la dimensione del buffer di output: "
+"audio_oss_out: ...si sta provando la dimensione del buffer di output: %d "
+"byte\n"
+"audio_oss_out: ... potrebbe essereci sincronizzazione audio/video\n"
-#: src/audio_out/audio_oss_out.c:899
-#, c-format
-msgid ""
-"%d bytes\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: i modi supportati sono"
+
+#: src/audio_out/audio_oss_out.c:1009
+#, fuzzy
+msgid " a/52 pass-through"
+msgstr " passaggio diretto a/52"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
msgstr ""
-"%d byte\n"
-"audio_oss_out: ... potrebbe essereci sincronizzazione audio/video\n"
+" (passaggio diretto a/52 non abilitato nella configurazione di xine)"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "Numero del mixer audio OSS, -1 per nessuno."
diff --git a/po/libxine1.pot b/po/libxine1.pot
index b324dfc3b..abaabf4ab 100644
--- a/po/libxine1.pot
+++ b/po/libxine1.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -184,74 +184,74 @@ msgid ""
msgstr ""
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
+msgid "audio_alsa_out : supported modes are"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
msgstr ""
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
+msgid " 4.1-channel"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
msgstr ""
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
+msgid " a/52 and DTS pass-through"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr ""
@@ -638,20 +638,27 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr ""
-#: src/audio_out/audio_oss_out.c:882
+#: src/audio_out/audio_oss_out.c:894
+#, c-format
msgid ""
"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-#: src/audio_out/audio_oss_out.c:899
-#, c-format
-msgid ""
-"%d bytes\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1012
+msgid " (a/52 pass-through not enabled in xine config)"
msgstr ""
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr ""
diff --git a/po/sk.po b/po/sk.po
index 9ef55200e..1eb444c61 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.0\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2004-09-15 13:53+0100\n"
"Last-Translator: \n"
"Language-Team: Slovak <ski18n@lists.isternet.sk>\n"
@@ -190,77 +190,77 @@ msgid ""
msgstr ""
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
-msgstr "audio_alsa_out : podporované módy sú "
+msgid "audio_alsa_out : supported modes are"
+msgstr "audio_alsa_out : podporované módy sú"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1508
+#: src/audio_out/audio_alsa_out.c:1509
#, fuzzy
-msgid "16bit "
-msgstr "8bit "
+msgid " 16bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1512
+#: src/audio_out/audio_alsa_out.c:1513
#, fuzzy
-msgid "24bit "
-msgstr "8bit "
+msgid " 24bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1516
+#: src/audio_out/audio_alsa_out.c:1517
#, fuzzy
-msgid "32bit "
-msgstr "8bit "
+msgid " 32bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-kanály "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-kanály"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-kanály nepovolené v xine konfigu) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-kanálov "
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-kanály nepovolené v xine konfigu)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-kanálov nepovolené v xine konfigu) "
+msgid " 4.1-channel"
+msgstr " 4.1-kanálov"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-kanálov "
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-kanálov nepovolené v xine konfigu)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-kanálov nepovolené v xine konfigu) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-kanálov"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-kanálov "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-kanálov nepovolené v xine konfigu)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-kanálov nepovolené v xine konfigu) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-kanálov"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "a/52 a DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-kanálov nepovolené v xine konfigu)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr "(a/52 a DTS pass-through not enabled in xine config)\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 a DTS pass-through"
+
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 a DTS pass-through not enabled in xine config)"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "alsa mixovacie zaridenie"
@@ -674,24 +674,30 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "výstupné oneskorenie esd audia (nastavte odstup a/v)"
-#: src/audio_out/audio_oss_out.c:882
+#: src/audio_out/audio_oss_out.c:894
+#, c-format
msgid ""
"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
"audio_oss_out: RT synchronizácia audio ovládača zakázaná ...\n"
-"audio_oss_out: ...zisťujem veľkosť výst. vyrovn. pamäte: "
+"audio_oss_out: ...zisťujem veľkosť výst. vyrovn. pamäte: %d bytov\n"
+"audio_oss_out: ...môžu byť problémy s audio/video synchronizáciou\n"
-#: src/audio_out/audio_oss_out.c:899
-#, c-format
-msgid ""
-"%d bytes\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: podporované módy sú"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+msgid " (a/52 pass-through not enabled in xine config)"
msgstr ""
-"%d bytov\n"
-"audio_oss_out: ...môžu byť problémy s audio/video synchronizáciou\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index 00fda5063..c5d491061 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: libxine1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2008-03-19 13:16+0000\n"
+"POT-Creation-Date: 2008-06-12 20:33+0100\n"
"PO-Revision-Date: 2008-01-05 18:22+0200\n"
"Last-Translator: Server Acim <sacim@kde.org.tr>\n"
"Language-Team: Türkçe <yerellestirme@kde.org.tr>\n"
@@ -216,75 +216,74 @@ msgstr ""
"için iki hoparlörünüz var demektir."
#: src/audio_out/audio_alsa_out.c:1500
-msgid "audio_alsa_out : supported modes are "
+msgid "audio_alsa_out : supported modes are"
msgstr "audio_alsa_out : desteklenen kipler"
-#: src/audio_out/audio_alsa_out.c:1503
-msgid "8bit "
-msgstr "8bit "
+#: src/audio_out/audio_alsa_out.c:1504
+msgid " 8bit"
+msgstr " 8bit"
-#: src/audio_out/audio_alsa_out.c:1508
-msgid "16bit "
-msgstr "16bit "
+#: src/audio_out/audio_alsa_out.c:1509
+msgid " 16bit"
+msgstr " 16bit"
-#: src/audio_out/audio_alsa_out.c:1512
-msgid "24bit "
-msgstr "24bit "
+#: src/audio_out/audio_alsa_out.c:1513
+msgid " 24bit"
+msgstr " 24bit"
-#: src/audio_out/audio_alsa_out.c:1516
-msgid "32bit "
-msgstr "32bit "
+#: src/audio_out/audio_alsa_out.c:1517
+msgid " 32bit"
+msgstr " 32bit"
-#: src/audio_out/audio_alsa_out.c:1527
-msgid "mono "
-msgstr "mono "
+#: src/audio_out/audio_alsa_out.c:1530 src/audio_out/audio_oss_out.c:963
+msgid " mono"
+msgstr " mono"
-#: src/audio_out/audio_alsa_out.c:1531
-msgid "stereo "
-msgstr "stereo "
+#: src/audio_out/audio_alsa_out.c:1534 src/audio_out/audio_oss_out.c:969
+msgid " stereo"
+msgstr " stereo"
-#: src/audio_out/audio_alsa_out.c:1536
-msgid "4-channel "
-msgstr "4-kanal "
+#: src/audio_out/audio_alsa_out.c:1539 src/audio_out/audio_oss_out.c:976
+msgid " 4-channel"
+msgstr " 4-kanal"
-#: src/audio_out/audio_alsa_out.c:1539
-msgid "(4-channel not enabled in xine config) "
-msgstr "(4-kanal xine yapılandırmasında etkinleştirilmemiş) "
-
-#: src/audio_out/audio_alsa_out.c:1544
-msgid "4.1-channel "
-msgstr "4.1-kanal"
+#: src/audio_out/audio_alsa_out.c:1542 src/audio_out/audio_oss_out.c:979
+msgid " (4-channel not enabled in xine config)"
+msgstr " (4-kanal xine yapılandırmasında etkinleştirilmemiş)"
#: src/audio_out/audio_alsa_out.c:1547
-msgid "(4.1-channel not enabled in xine config) "
-msgstr "(4.1-kanal xine yapılandırmasında etkinleştirilmemiş) "
+msgid " 4.1-channel"
+msgstr " 4.1-kanal"
-#: src/audio_out/audio_alsa_out.c:1552
-msgid "5-channel "
-msgstr "5-kanal"
+#: src/audio_out/audio_alsa_out.c:1550
+msgid " (4.1-channel not enabled in xine config)"
+msgstr " (4.1-kanal xine yapılandırmasında etkinleştirilmemiş)"
-#: src/audio_out/audio_alsa_out.c:1555
-msgid "(5-channel not enabled in xine config) "
-msgstr "(5-kanal xine yapılandırmasında etkinleştirilmemiş) "
+#: src/audio_out/audio_alsa_out.c:1555 src/audio_out/audio_oss_out.c:986
+msgid " 5-channel"
+msgstr " 5-kanal"
-#: src/audio_out/audio_alsa_out.c:1560
-msgid "5.1-channel "
-msgstr "5.1-kanal "
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:989
+msgid " (5-channel not enabled in xine config)"
+msgstr " (5-kanal xine yapılandırmasında etkinleştirilmemiş)"
-#: src/audio_out/audio_alsa_out.c:1563
-msgid "(5.1-channel not enabled in xine config) "
-msgstr "(5.1-kanal xine yapılandırmasında etkinleştirilmemiş) "
+#: src/audio_out/audio_alsa_out.c:1563 src/audio_out/audio_oss_out.c:996
+msgid " 5.1-channel"
+msgstr " 5.1-kanal"
-#: src/audio_out/audio_alsa_out.c:1586
-msgid "a/52 and DTS pass-through\n"
-msgstr "a/52 and DTS pass-through\n"
+#: src/audio_out/audio_alsa_out.c:1566 src/audio_out/audio_oss_out.c:999
+msgid " (5.1-channel not enabled in xine config)"
+msgstr " (5.1-kanal xine yapılandırmasında etkinleştirilmemiş)"
#: src/audio_out/audio_alsa_out.c:1589
-msgid "(a/52 and DTS pass-through not enabled in xine config)\n"
-msgstr ""
-"(a/52 and DTS pass-through xine yapılandırmasında etkinleştirilmemiş))\n"
+msgid " a/52 and DTS pass-through"
+msgstr " a/52 and DTS pass-through"
-#: src/audio_out/audio_alsa_out.c:1596
+#: src/audio_out/audio_alsa_out.c:1592
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr " (a/52 and DTS pass-through xine yapılandırmasında etkinleştirilmemiş)"
+
+#: src/audio_out/audio_alsa_out.c:1602
msgid "alsa mixer device"
msgstr "alsa karıştırıcı aygıtı"
@@ -726,24 +725,31 @@ msgstr ""
msgid "OSS audio output latency (adjust a/v sync)"
msgstr "OSS ses çıkışı gecikme süresi (a/v/ senkronunu ayarlayın)"
-#: src/audio_out/audio_oss_out.c:882
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: "
-msgstr ""
-"audio_oss_out: Ses sürücüsü gerçek zamanlı senkron etkisizleştirildi...\n"
-"audio_oss_out: ...çıkış tampon boyutunu araştırıyor: "
-
-#: src/audio_out/audio_oss_out.c:899
+#: src/audio_out/audio_oss_out.c:894
#, c-format
msgid ""
-"%d bytes\n"
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
"audio_oss_out: ...there may be audio/video synchronization issues\n"
msgstr ""
-"%d bytes\n"
+"audio_oss_out: Ses sürücüsü gerçek zamanlı senkron etkisizleştirildi...\n"
+"audio_oss_out: ...çıkış tampon boyutunu araştırıyor: %d bytes\n"
"audio_oss_out: ...burada ses/görüntü senkronizasyon sorunları olabilir\n"
-#: src/audio_out/audio_oss_out.c:1028
+#: src/audio_out/audio_oss_out.c:958
+msgid "audio_oss_out: supported modes are"
+msgstr "audio_oss_out: desteklenen kipler"
+
+#: src/audio_out/audio_oss_out.c:1009
+msgid " a/52 pass-through"
+msgstr " a/52 pass-through"
+
+#: src/audio_out/audio_oss_out.c:1012
+#, fuzzy
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr " (a/52 pass-through xine yapılandırmasında etkinleştirilmemiş)"
+
+#: src/audio_out/audio_oss_out.c:1027
msgid "OSS audio mixer number, -1 for none"
msgstr "OSS ses karıştırıcısı numarası, hiçbiri için -1"
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 4ce2b1be3..470cd953a 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -1350,7 +1350,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
#define A52_PASSTHRU 12
int speakers;
- this = (alsa_driver_t *) xine_xmalloc (sizeof (alsa_driver_t));
+ this = calloc(1, sizeof (alsa_driver_t));
if (!this)
return NULL;
@@ -1497,70 +1497,73 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
"formats you want to play to your sound card's digital output."),
0, alsa_speaker_arrangement_cb, this);
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("audio_alsa_out : supported modes are "));
+ char *logmsg = strdup (_("audio_alsa_out : supported modes are"));
+
if (!(snd_pcm_hw_params_test_format(this->audio_fd, params, SND_PCM_FORMAT_U8))) {
this->capabilities |= AO_CAP_8BITS;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("8bit "));
+ xine_strcat_realloc (&logmsg, _(" 8bit"));
}
/* ALSA automatically appends _LE or _BE depending on the CPU */
if (!(snd_pcm_hw_params_test_format(this->audio_fd, params, SND_PCM_FORMAT_S16))) {
this->capabilities |= AO_CAP_16BITS;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("16bit "));
+ xine_strcat_realloc (&logmsg, _(" 16bit"));
}
if (!(snd_pcm_hw_params_test_format(this->audio_fd, params, SND_PCM_FORMAT_S24))) {
this->capabilities |= AO_CAP_24BITS;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("24bit "));
+ xine_strcat_realloc (&logmsg, _(" 24bit"));
}
if (!(snd_pcm_hw_params_test_format(this->audio_fd, params, SND_PCM_FORMAT_FLOAT))) {
this->capabilities |= AO_CAP_FLOAT32;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("32bit "));
+ xine_strcat_realloc (&logmsg, _(" 32bit"));
}
if (0 == (this->capabilities & (AO_CAP_FLOAT32 | AO_CAP_24BITS | AO_CAP_16BITS | AO_CAP_8BITS))) {
- xprintf (this->class->xine, XINE_VERBOSITY_DEBUG,
- "\naudio_alsa_out: no supported PCM format found\n");
+ xprintf(class->xine, XINE_VERBOSITY_LOG, "%s\n", logmsg);
+ free (logmsg);
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG,
+ "audio_alsa_out: no supported PCM format found\n");
snd_pcm_close(this->audio_fd);
free(this);
return NULL;
}
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 1))) {
this->capabilities |= AO_CAP_MODE_MONO;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("mono "));
+ xine_strcat_realloc (&logmsg, _(" mono"));
}
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 2))) {
this->capabilities |= AO_CAP_MODE_STEREO;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("stereo "));
+ xine_strcat_realloc (&logmsg, _(" stereo"));
}
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 4)) &&
( speakers == SURROUND4 )) {
this->capabilities |= AO_CAP_MODE_4CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("4-channel "));
+ xine_strcat_realloc (&logmsg, _(" 4-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("(4-channel not enabled in xine config) "));
+ xine_strcat_realloc (&logmsg, _(" (4-channel not enabled in xine config)"));
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&
( speakers == SURROUND41 )) {
this->capabilities |= AO_CAP_MODE_4_1CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("4.1-channel "));
+ xine_strcat_realloc (&logmsg, _(" 4.1-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("(4.1-channel not enabled in xine config) "));
+ xine_strcat_realloc (&logmsg, _(" (4.1-channel not enabled in xine config)"));
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&
( speakers == SURROUND5 )) {
this->capabilities |= AO_CAP_MODE_5CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("5-channel "));
+ xine_strcat_realloc (&logmsg, _(" 5-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("(5-channel not enabled in xine config) "));
+ xine_strcat_realloc (&logmsg, _(" (5-channel not enabled in xine config)"));
if (!(snd_pcm_hw_params_test_channels(this->audio_fd, params, 6)) &&
( speakers >= SURROUND51 )) {
this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("5.1-channel "));
+ xine_strcat_realloc (&logmsg, _(" 5.1-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("(5.1-channel not enabled in xine config) "));
+ xine_strcat_realloc (&logmsg, _(" (5.1-channel not enabled in xine config)"));
this->has_pause_resume = 0; /* This is checked at open time instead */
this->is_paused = 0;
@@ -1583,10 +1586,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if ( speakers == A52_PASSTHRU ) {
this->capabilities |= AO_CAP_MODE_A52;
this->capabilities |= AO_CAP_MODE_AC5;
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("a/52 and DTS pass-through\n"));
+ xine_strcat_realloc (&logmsg, _(" a/52 and DTS pass-through"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_LOG, _("(a/52 and DTS pass-through not enabled in xine config)\n"));
+ xine_strcat_realloc (&logmsg, _(" (a/52 and DTS pass-through not enabled in xine config)"));
+
+ xprintf(class->xine, XINE_VERBOSITY_LOG, "%s\n", logmsg);
+ free (logmsg);
/* printf("audio_alsa_out: capabilities 0x%X\n",this->capabilities); */
@@ -1682,7 +1688,7 @@ static void *init_class (xine_t *xine, void *data) {
alsa_class_t *this;
- this = (alsa_class_t *) xine_xmalloc (sizeof (alsa_class_t));
+ this = calloc(1, sizeof (alsa_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
index 0f0467b4a..14bf5c965 100644
--- a/src/audio_out/audio_arts_out.c
+++ b/src/audio_out/audio_arts_out.c
@@ -303,7 +303,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
lprintf ("audio_arts_out: open_plugin called\n");
- this = (arts_driver_t *) xine_xmalloc (sizeof (arts_driver_t));
+ this = calloc(1, sizeof (arts_driver_t));
if (!this)
return NULL;
@@ -384,7 +384,7 @@ static void *init_class (xine_t *xine, void *data) {
lprintf ("audio_arts_out: init class\n");
- this = (arts_class_t *) xine_xmalloc (sizeof (arts_class_t));
+ this = calloc(1, sizeof (arts_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_coreaudio_out.c b/src/audio_out/audio_coreaudio_out.c
index eecab8f95..642f920c7 100644
--- a/src/audio_out/audio_coreaudio_out.c
+++ b/src/audio_out/audio_coreaudio_out.c
@@ -530,7 +530,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
lprintf ("open_plugin called\n");
- this = (coreaudio_driver_t *) xine_xmalloc (sizeof (coreaudio_driver_t));
+ this = calloc(1, sizeof (coreaudio_driver_t));
if (!this)
return NULL;
@@ -582,7 +582,7 @@ static void *init_class (xine_t *xine, void *data) {
lprintf ("init class\n");
- this = (coreaudio_class_t *) xine_xmalloc (sizeof (coreaudio_class_t));
+ this = calloc(1, sizeof (coreaudio_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c
index d9688b647..5fffd1e2d 100644
--- a/src/audio_out/audio_directx2_out.c
+++ b/src/audio_out/audio_directx2_out.c
@@ -955,7 +955,7 @@ static ao_driver_t *open_plugin(audio_driver_class_t *class_gen, const void *dat
lprintf("open plugin called\n");
- this = (dx2_driver_t *)xine_xmalloc(sizeof(dx2_driver_t));
+ this = calloc(1, sizeof(dx2_driver_t));
if (!this)
return NULL;
@@ -1009,7 +1009,7 @@ static void *init_class(xine_t *xine, void *data) {
lprintf("init class\n");
- this = (dx2_class_t *)xine_xmalloc(sizeof(dx2_class_t));
+ this = calloc(1, sizeof(dx2_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c
index 77e3e15b9..7c99e97e2 100644
--- a/src/audio_out/audio_directx_out.c
+++ b/src/audio_out/audio_directx_out.c
@@ -790,7 +790,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
audiox_class_t *class = (audiox_class_t *) class_gen;
ao_directx_t *ao_directx;
- ao_directx = ( ao_directx_t * ) xine_xmalloc( sizeof( ao_directx_t ) );
+ ao_directx = calloc(1, sizeof(ao_directx_t));
if (!ao_directx)
return NULL;
@@ -841,7 +841,7 @@ static void *init_class (xine_t *xine, void *data) {
/*
* from this point on, nothing should go wrong anymore
*/
- audiox = (audiox_class_t *) xine_xmalloc (sizeof (audiox_class_t));
+ audiox = calloc(1, sizeof (audiox_class_t));
if (!audiox)
return NULL;
diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c
index 4b209bea1..63c54b546 100644
--- a/src/audio_out/audio_esd_out.c
+++ b/src/audio_out/audio_esd_out.c
@@ -521,7 +521,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
esd_close(audio_fd);
- this = (esd_driver_t *) xine_xmalloc (sizeof (esd_driver_t));
+ this = calloc(1, sizeof (esd_driver_t));
if (!this)
return NULL;
this->xine = class->xine;
@@ -583,7 +583,7 @@ static void *init_class (xine_t *xine, void *data) {
esd_class_t *this;
- this = (esd_class_t *) xine_xmalloc (sizeof (esd_class_t));
+ this = calloc(1, sizeof (esd_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c
index 225d64d0e..699a5cf54 100644
--- a/src/audio_out/audio_file_out.c
+++ b/src/audio_out/audio_file_out.c
@@ -323,7 +323,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
lprintf ("open_plugin called\n");
- this = (file_driver_t *) xine_xmalloc (sizeof (file_driver_t));
+ this = calloc(1, sizeof (file_driver_t));
if (!this)
return NULL;
@@ -375,7 +375,7 @@ static void *init_class (xine_t *xine, void *data) {
lprintf ("init class\n");
- this = (file_class_t *) xine_xmalloc (sizeof (file_class_t));
+ this = calloc(1, sizeof (file_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c
index 92eadc6cf..6c3a0ae33 100644
--- a/src/audio_out/audio_fusionsound_out.c
+++ b/src/audio_out/audio_fusionsound_out.c
@@ -389,11 +389,11 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class,
fusionsound_class_t *class = (fusionsound_class_t *) ao_class;
fusionsound_driver_t *this;
const char *args[] = { "xine", "--dfb:no-sighandler", "--fs:no-banner" };
- int argn = sizeof(args) / sizeof(args[0]);
+ const size_t argn = sizeof(args) / sizeof(args[0]);
char **argp = (char **) args;
DFBResult ret;
- this = (fusionsound_driver_t *) xine_xmalloc (sizeof(fusionsound_driver_t));
+ this = calloc(1, sizeof(fusionsound_driver_t));
if (!this) {
xprintf (class->xine, XINE_VERBOSITY_LOG,
"audio_fusionsound_out: driver interface allocation failed!\n");
@@ -460,7 +460,7 @@ static void* init_class(xine_t *xine, void *data) {
return NULL;
}
- class = (fusionsound_class_t *) xine_xmalloc (sizeof( fusionsound_class_t));
+ class = calloc(1, sizeof( fusionsound_class_t));
if (!class) {
xprintf (xine, XINE_VERBOSITY_LOG,
"audio_fusionsound_out: class interface allocation failed!\n");
diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c
index 1bc070527..8a77ab018 100644
--- a/src/audio_out/audio_jack_out.c
+++ b/src/audio_out/audio_jack_out.c
@@ -17,431 +17,942 @@
#define AO_OUT_JACK_IFACE_VERSION 8
#define GAP_TOLERANCE AO_MAX_GAP
-#define BUFSIZE 81920
+/* maximum number of channels supported, avoids lots of mallocs */
+#define MAX_CHANS 6
-typedef struct jack_driver_s {
+typedef struct jack_driver_s
+{
+ ao_driver_t ao_driver;
+ xine_t *xine;
+
+ int capabilities;
+ int mode;
+ int paused;
+ int underrun;
+
+ int32_t output_sample_rate, input_sample_rate;
+ uint32_t num_channels;
+ uint32_t bits_per_sample;
+ uint32_t bytes_per_frame;
+ uint32_t bytes_in_buffer; /* number of bytes writen to audio hardware */
+ uint32_t fragment_size;
+
+ jack_client_t *client;
+ jack_port_t *ports[MAX_CHANS];
+
+ /*! buffer for audio data */
+ unsigned char *buffer;
+
+ /*! buffer read position, may only be modified by playback thread or while it is stopped */
+ uint32_t read_pos;
+ /*! buffer write position, may only be modified by MPlayer's thread */
+ uint32_t write_pos;
+
+ struct
+ {
+ int volume;
+ int mute;
+ } mixer;
- ao_driver_t ao_driver;
- xine_t *xine;
+} jack_driver_t;
- int capabilities;
+typedef struct
+{
+ audio_driver_class_t driver_class;
+ config_values_t *config;
+ xine_t *xine;
+} jack_class_t;
- int32_t sample_rate;
- uint32_t num_channels;
- uint32_t bits_per_sample;
- uint32_t bytes_per_frame;
- jack_client_t *client;
- jack_port_t *port_1;
- jack_port_t *port_2;
- float buf_1[BUFSIZE];
- float buf_2[BUFSIZE];
- uint32_t buf_read;
- uint32_t buf_write;
+/**************************************************************
+ *
+ * Simple ringbuffer implementation
+ * Lifted from mplayer ao_jack.c
+ *
+**************************************************************/
+
+
+/*! size of one chunk, if this is too small Xine will start to "stutter" */
+/*! after a short time of playback */
+#define CHUNK_SIZE (16 * 1024)
+/*! number of "virtual" chunks the buffer consists of */
+#define NUM_CHUNKS 8
+/* This type of ring buffer may never fill up completely, at least */
+/* one byte must always be unused. */
+/* For performance reasons (alignment etc.) one whole chunk always stays */
+/* empty, not only one byte. */
+#define BUFFSIZE ((NUM_CHUNKS + 1) * CHUNK_SIZE)
+
+/**
+ * \brief get the number of free bytes in the buffer
+ * \return number of free bytes in buffer
+ *
+ * may only be called by Xine's thread
+ * return value may change between immediately following two calls,
+ * and the real number of free bytes might be larger!
+ */
+static int buf_free (jack_driver_t *this)
+{
+ int free = this->read_pos - this->write_pos - CHUNK_SIZE;
+ if (free < 0)
+ free += BUFFSIZE;
+ return free;
+}
- uint32_t volume;
- uint32_t mute;
+/**
+ * \brief get amount of data available in the buffer
+ * \return number of bytes available in buffer
+ *
+ * may only be called by the playback thread
+ * return value may change between immediately following two calls,
+ * and the real number of buffered bytes might be larger!
+ */
+static int buf_used (jack_driver_t *this)
+{
+ int used = this->write_pos - this->read_pos;
+ if (used < 0)
+ used += BUFFSIZE;
+ return used;
+}
-} jack_driver_t;
+/**
+ * \brief insert len bytes into buffer
+ * \param data data to insert
+ * \param len length of data
+ * \return number of bytes inserted into buffer
+ *
+ * If there is not enough room, the buffer is filled up
+ *
+ * TODO: Xine should really pass data as float, perhaps in V1.2?
+ */
+static int write_buffer_32 (jack_driver_t *this, unsigned char *data, int len)
+{
+ int first_len = BUFFSIZE - this->write_pos;
+ int free = buf_free (this);
+ if (len > free)
+ len = free;
+ if (first_len > len)
+ first_len = len;
+
+ /* copy from current write_pos to end of buffer */
+ memcpy (&(this->buffer[this->write_pos]), data, first_len);
+ if (len > first_len) { /* we have to wrap around */
+ /* remaining part from beginning of buffer */
+ memcpy (this->buffer, &data[first_len], len - first_len);
+ }
+ this->write_pos = (this->write_pos + len) % BUFFSIZE;
+
+ return len;
+}
+
+static int write_buffer_16 (jack_driver_t *this, unsigned char *data, int len)
+{
+ int samples_free = buf_free (this) / (sizeof (float));
+ int samples = len / 2;
+ if (samples > samples_free)
+ samples = samples_free;
+
+ /* Rename some pointers so that the next bit of gymnastics is easier to read */
+ uint32_t write_pos = this->write_pos;
+ float *p_write;
+ int16_t *p_read = (int16_t *) data;
+ int i;
+ for (i = 0; i < samples; i++) {
+ /* Read in 16bits, write out floats */
+ p_write = (float *) (&(this->buffer[write_pos]));
+ *p_write = ((float) (p_read[i])) / 32767.0f;
+ write_pos = (write_pos + sizeof (float)) % BUFFSIZE;
+ }
+ this->write_pos = write_pos;
+
+ return samples * 2;
+}
-typedef struct {
- audio_driver_class_t driver_class;
- config_values_t *config;
- xine_t *xine;
-} jack_class_t;
-static int jack_process(jack_nframes_t nframes, void *arg)
+/**
+ * \brief read data from buffer and splitting it into channels
+ * \param bufs num_bufs float buffers, each will contain the data of one channel
+ * \param cnt number of samples to read per channel
+ * \param num_bufs number of channels to split the data into
+ * \return number of samples read per channel, equals cnt unless there was too
+ * little data in the buffer
+ *
+ * Assumes the data in the buffer is of type float, the number of bytes
+ * read is res * num_bufs * sizeof(float), where res is the return value.
+ * If there is not enough data in the buffer remaining parts will be filled
+ * with silence.
+ */
+static int read_buffer (jack_driver_t *this, float **bufs, int cnt,
+ int num_bufs, float gain)
{
- jack_driver_t *this = (jack_driver_t *)arg;
- uint32_t local_buf_read = this->buf_read;
- uint32_t local_buf_write = this->buf_write;
- uint32_t src_channel, target_channel;
- uint32_t frame;
- float *buf, *out;
- float gain = 0;
-
- if (!this->client) return 0;
-
- if (!this->mute) {
- gain = (float)this->volume / 100.0;
+ int buffered = buf_used (this);
+ int i, j;
+ int orig_cnt = cnt;
+ if (cnt * sizeof (float) * num_bufs > buffered)
+ cnt = buffered / (sizeof (float) * num_bufs);
+
+ uint32_t read_pos = this->read_pos;
+ unsigned char *buffer = this->buffer;
+ for (i = 0; i < cnt; i++) {
+ for (j = 0; j < num_bufs; j++) {
+ bufs[j][i] = *((float *) (&(buffer[read_pos]))) * gain;
+ read_pos = (read_pos + sizeof (float)) % BUFFSIZE;
}
+ }
+ this->read_pos = read_pos;
+ for (i = cnt; i < orig_cnt; i++)
+ for (j = 0; j < num_bufs; j++)
+ bufs[j][i] = 0;
- for (target_channel = 0; target_channel < 2; ++target_channel) {
-
- if (target_channel < this->num_channels) src_channel = target_channel;
- else src_channel = 0;
+ return cnt;
+}
- jack_port_t *port = (target_channel ? this->port_2 : this->port_1);
- if (!port) continue;
+/**
+ * \brief fill the buffers with silence
+ * \param bufs num_bufs float buffers, each will contain the data of one channel
+ * \param cnt number of samples in each buffer
+ * \param num_bufs number of buffers
+ */
+static void silence (float **bufs, int cnt, int num_bufs)
+{
+ int i, j;
+ for (i = 0; i < cnt; i++)
+ for (j = 0; j < num_bufs; j++)
+ bufs[j][i] = 0;
+}
- buf = (src_channel ? this->buf_2 : this->buf_1);
- out = (float *)jack_port_get_buffer(port, nframes);
- local_buf_read = this->buf_read;
- frame = 0;
+/**************************************************************
+ *
+ * Jack interface functions
+ *
+**************************************************************/
- while (frame < nframes && local_buf_read != local_buf_write) {
- // local_buf_write doesn't change during this process,
- // so we can safely defer updating buf_read until after
+/**
+ * \brief stop playing and empty buffers (for seeking/pause)
+ */
+static void jack_reset (jack_driver_t *this)
+{
+ this->paused = 1;
+ this->read_pos = this->write_pos = 0;
+ this->paused = 0;
+}
- out[frame++] = buf[local_buf_read] * gain;
- if (++local_buf_read == BUFSIZE) local_buf_read = 0;
- }
+static int jack_callback (jack_nframes_t nframes, void *arg)
+{
+ jack_driver_t *this = (jack_driver_t *) arg;
- if (frame < nframes) {
-// printf("jack_process: underrun: %u required, %u available\n",
-// nframes, frame);
- while (frame < nframes) {
- out[frame++] = 0.0f;
- }
- }
+ if (!this->client) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_callback: called without a client parameter? silently trying to continue...\n");
+ return 0;
+ }
+
+ float gain = 0;
+ if (!this->mixer.mute) {
+ gain = (float) this->mixer.volume / 100.0;
+ gain *= gain; /* experiment with increasing volume range */
+ }
+
+ float *bufs[MAX_CHANS];
+ int i;
+ for (i = 0; i < this->num_channels; i++)
+ bufs[i] = jack_port_get_buffer (this->ports[i], nframes);
+
+ if (this->paused || this->underrun) {
+ silence (bufs, nframes, this->num_channels);
+ } else {
+ int frames_read = read_buffer (this, bufs, nframes, this->num_channels, gain);
+ if (frames_read < nframes) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_callback: underrun - frames read: %d\n", frames_read);
+ this->underrun = 1;
}
+ }
- this->buf_read = local_buf_read;
+ return 0;
+}
-// printf("jack_process: buf_read %u, buf_write %u\n", this->buf_read, this->buf_write);
+static void jack_shutdown (void *arg)
+{
+ jack_driver_t *this = (jack_driver_t *) arg;
+ this->client = NULL;
+}
- return 0;
+/*
+ * Open the Jack audio device
+ * Return 1 on success, 0 on failure
+ * All error handling rests with the caller, we just try to open the device here
+ */
+static int jack_open_device (ao_driver_t *this_gen, char *jack_device,
+ int32_t *poutput_sample_rate, int num_channels)
+{
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ const char **matching_ports = NULL;
+ char *port_name = NULL;
+ jack_client_t *client = this->client;
+
+ int port_flags = JackPortIsInput;
+ int i;
+ int num_ports;
+
+ if (num_channels > MAX_CHANS) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: Invalid number of channels: %i\n",
+ num_channels);
+ goto err_out;
+ }
+ /* Try to create a client called "xine" */
+ if ((client = jack_client_new ("xine")) == 0) {
+ /* If that doesn't work it could be because running two copies of xine - try using a unique name */
+ char client_name[20];
+ sprintf (client_name, "xine (%d)", (int) getpid ());
+
+ if ((client = jack_client_new (client_name)) == 0) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "\njack_open_device: Error: Failed to connect to JACK server\n");
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: (did you start 'jackd' server?)\n");
+ goto err_out;
+ }
+ }
+
+ /* Save the new client */
+ this->client = client;
+
+ jack_reset (this);
+ jack_set_process_callback (client, jack_callback, this);
+
+ /* list matching ports */
+ if (!jack_device)
+ port_flags |= JackPortIsPhysical;
+ matching_ports = jack_get_ports (client, jack_device, NULL, port_flags);
+ for (num_ports = 0; matching_ports && matching_ports[num_ports];
+ num_ports++);
+ if (!num_ports) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: no physical ports available\n");
+ goto err_out;
+ }
+ if (num_ports < num_channels) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: not enough physical ports available\n");
+ goto err_out;
+ }
+
+ /* create output ports */
+ for (i = 0; i < num_channels; i++) {
+ char pname[50];
+ snprintf (pname, 50, "out_%d", i);
+ this->ports[i] =
+ jack_port_register (client, pname, JACK_DEFAULT_AUDIO_TYPE,
+ JackPortIsOutput, 0);
+ if (!this->ports[i]) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: could not create output ports? Why not?\n");
+ goto err_out;
+ }
+ }
+ if (jack_activate (client)) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: jack_activate() failed\n");
+ goto err_out;
+ }
+ for (i = 0; i < num_channels; i++) {
+ if (jack_connect
+ (client, jack_port_name (this->ports[i]), matching_ports[i])) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "jack_open_device: jack_connect() failed\n");
+ goto err_out;
+ }
+ }
+ *poutput_sample_rate = jack_get_sample_rate (client);
+
+ free (matching_ports);
+ return 1;
+
+err_out:
+ free (matching_ports);
+ if (client) {
+ jack_client_close (client);
+ this->client = NULL;
+ }
+ return 0;
}
-
-static void jack_shutdown(void *arg)
+
+/**************************************************************
+ *
+ * Xine interface functions
+ *
+**************************************************************/
+
+
+/**
+ * close the device and reset the play position
+ */
+static void ao_jack_close (ao_driver_t *this_gen)
{
- jack_driver_t *this = (jack_driver_t *)arg;
- this->client = 0;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG, "ao_jack_close: closing\n");
+
+ jack_reset (this);
+ if (this->client) {
+ jack_client_close (this->client);
+ this->client = NULL;
+ }
}
/*
* open the audio device for writing to
*/
-static int ao_jack_open(ao_driver_t *this_gen, uint32_t bits, uint32_t rate, int mode)
+static int ao_jack_open (ao_driver_t *this_gen, uint32_t bits, uint32_t rate,
+ int mode)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ config_values_t *config = this->xine->config;
+ char *jack_device;
- if (bits != 16) {
- fprintf(stderr, "ao_jack_open: bits=%u expected %u\n", bits, 16);
- return 0;
- }
+ jack_device =
+ config->lookup_entry (config, "audio.device.jack_device_name")->str_value;
- rate = jack_get_sample_rate(this->client);
- fprintf(stderr, "ao_jack_open: JACK sample rate is %u\n", rate);
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_open: ao_open rate=%d, mode=%d, bits=%d dev=%s\n", rate,
+ mode, bits, jack_device);
- switch (mode) {
- case AO_CAP_MODE_MONO:
- this->num_channels = 1;
- break;
- case AO_CAP_MODE_STEREO:
- this->num_channels = 2;
- break;
+ if ((bits != 16) && (bits != 32)) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "ao_jack_open: bits=%u expected 16 or 32bit only\n", bits);
+ return 0;
+ }
+
+ if ((mode & this->capabilities) == 0) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "ao_jack_open: unsupported mode %08x\n", mode);
+ return 0;
+ }
+
+ /* If device open already then either re-use it or close it */
+ if (this->client) {
+ if ((mode == this->mode) && (rate == this->input_sample_rate)) {
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_open: device already open, reusing it\n");
+ return this->output_sample_rate;
}
- this->buf_read = this->buf_write = 0;
- this->sample_rate = rate;
- this->bits_per_sample = bits;
- this->capabilities = AO_CAP_16BITS | AO_CAP_MODE_MONO | \
- AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL;
- this->bytes_per_frame = this->num_channels * (bits / 8);
+ ao_jack_close (this_gen);
+ }
+
+
+ this->mode = mode;
+ this->input_sample_rate = rate;
+ this->bits_per_sample = bits;
+ this->bytes_in_buffer = 0;
+ this->read_pos = this->write_pos = 0;
+ this->paused = 0;
+ this->underrun = 0;
+
+ /*
+ * set number of channels / a52 passthrough
+ */
+ switch (mode) {
+ case AO_CAP_MODE_MONO:
+ this->num_channels = 1;
+ break;
+ case AO_CAP_MODE_STEREO:
+ this->num_channels = 2;
+ break;
+ case AO_CAP_MODE_4CHANNEL:
+ this->num_channels = 4;
+ break;
+ case AO_CAP_MODE_4_1CHANNEL:
+ case AO_CAP_MODE_5CHANNEL:
+ case AO_CAP_MODE_5_1CHANNEL:
+ this->num_channels = 6;
+ break;
+ case AO_CAP_MODE_A52:
+ case AO_CAP_MODE_AC5:
+ /* FIXME: Is this correct...? */
+ this->num_channels = 2;
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_open: AO_CAP_MODE_A52\n");
+ break;
+ default:
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "ao_jack_open: JACK Driver does not support the requested mode: 0x%X\n",
+ mode);
+ return 0;
+ }
+
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "ao_jack_open: %d channels output\n", this->num_channels);
+ this->bytes_per_frame = (this->bits_per_sample * this->num_channels) / 8;
- fprintf(stderr, "ao_jack_open: bits=%d rate=%d, mode=%d OK\n", bits, rate, mode);
+ /*
+ * open audio device
+ */
+ if (!jack_open_device (this_gen, jack_device, &(this->output_sample_rate),
+ this->num_channels))
+ return 0;
- return rate;
+ if (this->input_sample_rate != this->output_sample_rate) {
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_open: audio rate : %d requested, %d provided by device\n",
+ this->input_sample_rate, this->output_sample_rate);
+ }
+
+ return this->output_sample_rate;
}
-static int ao_jack_num_channels(ao_driver_t *this_gen)
+static int ao_jack_num_channels (ao_driver_t *this_gen)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
- return this->num_channels;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ return this->num_channels;
}
-static int ao_jack_bytes_per_frame(ao_driver_t *this_gen)
+static int ao_jack_bytes_per_frame (ao_driver_t *this_gen)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
- return this->bytes_per_frame;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ return this->bytes_per_frame;
}
static int ao_jack_get_gap_tolerance (ao_driver_t *this_gen)
{
- return GAP_TOLERANCE;
+ return GAP_TOLERANCE;
}
-static int last_write_space = 0;
-
-static int ao_jack_write(ao_driver_t *this_gen, int16_t *data,
- uint32_t num_frames)
+/*
+ * Return the number of outstanding frames in all output buffers
+ * need to account for ring buffer plus Jack, plus soundcard
+ */
+static int ao_jack_delay (ao_driver_t *this_gen)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
- uint32_t frame, channel;
-
- uint32_t local_buf_read = this->buf_read;
- uint32_t local_buf_write = this->buf_write;
- uint32_t space = (local_buf_read + BUFSIZE - local_buf_write - 1) % BUFSIZE;
- uint32_t first_frame = 0;
-
- int c = 0;
- while (space < num_frames) {
- if (++c == 10) return 0;
- usleep(10000);
- local_buf_read = this->buf_read;
- space = (local_buf_read + BUFSIZE - local_buf_write - 1) % BUFSIZE;
- }
-
-// if (space < num_frames) return 0;
-
-// printf("ao_jack_write: %u frames on %u channels, space is %u\n", num_frames, this->num_channels, space);
- last_write_space = space;
-
- for (frame = first_frame; frame < num_frames; ++frame) {
- for (channel = 0; channel < this->num_channels; ++channel) {
- float *buf = (channel ? this->buf_2 : this->buf_1);
- int16_t sample = data[frame * this->num_channels + channel];
- buf[local_buf_write] = ((float)sample) / 32767.0f;
-// printf("%6f ", buf[local_buf_write]);
-// if (++c == 8) { printf("\n"); c = 0; }
- }
- if (++local_buf_write == BUFSIZE) local_buf_write = 0;
- }
-
- this->buf_write = local_buf_write;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ int frames_played = jack_frames_since_cycle_start (this->client);
-// printf("ao_jack_write: buf_read %u, buf_write %u\n", this->buf_read, this->buf_write);
+ int delay = 0;
+ /* Ring Buffer always stores floats */
+ /* TODO: Unsure if the delay should be fragment_size*2 or *3? */
+ delay = buf_used (this) / (sizeof (float) * this->num_channels) +
+ this->fragment_size * 3 - frames_played;
- return 1;
+ return delay;
}
-static int ao_jack_delay (ao_driver_t *this_gen)
+ /* Write audio samples
+ * num_frames is the number of audio frames present
+ * audio frames are equivalent one sample on each channel.
+ * I.E. Stereo 16 bits audio frames are 4 bytes.
+ * MUST SIMULATE BLOCKING WRITES
+ */
+static int ao_jack_write (ao_driver_t *this_gen, int16_t *frame_buffer,
+ uint32_t num_frames)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
-
- uint32_t local_buf_read = this->buf_read;
- uint32_t local_buf_write = this->buf_write;
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ int written = 0;
+ int num_bytes = num_frames * this->bytes_per_frame;
+
+ /* First try and write all the bytes in one go */
+ this->underrun = 0;
+ /* TODO: In the future Xine should pass only floats to us, so no conversion needed */
+ if (this->bits_per_sample == 16)
+ written = write_buffer_16 (this, (char *) frame_buffer, num_bytes);
+ else if (this->bits_per_sample == 32)
+ written = write_buffer_32 (this, (char *) frame_buffer, num_bytes);
+
+ /* If this fails then need to spin and keep trying until everything written */
+ int spin_count = 0;
+ while ((written < num_bytes) && (spin_count < 40)) {
+ num_bytes -= written;
+ frame_buffer += written / 2;
+
+ /* Sleep to save CPU */
+ int until_callback =
+ this->fragment_size - jack_frames_since_cycle_start (this->client);
+ if ((until_callback < 0) || (until_callback > this->fragment_size)) {
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_write: Invalid until_callback %d\n", until_callback);
+ until_callback = this->fragment_size;
+ }
+ xine_usec_sleep (((until_callback +
+ 100) * 1000.0 * 1000.0) / this->output_sample_rate);
- int delay = 0;
+ if (this->bits_per_sample == 16)
+ written = write_buffer_16 (this, (char *) frame_buffer, num_bytes);
+ else if (this->bits_per_sample == 32)
+ written = write_buffer_32 (this, (char *) frame_buffer, num_bytes);
- if (local_buf_write > local_buf_read) {
- delay = local_buf_write - local_buf_read;
- } else {
- delay = ((local_buf_write + BUFSIZE - local_buf_read) % BUFSIZE);
- }
+ if (written == 0)
+ spin_count++;
+ else
+ spin_count = 0;
- return delay;// - jack_get_buffer_size(this->client);
-}
+ if (written == 0)
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "ao_jack_write: unusual, couldn't write anything\n");
+ };
-static void ao_jack_close(ao_driver_t *this_gen)
-{
- // nothing
-}
+ if (spin_count)
+ xprintf (this->xine, XINE_VERBOSITY_DEBUG,
+ "Nonzero spin_count...%d\n", spin_count);
-static uint32_t ao_jack_get_capabilities (ao_driver_t *this_gen) {
- jack_driver_t *this = (jack_driver_t *) this_gen;
- return this->capabilities;
+ return spin_count ? 0 : 1; /* return 1 on success, 0 if we got stuck for some reason */
}
-static void ao_jack_exit(ao_driver_t *this_gen)
+static uint32_t ao_jack_get_capabilities (ao_driver_t *this_gen)
{
- jack_driver_t *this = (jack_driver_t *) this_gen;
- jack_client_t *client = this->client;
- ao_jack_close(this_gen);
- this->client = 0;
- if (client) jack_client_close(client);
- free (this);
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+ return this->capabilities;
}
-static int ao_jack_get_property (ao_driver_t *this_gen, int property) {
- jack_driver_t *this = (jack_driver_t *) this_gen;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
-// printf("ao_jack_get_property(AO_PROP_MIXER_VOL): %u\n", this->volume);
- return this->volume;
- break;
- case AO_PROP_MUTE_VOL:
-// printf("ao_jack_get_property(AO_PROP_MUTE_VOL): %u\n", this->mute);
- return this->mute;
- break;
- }
+static void ao_jack_exit (ao_driver_t *this_gen)
+{
+ jack_driver_t *this = (jack_driver_t *) this_gen;
- return 0;
+ ao_jack_close (this_gen);
+ if (this->buffer)
+ free (this->buffer);
+ free (this);
}
-static int ao_jack_set_property (ao_driver_t *this_gen, int property, int value) {
- jack_driver_t *this = (jack_driver_t *) this_gen;
-
- switch(property) {
- case AO_PROP_PCM_VOL:
- case AO_PROP_MIXER_VOL:
-// printf("ao_jack_set_property(AO_PROP_MIXER_VOL): %u\n", value);
- this->volume = value;
- break;
- case AO_PROP_MUTE_VOL:
-// printf("ao_jack_get_property(AO_PROP_MUTE_VOL): %u\n", value);
- this->mute = value;
- break;
- }
+static int ao_jack_get_property (ao_driver_t *this_gen, int property)
+{
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+
+ switch (property) {
+ case AO_PROP_PCM_VOL:
+ case AO_PROP_MIXER_VOL:
+ return this->mixer.volume;
+ break;
+ case AO_PROP_MUTE_VOL:
+ return this->mixer.mute;
+ break;
+ }
+
+ return 0;
+}
- return ~value;
+static int ao_jack_set_property (ao_driver_t *this_gen, int property, int value)
+{
+ jack_driver_t *this = (jack_driver_t *) this_gen;
+
+ switch (property) {
+ case AO_PROP_PCM_VOL:
+ case AO_PROP_MIXER_VOL:
+ this->mixer.volume = value;
+ return value;
+ break;
+ case AO_PROP_MUTE_VOL:
+ this->mixer.mute = value;
+ return value;
+ break;
+ }
+
+ return -1;
}
-static int ao_jack_ctrl(ao_driver_t *this_gen, int cmd, ...) {
- jack_driver_t *this = (jack_driver_t *) this_gen;
+static int ao_jack_ctrl (ao_driver_t *this_gen, int cmd, ...)
+{
+ jack_driver_t *this = (jack_driver_t *) this_gen;
- switch (cmd) {
+ switch (cmd) {
- case AO_CTRL_PLAY_PAUSE:
- break;
+ case AO_CTRL_PLAY_PAUSE:
+ this->paused = 1;
+ break;
- case AO_CTRL_PLAY_RESUME:
- break;
+ case AO_CTRL_PLAY_RESUME:
+ this->paused = 0;
+ break;
- case AO_CTRL_FLUSH_BUFFERS:
-// fprintf(stderr, "ao_jack_ctrl(AO_CTRL_FLUSH_BUFFERS)\n");
- this->buf_write = this->buf_read = 0;
- break;
- }
+ case AO_CTRL_FLUSH_BUFFERS:
+ jack_reset (this);
+ break;
+ }
- return 0;
+ return 0;
}
+static void jack_speaker_arrangement_cb (void *user_data,
+ xine_cfg_entry_t *entry);
+
static ao_driver_t *open_jack_plugin (audio_driver_class_t *class_gen,
const void *data)
{
- jack_class_t *class = (jack_class_t *) class_gen;
- jack_driver_t *this;
- jack_client_t *client;
- uint32_t rate;
- const char **port_names;
- int i;
-
- if ((client = jack_client_new("xine")) == 0) {
-
- char name[20];
- sprintf(name, "xine (%d)", (int)getpid());
-
- if ((client = jack_client_new(name)) == 0) {
- fprintf(stderr, "\nopen_jack_plugin: Error: Failed to connect to JACK server\n");
- fprintf(stderr, "open_jack_plugin: (did you start 'jackd' server?)\n");
- return 0;
- }
- }
-
- this = (jack_driver_t *) xine_xmalloc (sizeof (jack_driver_t));
-
- this->client = client;
-
- jack_set_process_callback(client, jack_process, this);
- jack_on_shutdown(client, jack_shutdown, this);
-
- rate = jack_get_sample_rate(client);
- fprintf(stderr, "open_jack_plugin: JACK sample rate is %u\n", rate);
-
- // We support up to 2-channel output
-
- for (i = 0; i < 2; ++i) {
- jack_port_t *port = jack_port_register
- (client, (i ? "out_r" : "out_l"),
- JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
- if (!port) {
- fprintf(stderr, "ao_jack_open: failed to register port %u\n", i);
- }
- if (i) this->port_2 = port;
- else this->port_1 = port;
- }
-
- this->buf_read = this->buf_write = 0;
- this->volume = 100;
- this->mute = 0;
-
- if (jack_activate(client)) {
- fprintf(stderr, "ao_jack_open: failed to activate JACK client\n");
- return 0;
- }
-
- if ((port_names = jack_get_ports(client, NULL, NULL,
- JackPortIsPhysical | JackPortIsInput)) != NULL) {
- if (port_names[0]) {
- jack_connect(client, jack_port_name(this->port_1), port_names[0]);
- }
- if (port_names[1] && this->port_2) {
- jack_connect(client, jack_port_name(this->port_2), port_names[1]);
- }
- free(port_names);
+ jack_class_t *class = (jack_class_t *) class_gen;
+ config_values_t *config = class->config;
+ jack_driver_t *this;
+
+ jack_client_t *client;
+ uint32_t rate;
+ char *jack_device;
+ const char **matching_ports = NULL;
+ const char **port_names;
+
+ /* for usability reasons, keep this in sync with audio_oss_out.c */
+ static char *speaker_arrangement[] = {
+ "Mono 1.0", "Stereo 2.0", "Headphones 2.0", "Stereo 2.1",
+ "Surround 3.0", "Surround 4.0", "Surround 4.1", "Surround 5.0",
+ "Surround 5.1", "Surround 6.0",
+ "Surround 6.1", "Surround 7.1", "Pass Through", NULL
+ };
+#define MONO 0
+#define STEREO 1
+#define HEADPHONES 2
+#define SURROUND21 3
+#define SURROUND3 4
+#define SURROUND4 5
+#define SURROUND41 6
+#define SURROUND5 7
+#define SURROUND51 8
+#define SURROUND6 9
+#define SURROUND61 10
+#define SURROUND71 11
+#define A52_PASSTHRU 12
+ int speakers;
+
+ /* Try to create a client called "xine" */
+ if ((client = jack_client_new ("xine")) == 0) {
+ /* If that doesn't work it could be because running two copies of xine - try using a unique name */
+ char name[20];
+ sprintf (name, "xine (%d)", (int) getpid ());
+
+ if ((client = jack_client_new (name)) == 0) {
+ xprintf (class->xine, XINE_VERBOSITY_LOG,
+ "\nopen_jack_plugin: Error: Failed to connect to JACK server\n");
+ xprintf (class->xine, XINE_VERBOSITY_LOG,
+ "open_jack_plugin: (did you start 'jackd' server?)\n");
+ return 0;
}
+ }
+
+ this = calloc(1, sizeof (jack_driver_t));
+
+ rate = jack_get_sample_rate (client);
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG,
+ "open_jack_plugin: JACK sample rate is %u\n", rate);
+
+ /* devname_val is offset used to select auto, /dev/dsp, or /dev/sound/dsp */
+ jack_device = config->register_string (config,
+ "audio.device.jack_device_name",
+ "",
+ _("JACK audio device name"),
+ _("Specifies the jack audio device name, "
+ "leave blank for the default physical output port."),
+ 10, NULL, NULL);
+
+ this->capabilities = 0;
+
+
+ /* for usability reasons, keep this in sync with audio_alsa_out.c */
+ speakers =
+ config->register_enum (config, "audio.output.speaker_arrangement",
+ STEREO, speaker_arrangement,
+ _("speaker arrangement"),
+ _("Select how your speakers are arranged, "
+ "this determines which speakers xine uses for sound output. "
+ "The individual values are:\n\n"
+ "Mono 1.0: You have only one speaker.\n"
+ "Stereo 2.0: You have two speakers for left and right channel.\n"
+ "Headphones 2.0: You use headphones.\n"
+ "Stereo 2.1: You have two speakers for left and right channel, and one "
+ "subwoofer for the low frequencies.\n"
+ "Surround 3.0: You have three speakers for left, right and rear channel.\n"
+ "Surround 4.0: You have four speakers for front left and right and rear "
+ "left and right channels.\n"
+ "Surround 4.1: You have four speakers for front left and right and rear "
+ "left and right channels, and one subwoofer for the low frequencies.\n"
+ "Surround 5.0: You have five speakers for front left, center and right and "
+ "rear left and right channels.\n"
+ "Surround 5.1: You have five speakers for front left, center and right and "
+ "rear left and right channels, and one subwoofer for the low frequencies.\n"
+ "Surround 6.0: You have six speakers for front left, center and right and "
+ "rear left, center and right channels.\n"
+ "Surround 6.1: You have six speakers for front left, center and right and "
+ "rear left, center and right channels, and one subwoofer for the low frequencies.\n"
+ "Surround 7.1: You have seven speakers for front left, center and right, "
+ "left and right and rear left and right channels, and one subwoofer for the "
+ "low frequencies.\n"
+ "Pass Through: Your sound system will receive undecoded digital sound from xine. "
+ "You need to connect a digital surround decoder capable of decoding the "
+ "formats you want to play to your sound card's digital output."),
+ 0, jack_speaker_arrangement_cb, this);
+
+ int port_flags = JackPortIsInput;
+ int num_ports;
+ /* list matching ports */
+ if (!jack_device)
+ port_flags |= JackPortIsPhysical;
+ /* Find all the ports matching either the desired device regexp or physical output ports */
+ matching_ports = jack_get_ports (client, jack_device, NULL, port_flags);
+ /* Count 'em */
+ for (num_ports = 0; matching_ports && matching_ports[num_ports];
+ num_ports++)
+ /**/;
+ if (!num_ports) {
+ xprintf (this->xine, XINE_VERBOSITY_LOG,
+ "open_jack_plugin: no physical ports available\n");
+ goto err_out;
+ }
+
+
+/* TODO: We deliberately don't offer mono, let Xine upsample instead? */
+/* if (num_ports >= 1) { */
+/* this->capabilities |= AO_CAP_MODE_MONO; */
+/* xprintf(class->xine, XINE_VERBOSITY_DEBUG, "mono "); */
+/* } */
+
+ if (num_ports >= 2) {
+ this->capabilities |= AO_CAP_MODE_STEREO;
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG, "stereo ");
+ }
+
+ if (num_ports >= 4) {
+ if (speakers == SURROUND4) {
+ this->capabilities |= AO_CAP_MODE_4CHANNEL;
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG, "4-channel ");
+ } else
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG,
+ "(4-channel not enabled in xine config) ");
+ }
+
+ if (num_ports >= 5) {
+ if (speakers == SURROUND5) {
+ this->capabilities |= AO_CAP_MODE_5CHANNEL;
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG, "5-channel ");
+ } else
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG,
+ "(5-channel not enabled in xine config) ");
+ }
+
+ if (num_ports >= 6) {
+ if (speakers == SURROUND51) {
+ this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG, "5.1-channel ");
+ } else
+ xprintf (class->xine, XINE_VERBOSITY_DEBUG,
+ "(5.1-channel not enabled in xine config) ");
+ }
+
+ this->buffer = (unsigned char *) malloc (BUFFSIZE);
+ jack_reset (this);
+
+ this->capabilities |= AO_CAP_MIXER_VOL;
+ this->capabilities |= AO_CAP_MUTE_VOL;
+ /* TODO: Currently not respected by Xine, perhaps v1.2? */
+ this->capabilities |= AO_CAP_FLOAT32;
+
+
+ this->mixer.mute = 0;
+ this->mixer.volume = 100;
+
+ this->output_sample_rate = jack_get_sample_rate (client);
+ this->fragment_size = jack_get_buffer_size (client);
+
+ /* Close our JACK client */
+ jack_client_close (client);
+
+ this->xine = class->xine;
+
+ this->ao_driver.get_capabilities = ao_jack_get_capabilities;
+ this->ao_driver.get_property = ao_jack_get_property;
+ this->ao_driver.set_property = ao_jack_set_property;
+ this->ao_driver.open = ao_jack_open;
+ this->ao_driver.num_channels = ao_jack_num_channels;
+ this->ao_driver.bytes_per_frame = ao_jack_bytes_per_frame;
+ this->ao_driver.delay = ao_jack_delay;
+ this->ao_driver.write = ao_jack_write;
+ this->ao_driver.close = ao_jack_close;
+ this->ao_driver.exit = ao_jack_exit;
+ this->ao_driver.get_gap_tolerance = ao_jack_get_gap_tolerance;
+ this->ao_driver.control = ao_jack_ctrl;
+
+ return &this->ao_driver;
+
+err_out:
+ free (matching_ports);
+ if (client)
+ jack_client_close (client);
+ return 0;
+}
- this->sample_rate = rate;
-
- this->xine = class->xine;
- this->capabilities = AO_CAP_FLOAT32 | AO_CAP_MODE_MONO |
- AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL;
-
- this->ao_driver.get_capabilities = ao_jack_get_capabilities;
- this->ao_driver.get_property = ao_jack_get_property;
- this->ao_driver.set_property = ao_jack_set_property;
- this->ao_driver.open = ao_jack_open;
- this->ao_driver.num_channels = ao_jack_num_channels;
- this->ao_driver.bytes_per_frame = ao_jack_bytes_per_frame;
- this->ao_driver.delay = ao_jack_delay;
- this->ao_driver.write = ao_jack_write;
- this->ao_driver.close = ao_jack_close;
- this->ao_driver.exit = ao_jack_exit;
- this->ao_driver.get_gap_tolerance = ao_jack_get_gap_tolerance;
- this->ao_driver.control = ao_jack_ctrl;
-
- fprintf(stderr, "jack open_jack_plugin returning %p\n", (void *)(&this->ao_driver));
- return &this->ao_driver;
+static void jack_speaker_arrangement_cb (void *user_data,
+ xine_cfg_entry_t *entry)
+{
+ jack_driver_t *this = (jack_driver_t *) user_data;
+ int32_t value = entry->num_value;
+ if (value == SURROUND4) {
+ this->capabilities |= AO_CAP_MODE_4CHANNEL;
+ } else {
+ this->capabilities &= ~AO_CAP_MODE_4CHANNEL;
+ }
+ if (value == SURROUND41) {
+ this->capabilities |= AO_CAP_MODE_4_1CHANNEL;
+ } else {
+ this->capabilities &= ~AO_CAP_MODE_4_1CHANNEL;
+ }
+ if (value == SURROUND5) {
+ this->capabilities |= AO_CAP_MODE_5CHANNEL;
+ } else {
+ this->capabilities &= ~AO_CAP_MODE_5CHANNEL;
+ }
+ if (value >= SURROUND51) {
+ this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
+ } else {
+ this->capabilities &= ~AO_CAP_MODE_5_1CHANNEL;
+ }
}
/*
* class functions
*/
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "jack";
+static char *get_identifier (audio_driver_class_t *this_gen)
+{
+ return "jack";
}
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine output plugin for JACK Audio Connection Kit");
+static char *get_description (audio_driver_class_t *this_gen)
+{
+ return _("xine output plugin for JACK Audio Connection Kit");
}
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- jack_class_t *this = (jack_class_t *) this_gen;
- free (this);
+static void dispose_class (audio_driver_class_t *this_gen)
+{
+ jack_class_t *this = (jack_class_t *) this_gen;
+ free (this);
}
-static void *init_class (xine_t *xine, void *data) {
-
- jack_class_t *this;
-
- this = (jack_class_t *) xine_xmalloc (sizeof (jack_class_t));
+static void *init_class (xine_t *xine, void *data)
+{
+ jack_class_t *this;
- this->driver_class.open_plugin = open_jack_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this = calloc(1, sizeof (jack_class_t));
- this->config = xine->config;
- this->xine = xine;
+ this->driver_class.open_plugin = open_jack_plugin;
+ this->driver_class.get_identifier = get_identifier;
+ this->driver_class.get_description = get_description;
+ this->driver_class.dispose = dispose_class;
- fprintf(stderr, "jack init_class returning %p\n", (void *)this);
+ this->config = xine->config;
+ this->xine = xine;
- return this;
+ return this;
}
-static ao_info_t ao_info_jack = {
- 6
-};
+static ao_info_t ao_info_jack = { 6 };
/*
* exported plugin catalog entry
*/
const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE /* XINE_VERSION_CODE */, &ao_info_jack, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE,
+ &ao_info_jack, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
-
diff --git a/src/audio_out/audio_none_out.c b/src/audio_out/audio_none_out.c
index a815d645a..9ba9a00ca 100644
--- a/src/audio_out/audio_none_out.c
+++ b/src/audio_out/audio_none_out.c
@@ -186,7 +186,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
lprintf ("open_plugin called\n");
- this = (none_driver_t *) xine_xmalloc (sizeof (none_driver_t));
+ this = calloc(1, sizeof (none_driver_t));
if (!this)
return NULL;
@@ -236,7 +236,7 @@ static void *init_class (xine_t *xine, void *data) {
lprintf ("init class\n");
- this = (none_class_t *) xine_xmalloc (sizeof (none_class_t));
+ this = calloc(1, sizeof (none_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 40d5bcfdc..2ae116970 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -666,7 +666,7 @@ static int probe_audio_devices(oss_driver_t *this) {
int base_num, i;
int audio_fd, rate;
int best_rate;
- char devname[30];
+ char *devname[30];
strcpy(this->audio_dev, "auto");
@@ -729,7 +729,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
int speakers;
- this = (oss_driver_t *) xine_xmalloc (sizeof (oss_driver_t));
+ this = calloc(1, sizeof (oss_driver_t));
if (!this)
return NULL;
@@ -877,15 +877,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if (this->sync_method == OSS_SYNC_PROBEBUFFER) {
char *buf;
int c;
-
- xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("audio_oss_out: Audio driver realtime sync disabled...\n"
- "audio_oss_out: ...probing output buffer size: "));
+
this->buffer_size = 0;
- if( (buf=malloc(1024)) != NULL ) {
- memset(buf,0,1024);
-
+ if( (buf=calloc(1, 1024)) != NULL ) {
do {
c = write(audio_fd,buf,1024);
if( c != -1 )
@@ -896,7 +891,8 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
}
close(audio_fd);
xprintf(class->xine, XINE_VERBOSITY_LOG,
- _("%d bytes\naudio_oss_out: ...there may be audio/video synchronization issues\n"), this->buffer_size);
+ _("audio_oss_out: Audio driver realtime sync disabled...\n"
+ "audio_oss_out: ...probing output buffer size: %d bytes\naudio_oss_out: ...there may be audio/video synchronization issues\n"), this->buffer_size);
audio_fd=open(this->audio_dev, O_WRONLY|O_NONBLOCK);
@@ -959,48 +955,48 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
0, oss_speaker_arrangement_cb, this);
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: supported modes are ");
+ char *logmsg = strdup (_("audio_oss_out: supported modes are"));
num_channels = 1;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==1) ) {
this->capabilities |= AO_CAP_MODE_MONO;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "mono ");
+ xine_strcat_realloc (&logmsg, _(" mono"));
}
num_channels = 2;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==2) ) {
this->capabilities |= AO_CAP_MODE_STEREO;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "stereo ");
+ xine_strcat_realloc (&logmsg, _(" stereo"));
}
num_channels = 4;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==4) ) {
if ( speakers == SURROUND4 ) {
this->capabilities |= AO_CAP_MODE_4CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "4-channel ");
+ xine_strcat_realloc (&logmsg, _(" 4-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(4-channel not enabled in xine config) " );
+ xine_strcat_realloc (&logmsg, _(" (4-channel not enabled in xine config)"));
}
num_channels = 5;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==5) ) {
if ( speakers == SURROUND5 ) {
this->capabilities |= AO_CAP_MODE_5CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "5-channel ");
+ xine_strcat_realloc (&logmsg, _(" 5-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(5-channel not enabled in xine config) " );
+ xine_strcat_realloc (&logmsg, _(" (5-channel not enabled in xine config)"));
}
num_channels = 6;
status = ioctl(audio_fd, SNDCTL_DSP_CHANNELS, &num_channels);
if ( (status != -1) && (num_channels==6) ) {
if ( speakers == SURROUND51 ) {
this->capabilities |= AO_CAP_MODE_5_1CHANNEL;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "5.1-channel ");
+ xine_strcat_realloc (&logmsg, _(" 5.1-channel"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(5.1-channel not enabled in xine config) " );
+ xine_strcat_realloc (&logmsg, _(" (5.1-channel not enabled in xine config)"));
}
ioctl(audio_fd,SNDCTL_DSP_GETFMTS,&caps);
@@ -1010,10 +1006,13 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if ( speakers == A52_PASSTHRU ) {
this->capabilities |= AO_CAP_MODE_A52;
this->capabilities |= AO_CAP_MODE_AC5;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "a/52-pass-through ");
+ xine_strcat_realloc (&logmsg, _(" a/52 pass-through"));
}
else
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "(a/52-pass-through not enabled in xine config)");
+ xine_strcat_realloc (&logmsg, _(" (a/52 pass-through not enabled in xine config)"));
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "%s\n", logmsg);
+ free (logmsg);
/*
* mixer initialisation.
@@ -1040,20 +1039,17 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
if ((parse = strstr(mixer_name, "dsp"))) {
parse[0] = '\0';
parse += 3;
- this->mixer.name = (char *)malloc(strlen(mixer_name) + sizeof("mixer") + 2);
if (devname_val == 0)
- sprintf(this->mixer.name, "%smixer%s", mixer_name, parse);
+ asprintf(&(this->mixer.name), "%smixer%s", mixer_name, parse);
else {
if (mixer_num == -1)
- sprintf(this->mixer.name, "%smixer", mixer_name);
+ asprintf(&(this->mixer.name), "%smixer", mixer_name);
else
- sprintf(this->mixer.name, "%smixer%d", mixer_name, mixer_num);
+ asprintf(&(this->mixer.name), "%smixer%d", mixer_name, mixer_num);
}
} else {
- this->mixer.name = (char *)malloc(1);
- this->mixer.name[0] = '\0';
+ _x_abort();
}
- _x_assert(this->mixer.name[0] != '\0');
this->mixer.fd = open(this->mixer.name, O_RDONLY);
@@ -1170,7 +1166,7 @@ static void *init_class (xine_t *xine, void *data) {
oss_class_t *this;
- this = (oss_class_t *) xine_xmalloc (sizeof (oss_class_t));
+ this = calloc(1, sizeof (oss_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index 5a25db5ff..dfae98c31 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -745,7 +745,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
lprintf ("audio_pulse_out: open_plugin called\n");
- this = (pulse_driver_t *) xine_xmalloc (sizeof (pulse_driver_t));
+ this = calloc(1, sizeof (pulse_driver_t));
if (!this)
return NULL;
@@ -856,7 +856,7 @@ static void *init_class (xine_t *xine, void *data) {
lprintf ("audio_pulse_out: init class\n");
- this = (pulse_class_t *) xine_xmalloc (sizeof (pulse_class_t));
+ this = calloc(1, sizeof (pulse_class_t));
if (!this)
return NULL;
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index b23955b77..048db6b86 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -909,7 +909,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v
int status;
audio_info_t info;
- this = (sun_driver_t *) xine_xmalloc (sizeof (sun_driver_t));
+ this = calloc(1, sizeof (sun_driver_t));
if (!this)
return NULL;
@@ -1032,7 +1032,7 @@ static void ao_sun_dispose_class (audio_driver_class_t *this_gen) {
static void *ao_sun_init_class (xine_t *xine, void *data) {
sun_class_t *this;
- this = (sun_class_t *) xine_xmalloc (sizeof (sun_class_t));
+ this = calloc(1, sizeof (sun_class_t));
if (!this)
return NULL;
diff --git a/src/combined/combined_wavpack.h b/src/combined/combined_wavpack.h
index 61a504a4f..3cfa78509 100644
--- a/src/combined/combined_wavpack.h
+++ b/src/combined/combined_wavpack.h
@@ -21,6 +21,7 @@
*/
#include "os_types.h"
+#include "attributes.h"
typedef struct {
uint32_t idcode; /* This should always be the string "wvpk" */
@@ -35,7 +36,7 @@ typedef struct {
uint32_t samples_count; /* Count of samples in the current frame */
uint32_t flags; /* Misc flags */
uint32_t decoded_crc32; /* CRC32 of the decoded data */
-} __attribute__((packed)) wvheader_t;
+} XINE_PACKED wvheader_t;
#ifdef WORDS_BIGENDIAN
static const uint32_t wvpk_signature = ('k' + ('p' << 8) + ('v' << 16) + ('w' << 24));
diff --git a/src/combined/decoder_flac.c b/src/combined/decoder_flac.c
index 2230056cd..e5884006a 100644
--- a/src/combined/decoder_flac.c
+++ b/src/combined/decoder_flac.c
@@ -166,6 +166,7 @@ flac_write_callback (const FLAC__StreamDecoder *decoder,
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
+#ifdef LEGACY_FLAC
static void
flac_metadata_callback (const FLAC__StreamDecoder *decoder,
const FLAC__StreamMetadata *metadata,
@@ -188,6 +189,7 @@ flac_metadata_callback (const FLAC__StreamDecoder *decoder,
return;
}
+#endif
static void
flac_error_callback (const FLAC__StreamDecoder *decoder,
@@ -335,7 +337,7 @@ static audio_decoder_t *
open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
flac_decoder_t *this ;
- this = (flac_decoder_t *) xine_xmalloc (sizeof (flac_decoder_t));
+ this = calloc(1, sizeof (flac_decoder_t));
this->audio_decoder.decode_data = flac_decode_data;
this->audio_decoder.reset = flac_reset;
@@ -407,7 +409,7 @@ static void *
init_plugin (xine_t *xine, void *data) {
flac_class_t *this;
- this = (flac_class_t *) xine_xmalloc (sizeof (flac_class_t));
+ this = calloc(1, sizeof (flac_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/combined/decoder_wavpack.c b/src/combined/decoder_wavpack.c
index f8a301c9f..36bf0deab 100644
--- a/src/combined/decoder_wavpack.c
+++ b/src/combined/decoder_wavpack.c
@@ -291,7 +291,7 @@ static void wavpack_dispose (audio_decoder_t *this_gen) {
}
static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
- wavpack_decoder_t * const this = (wavpack_decoder_t *) xine_xmalloc (sizeof (wavpack_decoder_t));
+ wavpack_decoder_t * const this = calloc(1, sizeof (wavpack_decoder_t));
this->audio_decoder.decode_data = wavpack_decode_data;
this->audio_decoder.reset = wavpack_reset;
@@ -324,7 +324,7 @@ static void dispose_class (audio_decoder_class_t *this) {
void *decoder_wavpack_init_plugin (xine_t *xine, void *data) {
wavpack_class_t *this;
- this = (wavpack_class_t *) xine_xmalloc (sizeof (wavpack_class_t));
+ this = calloc(1, sizeof (wavpack_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c
index fdc7ab7ea..ebba63701 100644
--- a/src/combined/demux_flac.c
+++ b/src/combined/demux_flac.c
@@ -607,7 +607,7 @@ open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc (sizeof (demux_flac_t));
+ this = calloc(1, sizeof (demux_flac_t));
this->stream = stream;
this->input = input;
@@ -752,7 +752,7 @@ demux_flac_init_class (xine_t *xine, void *data) {
lprintf("demux_flac_init_class\n");
- this = xine_xmalloc (sizeof (demux_flac_class_t));
+ this = calloc(1, sizeof (demux_flac_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/combined/demux_wavpack.c b/src/combined/demux_wavpack.c
index 754052199..2c3e6ce55 100644
--- a/src/combined/demux_wavpack.c
+++ b/src/combined/demux_wavpack.c
@@ -332,7 +332,7 @@ static int demux_wv_get_optional_data(demux_plugin_t *const this_gen,
static demux_plugin_t *open_plugin (demux_class_t *const class_gen,
xine_stream_t *const stream,
input_plugin_t *const input) {
- demux_wv_t *const this = xine_xmalloc (sizeof (demux_wv_t));
+ demux_wv_t *const this = calloc(1, sizeof (demux_wv_t));
this->stream = stream;
this->input = input;
@@ -401,7 +401,7 @@ static void class_dispose (demux_class_t *const this_gen) {
}
void *demux_wv_init_plugin (xine_t *const xine, void *const data) {
- demux_wv_class_t *const this = xine_xmalloc (sizeof (demux_wv_class_t));
+ demux_wv_class_t *const this = calloc(1, sizeof (demux_wv_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c
index 042900867..4d8e440bb 100644
--- a/src/combined/ffmpeg/ff_audio_decoder.c
+++ b/src/combined/ffmpeg/ff_audio_decoder.c
@@ -178,7 +178,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
this->context->bit_rate = audio_header->nAvgBytesPerSec * 8;
if(audio_header->cbSize > 0) {
- this->context->extradata = xine_xmalloc(audio_header->cbSize);
+ this->context->extradata = malloc(audio_header->cbSize);
this->context->extradata_size = audio_header->cbSize;
memcpy( this->context->extradata,
(uint8_t *)audio_header + sizeof(xine_waveformatex),
@@ -203,7 +203,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
this->context->block_align = _X_BE_32(&this->buf[0x18]);
this->context->extradata_size = 5*sizeof(short);
- this->context->extradata = xine_xmalloc(this->context->extradata_size);
+ this->context->extradata = malloc(this->context->extradata_size);
ptr = (short *) this->context->extradata;
@@ -249,8 +249,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
break; /* abort early - extradata length is bad */
this->context->extradata_size = data_len;
- this->context->extradata = xine_xmalloc(this->context->extradata_size +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ this->context->extradata = malloc(this->context->extradata_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
xine_fast_memcpy (this->context->extradata, this->buf + extradata,
this->context->extradata_size);
break;
@@ -276,7 +276,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
this->size = 0;
- this->decode_buffer = xine_xmalloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);
+ this->decode_buffer = calloc(1, AVCODEC_MAX_AUDIO_FRAME_SIZE);
return;
}
@@ -284,8 +284,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
(buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM)) {
this->context->extradata_size = buf->decoder_info[2];
- this->context->extradata = xine_xmalloc(buf->decoder_info[2] +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ this->context->extradata = malloc(buf->decoder_info[2] +
+ FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(this->context->extradata, buf->decoder_info_ptr[2],
buf->decoder_info[2]);
@@ -450,7 +450,7 @@ static audio_decoder_t *ff_audio_open_plugin (audio_decoder_class_t *class_gen,
ff_audio_decoder_t *this ;
- this = (ff_audio_decoder_t *) xine_xmalloc (sizeof (ff_audio_decoder_t));
+ this = calloc(1, sizeof (ff_audio_decoder_t));
this->audio_decoder.decode_data = ff_audio_decode_data;
this->audio_decoder.reset = ff_audio_reset;
@@ -486,7 +486,7 @@ void *init_audio_plugin (xine_t *xine, void *data) {
ff_audio_class_t *this ;
- this = (ff_audio_class_t *) xine_xmalloc (sizeof (ff_audio_class_t));
+ this = calloc(1, sizeof (ff_audio_class_t));
this->decoder_class.open_plugin = ff_audio_open_plugin;
this->decoder_class.get_identifier = ff_audio_get_identifier;
diff --git a/src/combined/ffmpeg/ff_dvaudio_decoder.c b/src/combined/ffmpeg/ff_dvaudio_decoder.c
index 4704c1a2a..6a102f627 100644
--- a/src/combined/ffmpeg/ff_dvaudio_decoder.c
+++ b/src/combined/ffmpeg/ff_dvaudio_decoder.c
@@ -251,10 +251,10 @@ static void dvaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
return;
if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
- this->buf = xine_xmalloc(AUDIOBUFSIZE);
+ this->buf = calloc(1, AUDIOBUFSIZE);
this->bufsize = AUDIOBUFSIZE;
this->size = 0;
- this->decode_buffer = xine_xmalloc(MAXFRAMESIZE);
+ this->decode_buffer = calloc(1, MAXFRAMESIZE);
this->audio_sample_rate = buf->decoder_info[1];
this->audio_bits = buf->decoder_info[2];
@@ -368,7 +368,7 @@ static audio_decoder_t *dvaudio_open_plugin (audio_decoder_class_t *class_gen, x
dvaudio_decoder_t *this ;
- this = (dvaudio_decoder_t *) xine_xmalloc (sizeof (dvaudio_decoder_t));
+ this = calloc(1, sizeof (dvaudio_decoder_t));
this->audio_decoder.decode_data = dvaudio_decode_data;
this->audio_decoder.reset = dvaudio_reset;
@@ -401,7 +401,7 @@ static void *init_dvaudio_plugin (xine_t *xine, void *data) {
dvaudio_class_t *this ;
- this = (dvaudio_class_t *) xine_xmalloc (sizeof (dvaudio_class_t));
+ this = calloc(1, sizeof (dvaudio_class_t));
this->decoder_class.open_plugin = dvaudio_open_plugin;
this->decoder_class.get_identifier = dvaudio_get_identifier;
diff --git a/src/combined/ffmpeg/ff_mpeg_parser.c b/src/combined/ffmpeg/ff_mpeg_parser.c
index 70901d93b..3c2c2cf48 100644
--- a/src/combined/ffmpeg/ff_mpeg_parser.c
+++ b/src/combined/ffmpeg/ff_mpeg_parser.c
@@ -50,7 +50,7 @@ static const int frame_rate_tab[][2] = {
void mpeg_parser_init (mpeg_parser_t *parser)
{
- parser->chunk_buffer = xine_xmalloc(BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ parser->chunk_buffer = malloc(BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
mpeg_parser_reset(parser);
}
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 485e84afb..3ea08417e 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -895,7 +895,7 @@ static void ff_handle_preview_buffer (ff_video_decoder_t *this, buf_element_t *b
if (codec_type == BUF_VIDEO_MPEG) {
this->is_mpeg12 = 1;
if ( this->mpeg_parser == NULL ) {
- this->mpeg_parser = xine_xmalloc(sizeof(mpeg_parser_t));
+ this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t));
mpeg_parser_init(this->mpeg_parser);
this->decoder_init_mode = 0;
}
@@ -950,7 +950,7 @@ static void ff_handle_header_buffer (ff_video_decoder_t *this, buf_element_t *bu
this->context->sub_id = _X_BE_32(&this->buf[30]);
- this->context->slice_offset = xine_xmalloc(sizeof(int)*SLICE_OFFSET_SIZE);
+ this->context->slice_offset = calloc(SLICE_OFFSET_SIZE, sizeof(int));
this->slice_offset_size = SLICE_OFFSET_SIZE;
this->context->extradata_size = this->size - 26;
@@ -998,8 +998,8 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b
lprintf("BUF_SPECIAL_STSD_ATOM\n");
this->context->extradata_size = buf->decoder_info[2];
- this->context->extradata = xine_xmalloc(buf->decoder_info[2] +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ this->context->extradata = malloc(buf->decoder_info[2] +
+ FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(this->context->extradata, buf->decoder_info_ptr[2],
buf->decoder_info[2]);
@@ -1008,8 +1008,8 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b
lprintf("BUF_SPECIAL_DECODER_CONFIG\n");
this->context->extradata_size = buf->decoder_info[2];
- this->context->extradata = xine_xmalloc(buf->decoder_info[2] +
- FF_INPUT_BUFFER_PADDING_SIZE);
+ this->context->extradata = malloc(buf->decoder_info[2] +
+ FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(this->context->extradata, buf->decoder_info_ptr[2],
buf->decoder_info[2]);
@@ -1557,7 +1557,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen,
lprintf ("open_plugin\n");
- this = (ff_video_decoder_t *) xine_xmalloc (sizeof (ff_video_decoder_t));
+ this = calloc(1, sizeof (ff_video_decoder_t));
this->video_decoder.decode_data = ff_decode_data;
this->video_decoder.flush = ff_flush;
@@ -1576,7 +1576,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen,
this->decoder_ok = 0;
this->decoder_init_mode = 1;
- this->buf = xine_xmalloc(VIDEOBUFSIZE + FF_INPUT_BUFFER_PADDING_SIZE);
+ this->buf = calloc(1, VIDEOBUFSIZE + FF_INPUT_BUFFER_PADDING_SIZE);
this->bufsize = VIDEOBUFSIZE;
this->is_mpeg12 = 0;
@@ -1614,7 +1614,7 @@ void *init_video_plugin (xine_t *xine, void *data) {
ff_video_class_t *this;
config_values_t *config;
- this = (ff_video_class_t *) xine_xmalloc (sizeof (ff_video_class_t));
+ this = calloc(1, sizeof (ff_video_class_t));
this->decoder_class.open_plugin = ff_video_open_plugin;
this->decoder_class.get_identifier = ff_video_get_identifier;
diff --git a/src/combined/ffmpeg/ffmpeg_encoder.c b/src/combined/ffmpeg/ffmpeg_encoder.c
index 2d1be10a3..84243a56f 100644
--- a/src/combined/ffmpeg/ffmpeg_encoder.c
+++ b/src/combined/ffmpeg/ffmpeg_encoder.c
@@ -78,7 +78,7 @@ int dxr3_encoder_init(dxr3_driver_t *drv)
avcodec_register_all();
lprintf("lavc init , version %x\n", avcodec_version());
- this = xine_xmalloc(sizeof(lavc_data_t));
+ this = calloc(1, sizeof(lavc_data_t));
if (!this) return 0;
this->encoder_data.type = ENC_LAVC;
diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c
index f95c68e41..5db25d07f 100644
--- a/src/demuxers/asfheader.c
+++ b/src/demuxers/asfheader.c
@@ -581,10 +581,9 @@ static int asf_header_parse_content_description(asf_header_t *header_pub, uint8_
if (buffer_len < 10)
return 0;
- content = malloc(sizeof(asf_content_t));
+ content = calloc(1, sizeof(asf_content_t));
if (!content)
return 0;
- memset(content, 0, sizeof(asf_content_t));
asf_reader_init(&reader, buffer, buffer_len);
asf_reader_get_16(&reader, &title_length);
@@ -617,10 +616,9 @@ asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) {
uint32_t object_count;
uint16_t junk;
- asf_header = malloc(sizeof(asf_header_internal_t));
+ asf_header = calloc(1, sizeof(asf_header_internal_t));
if (!asf_header)
return NULL;
- memset(asf_header, 0, sizeof(asf_header_internal_t));
lprintf("parsing_asf_header\n");
if (buffer_len < 6) {
@@ -703,10 +701,9 @@ asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) {
}
if (!asf_header->pub.content) {
lprintf("no content object present\n");
- asf_header->pub.content = malloc(sizeof(asf_content_t));
+ asf_header->pub.content = calloc(1, sizeof(asf_content_t));
if (!asf_header->pub.content)
goto exit_error;
- memset(asf_header->pub.content, 0, sizeof(asf_content_t));
}
return &asf_header->pub;
diff --git a/src/demuxers/asfheader.h b/src/demuxers/asfheader.h
index 4bd13ab3f..b895a1817 100644
--- a/src/demuxers/asfheader.h
+++ b/src/demuxers/asfheader.h
@@ -389,7 +389,7 @@ struct asf_stream_extension_s {
int asf_find_object_id (GUID *g);
void asf_get_guid (uint8_t *buffer, GUID *value);
-asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len);
+asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) XINE_MALLOC;
void asf_header_choose_streams (asf_header_t *header, uint32_t bandwidth,
int *video_id, int *audio_id);
void asf_header_disable_streams (asf_header_t *header,
diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c
index b06651456..c264e4421 100644
--- a/src/demuxers/demux_4xm.c
+++ b/src/demuxers/demux_4xm.c
@@ -158,7 +158,7 @@ static int open_fourxm_file(demux_fourxm_t *fourxm) {
/* read the whole header */
header_size = _X_LE_32(&preview[4]) - 4;
- header = xine_xmalloc(header_size);
+ header = malloc(header_size);
if (!header || fourxm->input->read(fourxm->input, header, header_size) != header_size) {
free(header);
return 0;
@@ -472,7 +472,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_fourxm_t *this;
- this = xine_xmalloc (sizeof (demux_fourxm_t));
+ this = calloc(1, sizeof(demux_fourxm_t));
this->stream = stream;
this->input = input;
@@ -546,7 +546,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_fourxm_init_plugin (xine_t *xine, void *data) {
demux_fourxm_class_t *this;
- this = xine_xmalloc (sizeof (demux_fourxm_class_t));
+ this = calloc(1, sizeof(demux_fourxm_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c
index d80413f83..63c787bc7 100644
--- a/src/demuxers/demux_aac.c
+++ b/src/demuxers/demux_aac.c
@@ -262,7 +262,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_aac_t *this;
- this = xine_xmalloc (sizeof (demux_aac_t));
+ this = calloc(1, sizeof(demux_aac_t));
this->stream = stream;
this->input = input;
@@ -333,7 +333,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_aac_init_plugin (xine_t *xine, void *data) {
demux_aac_class_t *this;
- this = xine_xmalloc (sizeof (demux_aac_class_t));
+ this = calloc(1, sizeof(demux_aac_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c
index c0fae275b..85852b33a 100644
--- a/src/demuxers/demux_ac3.c
+++ b/src/demuxers/demux_ac3.c
@@ -417,7 +417,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_ac3_t *this;
- this = xine_xmalloc (sizeof (demux_ac3_t));
+ this = calloc(1, sizeof(demux_ac3_t));
this->stream = stream;
this->input = input;
@@ -491,7 +491,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_ac3_init_plugin (xine_t *xine, void *data) {
demux_ac3_class_t *this;
- this = xine_xmalloc (sizeof (demux_ac3_class_t));
+ this = calloc(1, sizeof(demux_ac3_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c
index 8a2811ac6..6f8953a90 100644
--- a/src/demuxers/demux_aiff.c
+++ b/src/demuxers/demux_aiff.c
@@ -85,7 +85,7 @@ typedef struct {
} demux_aiff_class_t;
/* converts IEEE 80bit extended into int, based on FFMPEG code */
-int extended_to_int(const unsigned char p[10])
+static int extended_to_int(const unsigned char p[10])
{
uint64_t m = 0;
int e, i;
@@ -369,7 +369,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_aiff_t *this;
- this = xine_xmalloc (sizeof (demux_aiff_t));
+ this = calloc(1, sizeof(demux_aiff_t));
this->stream = stream;
this->input = input;
@@ -445,7 +445,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_aiff_init_plugin (xine_t *xine, void *data) {
demux_aiff_class_t *this;
- this = xine_xmalloc (sizeof (demux_aiff_class_t));
+ this = calloc(1, sizeof(demux_aiff_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index 4eb9398be..2b8114a0d 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -2073,7 +2073,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
return NULL;
}
- this = xine_xmalloc (sizeof (demux_asf_t));
+ this = calloc(1, sizeof(demux_asf_t));
this->stream = stream;
this->input = input;
@@ -2148,7 +2148,7 @@ static void *init_class (xine_t *xine, void *data) {
demux_asf_class_t *this;
- this = xine_xmalloc (sizeof (demux_asf_class_t));
+ this = calloc(1, sizeof(demux_asf_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c
index a6f88ff48..b99c67806 100644
--- a/src/demuxers/demux_aud.c
+++ b/src/demuxers/demux_aud.c
@@ -270,7 +270,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_aud_t *this;
- this = xine_xmalloc (sizeof (demux_aud_t));
+ this = calloc(1, sizeof(demux_aud_t));
this->stream = stream;
this->input = input;
@@ -343,7 +343,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_aud_init_plugin (xine_t *xine, void *data) {
demux_aud_class_t *this;
- this = xine_xmalloc (sizeof (demux_aud_class_t));
+ this = calloc(1, sizeof(demux_aud_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 656e4662a..16b897711 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -719,7 +719,7 @@ static void reset_idx(demux_avi_t *this, avi_t *AVI) {
}
}
-static avi_t *AVI_init(demux_avi_t *this) {
+static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) {
avi_t *AVI;
int i, j, idx_type;
@@ -739,7 +739,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
/* Create avi_t structure */
lprintf("start\n");
- AVI = (avi_t *) xine_xmalloc(sizeof(avi_t));
+ AVI = (avi_t *) calloc(1, sizeof(avi_t));
if(AVI==NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
@@ -790,7 +790,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
if(strncasecmp(data,"hdrl",4) == 0) {
hdrl_len = n;
- hdrl_data = (unsigned char *) xine_xmalloc(n);
+ hdrl_data = (unsigned char *) malloc(n);
if(hdrl_data==0)
ERR_EXIT(AVI_ERR_NO_MEM);
if (this->input->read(this->input, hdrl_data,n) != n )
@@ -812,9 +812,8 @@ static avi_t *AVI_init(demux_avi_t *this) {
break if this is not the case */
AVI->n_idx = AVI->max_idx = n / 16;
- if (AVI->idx)
- free(AVI->idx); /* On the off chance there are multiple index chunks */
- AVI->idx = (unsigned char((*)[16])) xine_xmalloc(n);
+ free(AVI->idx); /* On the off chance there are multiple index chunks */
+ AVI->idx = (unsigned char((*)[16])) malloc(n);
if (AVI->idx == 0)
ERR_EXIT(AVI_ERR_NO_MEM);
@@ -877,12 +876,11 @@ static avi_t *AVI_init(demux_avi_t *this) {
} else if (strncasecmp (hdrl_data+i,"auds",4) ==0 /* && ! auds_strh_seen*/) {
if(AVI->n_audio < MAX_AUDIO_STREAMS) {
- avi_audio_t *a = (avi_audio_t *) xine_xmalloc(sizeof(avi_audio_t));
+ avi_audio_t *a = (avi_audio_t *) calloc(1, sizeof(avi_audio_t));
if(a==NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
}
- memset((void *)a,0,sizeof(avi_audio_t));
AVI->audio[AVI->n_audio] = a;
a->audio_strn = num_stream;
@@ -922,7 +920,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
if(lasttag == 1) {
/* lprintf ("size : %d\n",sizeof(AVI->bih)); */
AVI->bih = (xine_bmiheader *)
- xine_xmalloc((n < sizeof(xine_bmiheader)) ? sizeof(xine_bmiheader) : n);
+ malloc((n < sizeof(xine_bmiheader)) ? sizeof(xine_bmiheader) : n);
if(AVI->bih == NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
@@ -2281,7 +2279,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_avi_t));
+ this = calloc(1, sizeof(demux_avi_t));
this->stream = stream;
this->input = input;
@@ -2347,7 +2345,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_class (xine_t *xine, void *data) {
demux_avi_class_t *this;
- this = xine_xmalloc (sizeof (demux_avi_class_t));
+ this = calloc(1, sizeof(demux_avi_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c
index 0f34a7cec..8e9ad3679 100644
--- a/src/demuxers/demux_cdda.c
+++ b/src/demuxers/demux_cdda.c
@@ -187,7 +187,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_cdda_t *this;
- this = xine_xmalloc (sizeof (demux_cdda_t));
+ this = calloc(1, sizeof(demux_cdda_t));
this->stream = stream;
this->input = input;
@@ -250,7 +250,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_cdda_init_plugin (xine_t *xine, void *data) {
demux_cdda_class_t *this;
- this = xine_xmalloc (sizeof (demux_cdda_class_t));
+ this = calloc(1, sizeof(demux_cdda_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c
index c99a0688a..1b276c600 100644
--- a/src/demuxers/demux_dts.c
+++ b/src/demuxers/demux_dts.c
@@ -392,7 +392,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_dts_t *this;
- this = xine_xmalloc (sizeof (demux_dts_t));
+ this = calloc(1, sizeof(demux_dts_t));
this->stream = stream;
this->input = input;
@@ -464,7 +464,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_dts_init_plugin (xine_t *xine, void *data) {
demux_dts_class_t *this;
- this = xine_xmalloc (sizeof (demux_dts_class_t));
+ this = calloc(1, sizeof(demux_dts_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c
index 2359d3baf..58ce4520f 100644
--- a/src/demuxers/demux_eawve.c
+++ b/src/demuxers/demux_eawve.c
@@ -349,7 +349,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
if (!INPUT_IS_SEEKABLE(input))
return NULL;
- this = xine_xmalloc(sizeof(demux_eawve_t));
+ this = calloc(1, sizeof(demux_eawve_t));
this->stream = stream;
this->input = input;
@@ -421,7 +421,7 @@ static void class_dispose(demux_class_t *this){
void *demux_eawve_init_plugin(xine_t *xine, void *data) {
demux_eawve_class_t *this;
- this = xine_xmalloc(sizeof(demux_eawve_class_t));
+ this = calloc(1, sizeof(demux_eawve_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c
index d0a821504..a66befe01 100644
--- a/src/demuxers/demux_elem.c
+++ b/src/demuxers/demux_elem.c
@@ -240,7 +240,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_mpeg_elem_t));
+ this = calloc(1, sizeof(demux_mpeg_elem_t));
this->stream = stream;
this->input = input;
@@ -284,7 +284,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_elem_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_elem_class_t));
+ this = calloc(1, sizeof(demux_mpeg_elem_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index 60365ab4d..27986d9e1 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -151,7 +151,7 @@ static int open_film_file(demux_film_t *film) {
/* header size = header size - 16-byte FILM signature */
film_header_size = _X_BE_32(&scratch[4]) - 16;
- film_header = xine_xmalloc(film_header_size);
+ film_header = malloc(film_header_size);
if (!film_header)
return 0;
strncpy(film->version, &scratch[8], 4);
@@ -331,10 +331,8 @@ static int open_film_file(demux_film_t *film) {
/* allocate enough space in the interleave preload buffer for the
* first chunk (which will be more than enough for successive chunks) */
if (film->audio_type) {
- if (film->interleave_buffer)
- free(film->interleave_buffer);
- film->interleave_buffer =
- xine_xmalloc(film->sample_table[0].sample_size);
+ free(film->interleave_buffer);
+ film->interleave_buffer = calloc(1, film->sample_table[0].sample_size);
if (!film->interleave_buffer)
goto film_abort;
}
@@ -858,7 +856,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_film_t *this;
- this = xine_xmalloc (sizeof (demux_film_t));
+ this = calloc(1, sizeof(demux_film_t));
this->stream = stream;
this->input = input;
@@ -932,7 +930,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_film_init_plugin (xine_t *xine, void *data) {
demux_film_class_t *this;
- this = xine_xmalloc (sizeof (demux_film_class_t));
+ this = calloc(1, sizeof(demux_film_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c
index b4c5edb2d..e6d6f6376 100644
--- a/src/demuxers/demux_flac.c
+++ b/src/demuxers/demux_flac.c
@@ -491,7 +491,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_flac_t));
+ this = calloc(1, sizeof(demux_flac_t));
this->stream = stream;
this->input = input;
@@ -566,7 +566,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_flac_init_plugin (xine_t *xine, void *data) {
demux_flac_class_t *this;
- this = xine_xmalloc (sizeof (demux_flac_class_t));
+ this = calloc(1, sizeof(demux_flac_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c
index 99843a68c..fabc2c788 100644
--- a/src/demuxers/demux_fli.c
+++ b/src/demuxers/demux_fli.c
@@ -303,7 +303,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_fli_t *this;
- this = xine_xmalloc (sizeof (demux_fli_t));
+ this = calloc(1, sizeof(demux_fli_t));
this->stream = stream;
this->input = input;
@@ -377,7 +377,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_fli_class_t *this;
- this = xine_xmalloc (sizeof (demux_fli_class_t));
+ this = calloc(1, sizeof(demux_fli_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c
index 0d18783c2..d319ece74 100644
--- a/src/demuxers/demux_flv.c
+++ b/src/demuxers/demux_flv.c
@@ -365,7 +365,7 @@ static int parse_flv_var(demux_flv_t *this,
}
static void parse_flv_script(demux_flv_t *this, int size) {
- unsigned char *buf = xine_xmalloc(size);
+ unsigned char *buf = malloc(size);
unsigned char *tmp = buf;
unsigned char *end = buf + size;
int len;
@@ -856,7 +856,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input_plugin_t *input) {
demux_flv_t *this;
- this = xine_xmalloc(sizeof (demux_flv_t));
+ this = calloc(1, sizeof(demux_flv_t));
this->xine = stream->xine;
this->stream = stream;
this->input = input;
@@ -924,7 +924,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_flv_class_t *this;
- this = xine_xmalloc (sizeof (demux_flv_class_t));
+ this = calloc(1, sizeof(demux_flv_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c
index 99754c797..d44f03ab3 100644
--- a/src/demuxers/demux_idcin.c
+++ b/src/demuxers/demux_idcin.c
@@ -472,7 +472,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_idcin_t *this;
- this = xine_xmalloc (sizeof (demux_idcin_t));
+ this = calloc(1, sizeof(demux_idcin_t));
this->stream = stream;
this->input = input;
@@ -547,7 +547,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_idcin_init_plugin (xine_t *xine, void *data) {
demux_idcin_class_t *this;
- this = xine_xmalloc (sizeof (demux_idcin_class_t));
+ this = calloc(1, sizeof(demux_idcin_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c
index 0856eec1a..1785e86d7 100644
--- a/src/demuxers/demux_iff.c
+++ b/src/demuxers/demux_iff.c
@@ -212,7 +212,7 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_VHDR_CHUNK:
if( this->vhdr == NULL )
- this->vhdr = (Voice8Header *)xine_xmalloc(sizeof(Voice8Header));
+ this->vhdr = (Voice8Header *)calloc(1, sizeof(Voice8Header));
this->vhdr->oneShotHiSamples = _X_BE_32(&buffer[0]);
this->vhdr->repeatHiSamples = _X_BE_32(&buffer[4]);
this->vhdr->samplesPerHiCycle = _X_BE_32(&buffer[8]);
@@ -330,7 +330,7 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_BMHD_CHUNK:
if( this->bmhd == NULL )
- this->bmhd = (BitMapHeader *)xine_xmalloc(sizeof(BitMapHeader));
+ this->bmhd = (BitMapHeader *)calloc(1, sizeof(BitMapHeader));
this->bmhd->w = _X_BE_16(&buffer[0]);
this->bmhd->h = _X_BE_16(&buffer[2]);
this->bmhd->x = _X_BE_16(&buffer[4]);
@@ -399,20 +399,20 @@ static int read_iff_chunk(demux_iff_t *this) {
case IFF_CMAP_CHUNK:
/* every color contains red, green and blue componente using 8Bit */
this->cmap_num = junk_size / PIC_SIZE_OF_COLOR_REGISTER;
- this->cmap = (ColorRegister *)xine_xmalloc(junk_size);
+ this->cmap = (ColorRegister *)malloc(junk_size);
this->video_send_palette = 1;
if (!this->cmap || this->input->read(this->input, (char *)this->cmap, junk_size) != junk_size)
return 0;
break;
case IFF_GRAB_CHUNK:
if( this->grab == NULL )
- this->grab = (Point2D *)xine_xmalloc(sizeof(Point2D));
+ this->grab = (Point2D *)calloc(1, sizeof(Point2D));
this->grab->x = _X_BE_16(&buffer[0]);
this->grab->y = _X_BE_16(&buffer[2]);
break;
case IFF_DEST_CHUNK:
if( this->dest == NULL )
- this->dest = (DestMerge *)xine_xmalloc(sizeof(DestMerge));
+ this->dest = (DestMerge *)calloc(1, sizeof(DestMerge));
this->dest->depth = buffer[0];
this->dest->pad1 = buffer[1];
this->dest->plane_pick = _X_BE_16(&buffer[2]);
@@ -424,7 +424,7 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_CAMG_CHUNK:
if( this->camg == NULL )
- this->camg = (CamgChunk *)xine_xmalloc(sizeof(CamgChunk));
+ this->camg = (CamgChunk *)calloc(1, sizeof(CamgChunk));
this->camg->view_modes = _X_BE_32(&buffer[0]);
this->bih.biCompression = this->camg->view_modes;
if( this->camg->view_modes & CAMG_PAL &&
@@ -443,7 +443,7 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_CCRT_CHUNK:
if( this->ccrt == NULL )
- this->ccrt = (CcrtChunk *)xine_xmalloc(sizeof(CcrtChunk));
+ this->ccrt = (CcrtChunk *)calloc(1, sizeof(CcrtChunk));
this->ccrt->direction = _X_BE_16(&buffer[0]);
this->ccrt->start = buffer[2];
this->ccrt->end = buffer[3];
@@ -453,13 +453,13 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_DPI_CHUNK:
if( this->dpi == NULL )
- this->dpi = (DPIHeader *)xine_xmalloc(sizeof(DPIHeader));
+ this->dpi = (DPIHeader *)calloc(1, sizeof(DPIHeader));
this->dpi->x = _X_BE_16(&buffer[0]);
this->dpi->y = _X_BE_16(&buffer[0]);
break;
case IFF_ANHD_CHUNK:
if( this->anhd == NULL )
- this->anhd = (AnimHeader *)xine_xmalloc(sizeof(AnimHeader));
+ this->anhd = (AnimHeader *)calloc(1, sizeof(AnimHeader));
this->anhd->operation = buffer[0];
this->anhd->mask = buffer[1];
this->anhd->w = _X_BE_16(&buffer[2]);
@@ -500,7 +500,7 @@ static int read_iff_chunk(demux_iff_t *this) {
break;
case IFF_DPAN_CHUNK:
if( this->dpan == NULL )
- this->dpan = (DPAnimChunk *)xine_xmalloc(sizeof(DPAnimChunk));
+ this->dpan = (DPAnimChunk *)calloc(1, sizeof(DPAnimChunk));
this->dpan->version = _X_BE_16(&buffer[0]);
this->dpan->nframes = _X_BE_16(&buffer[2]);
this->dpan->fps = buffer[4];
@@ -711,14 +711,14 @@ static int demux_iff_send_chunk(demux_plugin_t *this_gen) {
if (this->audio_interleave_buffer_size > 0)
{
this->audio_interleave_buffer =
- xine_xmalloc(this->audio_interleave_buffer_size);
+ calloc(1, this->audio_interleave_buffer_size);
if (!this->audio_interleave_buffer)
return this->status = DEMUX_FINISHED;
}
if (this->audio_read_buffer_size > 0)
{
this->audio_read_buffer =
- xine_xmalloc(this->audio_read_buffer_size);
+ calloc(1, this->audio_read_buffer_size);
if (!this->audio_read_buffer)
return this->status = DEMUX_FINISHED;
}
@@ -1242,7 +1242,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_iff_t *this;
- this = xine_xmalloc (sizeof (demux_iff_t));
+ this = calloc(1, sizeof(demux_iff_t));
this->stream = stream;
this->input = input;
@@ -1323,7 +1323,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_iff_class_t *this;
- this = xine_xmalloc (sizeof (demux_iff_class_t));
+ this = calloc(1, sizeof(demux_iff_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c
index 9f53e4173..feaf3ceaa 100644
--- a/src/demuxers/demux_image.c
+++ b/src/demuxers/demux_image.c
@@ -198,7 +198,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc (sizeof (demux_image_t));
+ this = calloc(1, sizeof(demux_image_t));
this->stream = stream;
this->input = input;
@@ -249,7 +249,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_class (xine_t *xine, void *data) {
demux_image_class_t *this;
- this = xine_xmalloc (sizeof (demux_image_class_t));
+ this = calloc(1, sizeof(demux_image_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c
index 12640e662..4ef877988 100644
--- a/src/demuxers/demux_ipmovie.c
+++ b/src/demuxers/demux_ipmovie.c
@@ -672,7 +672,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_ipmovie_t *this;
- this = xine_xmalloc (sizeof (demux_ipmovie_t));
+ this = calloc(1, sizeof(demux_ipmovie_t));
this->stream = stream;
this->input = input;
@@ -747,7 +747,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_ipmovie_init_plugin (xine_t *xine, void *data) {
demux_ipmovie_class_t *this;
- this = xine_xmalloc (sizeof (demux_ipmovie_class_t));
+ this = calloc(1, sizeof(demux_ipmovie_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index 942a6613e..5faebf61d 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -58,13 +58,6 @@
#define WRAP_THRESHOLD 90000
-#if !defined(MIN)
-#define MIN(a, b) ((a)<(b)?(a):(b))
-#endif
-#if !defined(MAX)
-#define MAX(a, b) ((a)>(b)?(a):(b))
-#endif
-
typedef struct {
int track_num;
off_t *pos;
@@ -1210,7 +1203,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
lprintf("Video\n");
if (track->video_track)
return 1;
- track->video_track = (matroska_video_track_t *)xine_xmalloc(sizeof(matroska_video_track_t));
+ track->video_track = (matroska_video_track_t *)calloc(1, sizeof(matroska_video_track_t));
if (!ebml_read_master (ebml, &elem))
return 0;
if ((elem.len > 0) && !parse_video_track(this, track->video_track))
@@ -1221,7 +1214,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
lprintf("Audio\n");
if (track->audio_track)
return 1;
- track->audio_track = (matroska_audio_track_t *)xine_xmalloc(sizeof(matroska_audio_track_t));
+ track->audio_track = (matroska_audio_track_t *)calloc(1, sizeof(matroska_audio_track_t));
if (!ebml_read_master (ebml, &elem))
return 0;
if ((elem.len > 0) && !parse_audio_track(this, track->audio_track))
@@ -1511,7 +1504,7 @@ static int parse_tracks(demux_matroska_t *this) {
matroska_track_t *track;
/* alloc and initialize a track with 0 */
- track = xine_xmalloc(sizeof(matroska_track_t));
+ track = calloc(1, sizeof(matroska_track_t));
track->compress_algo = MATROSKA_COMPRESS_NONE;
this->tracks[this->num_tracks] = track;
@@ -2853,7 +2846,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_matroska_t));
+ this = calloc(1, sizeof(demux_matroska_t));
this->demux_plugin.send_headers = demux_matroska_send_headers;
this->demux_plugin.send_chunk = demux_matroska_send_chunk;
@@ -2929,7 +2922,7 @@ static void *init_class (xine_t *xine, void *data) {
demux_matroska_class_t *this;
- this = xine_xmalloc (sizeof (demux_matroska_class_t));
+ this = calloc(1, sizeof(demux_matroska_class_t));
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c
index 12da8ca86..a32374048 100644
--- a/src/demuxers/demux_mng.c
+++ b/src/demuxers/demux_mng.c
@@ -260,7 +260,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
demux_mng_t *this;
- this = xine_xmalloc (sizeof (demux_mng_t));
+ this = calloc(1, sizeof(demux_mng_t));
this->stream = stream;
this->input = input;
@@ -360,7 +360,7 @@ static void class_dispose(demux_class_t *this){
static void *init_plugin(xine_t *xine, void *data){
demux_mng_class_t *this;
- this = xine_xmalloc (sizeof (demux_mng_class_t));
+ this = calloc(1, sizeof(demux_mng_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index e7c6f86b3..2c0f44afa 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -305,7 +305,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_mod_t));
+ this = calloc(1, sizeof(demux_mod_t));
this->stream = stream;
this->input = input;
@@ -380,7 +380,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_mod_init_plugin (xine_t *xine, void *data) {
demux_mod_class_t *this;
- this = xine_xmalloc (sizeof (demux_mod_class_t));
+ this = calloc(1, sizeof(demux_mod_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_mpc.c b/src/demuxers/demux_mpc.c
index a3791811e..e00a50ea3 100644
--- a/src/demuxers/demux_mpc.c
+++ b/src/demuxers/demux_mpc.c
@@ -324,7 +324,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_mpc_t *this;
- this = xine_xmalloc (sizeof (demux_mpc_t));
+ this = calloc(1, sizeof(demux_mpc_t));
this->stream = stream;
this->input = input;
@@ -398,7 +398,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_mpc_init_plugin (xine_t *xine, void *data) {
demux_mpc_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpc_class_t));
+ this = calloc(1, sizeof(demux_mpc_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index 4419f8404..388be2140 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -1067,7 +1067,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input_plugin_t *input) {
demux_mpeg_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_t));
+ this = calloc(1, sizeof(demux_mpeg_t));
this->stream = stream;
this->input = input;
@@ -1246,7 +1246,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_class_t));
+ this = calloc(1, sizeof(demux_mpeg_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 32638129d..3ecb88d04 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.c
@@ -1371,7 +1371,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input_plugin_t *input = (input_plugin_t *) input_gen;
demux_mpeg_block_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_block_t));
+ this = calloc(1, sizeof(demux_mpeg_block_t));
this->stream = stream;
this->input = input;
@@ -1540,7 +1540,7 @@ static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_block_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_block_class_t));
+ this = calloc(1, sizeof(demux_mpeg_block_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index 423da5e24..32dd2cb51 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_pes.c
@@ -274,7 +274,7 @@ static void demux_mpeg_pes_parse_pack (demux_mpeg_pes_t *this, int preview_mode)
while ((p[2] != 1) || p[0] || p[1]) {
/* resync code */
- for(n=0;n<5;n++) p[n]=p[n+1];
+ memmove(p, p+1, 5);
i = read_data(this, p+5, (off_t) 1);
if (i != 1) {
this->status = DEMUX_FINISHED;
@@ -306,8 +306,7 @@ static void demux_mpeg_pes_parse_pack (demux_mpeg_pes_t *this, int preview_mode)
p = buf->mem;
/* copy local buffer to fifo element. */
- for (n = 0; n < sizeof (buf6); n++)
- p[ n ] = buf6[ n ];
+ memcpy(p, buf6, sizeof(buf6));
if (preview_mode)
buf->decoder_flags = BUF_FLAG_PREVIEW;
@@ -1613,7 +1612,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
input_plugin_t *input = (input_plugin_t *) input_gen;
demux_mpeg_pes_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_pes_t));
+ this = calloc(1, sizeof(demux_mpeg_pes_t));
this->stream = stream;
this->input = input;
@@ -1786,7 +1785,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_pes_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpeg_pes_class_t));
+ this = calloc(1, sizeof(demux_mpeg_pes_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index c7af1c508..3c3576fd2 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.c
@@ -316,8 +316,8 @@ static int parse_frame_header(mpg_audio_frame_t *const frame, const uint8_t *con
* Parse a Xing header
* return the Xing header or NULL on error
*/
-static xing_header_t* parse_xing_header(mpg_audio_frame_t *frame,
- uint8_t *buf, int bufsize) {
+static xing_header_t *XINE_MALLOC parse_xing_header(mpg_audio_frame_t *frame,
+ uint8_t *buf, int bufsize) {
uint8_t *ptr = buf;
xing_header_t *xing = NULL;
@@ -341,7 +341,7 @@ static xing_header_t* parse_xing_header(mpg_audio_frame_t *frame,
int has_frames_flag = 0;
int has_bytes_flag = 0;
- xing = xine_xmalloc (sizeof (xing_header_t));
+ xing = calloc(1, sizeof(xing_header_t));
if (!xing)
goto exit_error;
@@ -420,14 +420,14 @@ exit_error:
* Parse a Vbri header
* return the Vbri header or NULL on error
*/
-static vbri_header_t* parse_vbri_header(mpg_audio_frame_t *frame,
- uint8_t *buf, int bufsize) {
+static vbri_header_t *XINE_MALLOC parse_vbri_header(mpg_audio_frame_t *frame,
+ uint8_t *buf, int bufsize) {
int i;
uint8_t *ptr = buf;
vbri_header_t *vbri;
- vbri = xine_xmalloc (sizeof (vbri_header_t));
+ vbri = calloc(1, sizeof(vbri_header_t));
if (!vbri)
return NULL;
@@ -1148,7 +1148,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_mpgaudio_t));
+ this = calloc(1, sizeof(demux_mpgaudio_t));
this->demux_plugin.send_headers = demux_mpgaudio_send_headers;
this->demux_plugin.send_chunk = demux_mpgaudio_send_chunk;
@@ -1223,7 +1223,7 @@ void *demux_mpgaudio_init_class (xine_t *xine, void *data) {
demux_mpgaudio_class_t *this;
- this = xine_xmalloc (sizeof (demux_mpgaudio_class_t));
+ this = calloc(1, sizeof(demux_mpgaudio_class_t));
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c
index d81010846..557adf28d 100644
--- a/src/demuxers/demux_nsf.c
+++ b/src/demuxers/demux_nsf.c
@@ -303,7 +303,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_nsf_t));
+ this = calloc(1, sizeof(demux_nsf_t));
this->stream = stream;
this->input = input;
@@ -377,7 +377,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_nsf_init_plugin (xine_t *xine, void *data) {
demux_nsf_class_t *this;
- this = xine_xmalloc (sizeof (demux_nsf_class_t));
+ this = calloc(1, sizeof(demux_nsf_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c
index 44bb18c79..71046b039 100644
--- a/src/demuxers/demux_nsv.c
+++ b/src/demuxers/demux_nsv.c
@@ -594,7 +594,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_nsv_t *this;
- this = xine_xmalloc (sizeof (demux_nsv_t));
+ this = calloc(1, sizeof(demux_nsv_t));
this->stream = stream;
this->input = input;
@@ -668,7 +668,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *demux_nsv_init_plugin (xine_t *xine, void *data) {
demux_nsv_class_t *this;
- this = xine_xmalloc (sizeof (demux_nsv_class_t));
+ this = calloc(1, sizeof(demux_nsv_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
index 33c262793..16e6c40d9 100644
--- a/src/demuxers/demux_ogg.c
+++ b/src/demuxers/demux_ogg.c
@@ -194,7 +194,7 @@ static int get_stream (demux_ogg_t *this, int serno) {
static int new_stream_info (demux_ogg_t *this, const int cur_serno) {
int stream_num;
- this->si[this->num_streams] = (stream_info_t *)xine_xmalloc(sizeof(stream_info_t));
+ this->si[this->num_streams] = (stream_info_t *)calloc(1, sizeof(stream_info_t));
ogg_stream_init(&this->si[this->num_streams]->oss, cur_serno);
stream_num = this->num_streams;
this->si[stream_num]->buf_types = 0;
@@ -304,10 +304,10 @@ static void send_ogg_packet (demux_ogg_t *this,
buf_element_t *buf;
int done=0,todo=op->bytes;
- int op_size = sizeof(ogg_packet);
+ const size_t op_size = sizeof(ogg_packet);
while (done<todo) {
- int offset=0;
+ size_t offset=0;
buf = fifo->buffer_pool_alloc (fifo);
buf->decoder_flags = decoder_flags;
if (done==0) {
@@ -498,7 +498,7 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) {
lprintf("time: %d %d %d %d\n", hour, min,sec,msec);
if (!this->chapter_info) {
- this->chapter_info = (chapter_info_t *)xine_xmalloc(sizeof(chapter_info_t));
+ this->chapter_info = (chapter_info_t *)calloc(1, sizeof(chapter_info_t));
this->chapter_info->current_chapter = -1;
}
this->chapter_info->max_chapter = chapter_no;
@@ -531,34 +531,34 @@ static void update_chapter_display (demux_ogg_t *this, int stream_num, ogg_packe
chapter--;
if (chapter != this->chapter_info->current_chapter){
- xine_event_t uevent;
- xine_ui_data_t data;
- int title_len;
- char *title;
+ xine_ui_data_t data = {
+ .str = { 0, },
+ .str_len = 0
+ };
+ xine_event_t uevent = {
+ .type = XINE_EVENT_UI_SET_TITLE,
+ .stream = this->stream,
+ .data = &data,
+ .data_length = sizeof(data)
+ };
this->chapter_info->current_chapter = chapter;
- if (chapter >= 0) {
- char t_title[256];
+ if (chapter >= 0) {
if (this->title) {
- snprintf(t_title, sizeof (t_title), "%s / %s", this->title, this->chapter_info->entries[chapter].name);
+ data.str_len = snprintf(data.str, sizeof(data.str), "%s / %s", this->title, this->chapter_info->entries[chapter].name);
} else {
- snprintf(t_title, sizeof (t_title), "%s", this->chapter_info->entries[chapter].name);
+ strncpy(data.str, this->chapter_info->entries[chapter].name, sizeof(data.str)-1);
}
- title = t_title;
} else {
- title = this->title;
+ strncpy(data.str, this->title, sizeof(data.str));
}
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, title);
- lprintf("new TITLE: %s\n", title);
-
- uevent.type = XINE_EVENT_UI_SET_TITLE;
- uevent.stream = this->stream;
- uevent.data = &data;
- uevent.data_length = sizeof(data);
- title_len = strlen(title) + 1;
- memcpy(data.str, title, title_len);
- data.str_len = title_len;
+ if ( data.str_len == 0 )
+ data.str_len = strlen(data.str);
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, data.str);
+ lprintf("new TITLE: %s\n", data.str);
+
xine_event_send(this->stream, &uevent);
}
}
@@ -1267,8 +1267,8 @@ static void decode_annodex_header (demux_ogg_t *this, const int stream_num, ogg_
static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
int64_t granule_rate_n, granule_rate_d;
uint32_t secondary_headers;
- char content_type[1024];
- int content_type_length;
+ const char *content_type = "";
+ size_t content_type_length = 0;
lprintf("AnxData stream detected\n");
@@ -1280,11 +1280,16 @@ static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_
lprintf("granule_rate %" PRId64 "/%" PRId64 ", %d secondary headers\n",
granule_rate_n, granule_rate_d, secondary_headers);
- /* read "Content-Tyoe" MIME header */
- sscanf(&op->packet[28], "Content-Type: %1023s\r\n", content_type);
- content_type_length = strlen(content_type);
+ /* read "Content-Type" MIME header */
+ const char *startline = &op->packet[28];
+ const char *endline;
+ if ( strcmp(&op->packet[28], "Content-Type: ") == 0 &&
+ (endline = strstr(startline, "\r\n")) ) {
+ content_type = startline + sizeof("Content-Type: ");
+ content_type_length = startline - endline;
+ }
- lprintf("Content-Type: %s (length:%d)\n", content_type, content_type_length);
+ lprintf("Content-Type: %s (length:%td)\n", content_type, content_type_length);
/* how many header packets in the AnxData stream? */
this->si[stream_num]->headers = secondary_headers + 1;
@@ -2026,8 +2031,7 @@ static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc (sizeof (demux_ogg_t));
- memset (this, 0, sizeof(demux_ogg_t));
+ this = calloc(1, sizeof(demux_ogg_t));
this->stream = stream;
this->input = input;
@@ -2072,8 +2076,7 @@ static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc (sizeof (demux_ogg_t));
- memset (this, 0, sizeof(demux_ogg_t));
+ this = calloc(1, sizeof(demux_ogg_t));
this->stream = stream;
this->input = input;
@@ -2135,7 +2138,7 @@ static void anx_class_dispose (demux_class_t *this_gen) {
static void *anx_init_class (xine_t *xine, void *data) {
demux_anx_class_t *this;
- this = xine_xmalloc (sizeof (demux_anx_class_t));
+ this = calloc(1, sizeof(demux_anx_class_t));
this->demux_class.open_plugin = anx_open_plugin;
this->demux_class.get_description = anx_get_description;
@@ -2184,7 +2187,7 @@ static void ogg_class_dispose (demux_class_t *this_gen) {
static void *ogg_init_class (xine_t *xine, void *data) {
demux_ogg_class_t *this;
- this = xine_xmalloc (sizeof (demux_ogg_class_t));
+ this = calloc(1, sizeof(demux_ogg_class_t));
this->demux_class.open_plugin = ogg_open_plugin;
this->demux_class.get_description = ogg_get_description;
diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c
index 298d936b5..ddd32b63c 100644
--- a/src/demuxers/demux_pva.c
+++ b/src/demuxers/demux_pva.c
@@ -430,7 +430,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_pva_t));
+ this = calloc(1, sizeof(demux_pva_t));
this->stream = stream;
this->input = input;
@@ -503,7 +503,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_pva_class_t *this;
- this = xine_xmalloc (sizeof (demux_pva_class_t));
+ this = calloc(1, sizeof(demux_pva_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index 0988c1dff..1fa9b4327 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -134,7 +134,7 @@ typedef unsigned int qt_atom;
#define MAX_PTS_DIFF 100000
/* network bandwidth, cribbed from src/input/input_mms.c */
-const int64_t bandwidths[]={14400,19200,28800,33600,34430,57600,
+static const int64_t bandwidths[]={14400,19200,28800,33600,34430,57600,
115200,262200,393216,524300,1544000,10485800};
/* these are things that can go wrong */
@@ -581,7 +581,7 @@ static void find_moov_atom(input_plugin_t *input, off_t *moov_offset,
static qt_info *create_qt_info(void) {
qt_info *info;
- info = (qt_info *)xine_xmalloc(sizeof(qt_info));
+ info = (qt_info *)calloc(1, sizeof(qt_info));
if (!info)
return NULL;
@@ -1736,7 +1736,6 @@ static qt_error build_frame_table(qt_trak *trak,
media_id_counts = calloc(trak->stsd_atoms_count, sizeof(int));
if (!media_id_counts)
return QT_NO_MEMORY;
- memset(media_id_counts, 0, trak->stsd_atoms_count * sizeof(int));
/* iterate through each start chunk in the stsc table */
for (i = 0; i < trak->sample_to_chunk_count; i++) {
@@ -2981,7 +2980,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_qt_t));
+ this = calloc(1, sizeof(demux_qt_t));
this->stream = stream;
this->input = input;
@@ -3096,7 +3095,9 @@ static const char *get_mimetypes (demux_class_t *this_gen) {
return "video/quicktime: mov,qt: Quicktime animation;"
"video/x-quicktime: mov,qt: Quicktime animation;"
"audio/x-m4a: m4a,m4b: MPEG-4 audio;"
- "application/x-quicktimeplayer: qtl: Quicktime list;";
+ "application/x-quicktimeplayer: qtl: Quicktime list;"
+ "video/mp4: mp4,mpg4: MPEG-4 video;"
+ "audio/mp4: mp4,mpg4: MPEG-4 audio;";
}
static void class_dispose (demux_class_t *this_gen) {
@@ -3110,7 +3111,7 @@ static void *init_plugin (xine_t *xine, void *data) {
demux_qt_class_t *this;
- this = xine_xmalloc (sizeof (demux_qt_class_t));
+ this = calloc(1, sizeof(demux_qt_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c
index 2d21f080d..848f871c8 100644
--- a/src/demuxers/demux_rawdv.c
+++ b/src/demuxers/demux_rawdv.c
@@ -347,7 +347,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_raw_dv_t *this;
- this = xine_xmalloc (sizeof (demux_raw_dv_t));
+ this = calloc(1, sizeof(demux_raw_dv_t));
this->stream = stream;
this->input = input;
@@ -436,7 +436,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_raw_dv_class_t *this;
- this = xine_xmalloc (sizeof (demux_raw_dv_class_t));
+ this = calloc(1, sizeof(demux_raw_dv_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 6a1d24dba..48bf24969 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -440,7 +440,7 @@ static void real_parse_headers (demux_real_t *this) {
case CONT_TAG:
chunk_size -= PREAMBLE_SIZE;
- chunk_buffer = xine_xmalloc(chunk_size);
+ chunk_buffer = malloc(chunk_size);
if (this->input->read(this->input, chunk_buffer, chunk_size) !=
chunk_size) {
free (chunk_buffer);
@@ -1756,7 +1756,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
- this = xine_xmalloc (sizeof (demux_real_t));
+ this = calloc(1, sizeof(demux_real_t));
this->stream = stream;
this->input = input;
@@ -1814,7 +1814,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_class (xine_t *xine, void *data) {
demux_real_class_t *this;
- this = xine_xmalloc (sizeof (demux_real_class_t));
+ this = calloc(1, sizeof(demux_real_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c
index 87e564b8d..bc132adae 100644
--- a/src/demuxers/demux_realaudio.c
+++ b/src/demuxers/demux_realaudio.c
@@ -110,7 +110,7 @@ static int open_ra_file(demux_ra_t *this) {
}
/* allocate for and read header data */
- this->header = xine_xmalloc(this->header_size);
+ this->header = malloc(this->header_size);
if (!this->header || _x_demux_read_header(this->input, this->header, this->header_size) != this->header_size) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_realaudio: unable to read header\n");
@@ -396,7 +396,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_ra_t *this;
- this = xine_xmalloc (sizeof (demux_ra_t));
+ this = calloc(1, sizeof(demux_ra_t));
this->stream = stream;
this->input = input;
this->frame_buffer = NULL;
@@ -471,7 +471,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_realaudio_init_plugin (xine_t *xine, void *data) {
demux_ra_class_t *this;
- this = xine_xmalloc (sizeof (demux_ra_class_t));
+ this = calloc(1, sizeof(demux_ra_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c
index 18edaea87..ea68609f2 100644
--- a/src/demuxers/demux_roq.c
+++ b/src/demuxers/demux_roq.c
@@ -411,7 +411,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_roq_t));
+ this = calloc(1, sizeof(demux_roq_t));
this->stream = stream;
this->input = input;
@@ -485,7 +485,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_roq_init_plugin (xine_t *xine, void *data) {
demux_roq_class_t *this;
- this = xine_xmalloc (sizeof (demux_roq_class_t));
+ this = calloc(1, sizeof(demux_roq_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_shn.c b/src/demuxers/demux_shn.c
index 87324ab45..4d932305c 100644
--- a/src/demuxers/demux_shn.c
+++ b/src/demuxers/demux_shn.c
@@ -182,7 +182,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_shn_t *this;
- this = xine_xmalloc (sizeof (demux_shn_t));
+ this = calloc(1, sizeof(demux_shn_t));
this->stream = stream;
this->input = input;
@@ -253,7 +253,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_shn_init_plugin (xine_t *xine, void *data) {
demux_shn_class_t *this;
- this = xine_xmalloc (sizeof (demux_shn_class_t));
+ this = calloc(1, sizeof(demux_shn_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c
index 436d37579..28a89a973 100644
--- a/src/demuxers/demux_slave.c
+++ b/src/demuxers/demux_slave.c
@@ -186,10 +186,8 @@ static int demux_slave_next (demux_slave_t *this) {
buf->decoder_flags = decoder_flags;
/* set decoder info */
- for( i = 0; i < BUF_NUM_DEC_INFO; i++ ) {
- buf->decoder_info[i] = this->decoder_info[i];
- buf->decoder_info_ptr[i] = this->decoder_info_ptr[i];
- }
+ memcpy(buf->decoder_info, this->decoder_info, sizeof(this->decoder_info));
+ memcpy(buf->decoder_info_ptr, this->decoder_info_ptr, sizeof(this->decoder_info));
memset(this->decoder_info, 0, sizeof(this->decoder_info));
memset(this->decoder_info_ptr, 0, sizeof(this->decoder_info_ptr));
@@ -331,7 +329,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_slave_t *this;
static char slave_id_str[] = "master xine v1\n";
- this = xine_xmalloc (sizeof (demux_slave_t));
+ this = calloc(1, sizeof(demux_slave_t));
switch (stream->content_detection_method) {
@@ -414,7 +412,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_slave_class_t *this;
- this = xine_xmalloc (sizeof (demux_slave_class_t));
+ this = calloc(1, sizeof(demux_slave_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c
index 899fbf7e3..8857f90fd 100644
--- a/src/demuxers/demux_smjpeg.c
+++ b/src/demuxers/demux_smjpeg.c
@@ -400,7 +400,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_smjpeg_t));
+ this = calloc(1, sizeof(demux_smjpeg_t));
this->stream = stream;
this->input = input;
@@ -474,7 +474,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_smjpeg_init_plugin (xine_t *xine, void *data) {
demux_smjpeg_class_t *this;
- this = xine_xmalloc (sizeof (demux_smjpeg_class_t));
+ this = calloc(1, sizeof(demux_smjpeg_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c
index 0965a75ae..51a4315e5 100644
--- a/src/demuxers/demux_snd.c
+++ b/src/demuxers/demux_snd.c
@@ -318,7 +318,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_snd_t *this;
- this = xine_xmalloc (sizeof (demux_snd_t));
+ this = calloc(1, sizeof(demux_snd_t));
this->stream = stream;
this->input = input;
@@ -395,7 +395,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_snd_init_plugin (xine_t *xine, void *data) {
demux_snd_class_t *this;
- this = xine_xmalloc (sizeof (demux_snd_class_t));
+ this = calloc(1, sizeof(demux_snd_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c
index 2cf542014..1e750f183 100644
--- a/src/demuxers/demux_str.c
+++ b/src/demuxers/demux_str.c
@@ -188,9 +188,7 @@ static int open_str_file(demux_str_t *this) {
unsigned char check_bytes[STR_CHECK_BYTES];
int local_offset, sector, channel;
- for (channel = 0; channel < STR_MAX_CHANNELS; channel++) {
- this->channel_type[channel] = 0;
- }
+ memset(this->channel_type, 0, sizeof(this->channel_type));
this->input->seek(this->input, 0, SEEK_SET);
if (this->input->read(this->input, check_bytes, STR_CHECK_BYTES) !=
@@ -555,7 +553,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_str_t));
+ this = calloc(1, sizeof(demux_str_t));
this->stream = stream;
this->input = input;
@@ -628,7 +626,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_str_init_plugin (xine_t *xine, void *data) {
demux_str_class_t *this;
- this = xine_xmalloc (sizeof (demux_str_class_t));
+ this = calloc(1, sizeof(demux_str_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 3049b2367..80ad0acb1 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -185,9 +185,6 @@
#define INVALID_PROGRAM ((unsigned int)(-1))
#define INVALID_CC ((unsigned int)(-1))
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
#define PROG_STREAM_MAP 0xBC
#define PRIVATE_STREAM1 0xBD
#define PADDING_STREAM 0xBE
@@ -220,7 +217,9 @@
ISO_13818_PART7_AUDIO = 0x0f, /* ISO/IEC 13818-7 Audio with ADTS transport sytax */
ISO_14496_PART2_VIDEO = 0x10, /* ISO/IEC 14496-2 Visual (MPEG-4) */
ISO_14496_PART3_AUDIO = 0x11, /* ISO/IEC 14496-3 Audio with LATM transport syntax */
- ISO_14496_PART10_VIDEO = 0x1b /* ISO/IEC 14496-10 Video (MPEG-4 part 10/AVC, aka H.264) */
+ ISO_14496_PART10_VIDEO = 0x1b, /* ISO/IEC 14496-10 Video (MPEG-4 part 10/AVC, aka H.264) */
+ STREAM_VIDEO_MPEG = 0x80,
+ STREAM_AUDIO_AC3 = 0x81,
} streamType;
#define WRAP_THRESHOLD 270000
@@ -753,21 +752,21 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
* do not include any of the ac3 header info in their audio tracks
* these "raw" streams may begin with a byte that looks like a stream type.
*/
- if((m->descriptor_tag == 0x81) || /* ac3 - raw */
+ if((m->descriptor_tag == STREAM_AUDIO_AC3) || /* ac3 - raw */
(p[0] == 0x0B && p[1] == 0x77)) { /* ac3 - syncword */
m->content = p;
m->size = packet_len;
- m->type |= BUF_AUDIO_A52;
+ m->type = BUF_AUDIO_A52;
return 1;
- } else if (m->descriptor_tag == 0x06
+ } else if (m->descriptor_tag == ISO_13818_PES_PRIVATE
&& p[0] == 0x20 && p[1] == 0x00) {
/* DVBSUB */
long payload_len = ((buf[4] << 8) | buf[5]) - header_len - 3;
m->content = p;
m->size = packet_len;
- m->type |= BUF_SPU_DVB;
+ m->type = BUF_SPU_DVB;
m->buf->decoder_info[2] = payload_len;
return 1;
} else if ((p[0] & 0xE0) == 0x20) {
@@ -781,7 +780,7 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
m->content = p+4;
m->size = packet_len - 4;
- m->type |= BUF_AUDIO_A52;
+ m->type = BUF_AUDIO_A52;
return 1;
} else if ((p[0]&0xf0) == 0xa0) {
@@ -797,7 +796,7 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
m->content = p+pcm_offset;
m->size = packet_len-pcm_offset;
- m->type |= BUF_AUDIO_LPCM_BE;
+ m->type = BUF_AUDIO_LPCM_BE;
return 1;
}
@@ -808,6 +807,7 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
switch (m->descriptor_tag) {
case ISO_11172_VIDEO:
case ISO_13818_VIDEO:
+ case STREAM_VIDEO_MPEG:
lprintf ("demux_ts: found MPEG video type.\n");
m->type = BUF_VIDEO_MPEG;
break;
@@ -834,16 +834,16 @@ static int demux_ts_parse_pes_header (xine_t *xine, demux_ts_media *m,
case ISO_11172_AUDIO:
case ISO_13818_AUDIO:
lprintf ("demux_ts: found MPEG audio track.\n");
- m->type |= BUF_AUDIO_MPEG;
+ m->type = BUF_AUDIO_MPEG;
break;
case ISO_13818_PART7_AUDIO:
case ISO_14496_PART3_AUDIO:
lprintf ("demux_ts: found AAC audio track.\n");
- m->type |= BUF_AUDIO_AAC;
+ m->type = BUF_AUDIO_AAC;
break;
default:
lprintf ("demux_ts: unknown audio type: %d, defaulting to MPEG.\n", m->descriptor_tag);
- m->type |= BUF_AUDIO_MPEG;
+ m->type = BUF_AUDIO_MPEG;
break;
}
return 1;
@@ -1352,7 +1352,7 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
printf ("demux_ts: PMT AC3 audio pid 0x%.4x type %2.2x\n", pid, stream[0]);
#endif
demux_ts_pes_new(this, this->media_num, pid,
- this->audio_fifo, 0x81);
+ this->audio_fifo, STREAM_AUDIO_AC3);
this->audio_tracks[this->audio_tracks_count].pid = pid;
this->audio_tracks[this->audio_tracks_count].media_index = this->media_num;
@@ -2237,7 +2237,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc(sizeof(*this));
+ this = calloc(1, sizeof(*this));
this->stream = stream;
this->input = input;
this->blockSize = PKT_SIZE;
@@ -2278,12 +2278,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this->status = DEMUX_FINISHED;
-#ifdef TS_READ_STATS
- for (i=0; i<=NPKT_PER_READ; i++) {
- this->rstat[i] = 0;
- }
-#endif
-
/* DVBSUB */
this->spu_pid = INVALID_PID;
this->spu_langs_count = 0;
@@ -2328,7 +2322,7 @@ static void *init_class (xine_t *xine, void *data) {
demux_ts_class_t *this;
- this = xine_xmalloc (sizeof (demux_ts_class_t));
+ this = calloc(1, sizeof(demux_ts_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c
index f0dd2612e..8e0595bda 100644
--- a/src/demuxers/demux_tta.c
+++ b/src/demuxers/demux_tta.c
@@ -233,7 +233,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_tta_t *this;
- this = xine_xmalloc (sizeof (demux_tta_t));
+ this = calloc(1, sizeof(demux_tta_t));
this->stream = stream;
this->input = input;
@@ -307,7 +307,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_tta_init_plugin (xine_t *xine, void *data) {
demux_tta_class_t *this;
- this = xine_xmalloc (sizeof (demux_tta_class_t));
+ this = calloc(1, sizeof(demux_tta_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_vmd.c b/src/demuxers/demux_vmd.c
index 416e86f39..b81e4575e 100644
--- a/src/demuxers/demux_vmd.c
+++ b/src/demuxers/demux_vmd.c
@@ -421,7 +421,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_vmd_t *this;
- this = xine_xmalloc (sizeof (demux_vmd_t));
+ this = calloc(1, sizeof(demux_vmd_t));
this->stream = stream;
this->input = input;
@@ -495,7 +495,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_vmd_init_plugin (xine_t *xine, void *data) {
demux_vmd_class_t *this;
- this = xine_xmalloc (sizeof (demux_vmd_class_t));
+ this = calloc(1, sizeof(demux_vmd_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c
index 0439980f8..1d6277186 100644
--- a/src/demuxers/demux_voc.c
+++ b/src/demuxers/demux_voc.c
@@ -296,7 +296,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_voc_t *this;
- this = xine_xmalloc (sizeof (demux_voc_t));
+ this = calloc(1, sizeof(demux_voc_t));
this->stream = stream;
this->input = input;
@@ -370,7 +370,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_voc_init_plugin (xine_t *xine, void *data) {
demux_voc_class_t *this;
- this = xine_xmalloc (sizeof (demux_voc_class_t));
+ this = calloc(1, sizeof(demux_voc_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c
index 3ce2ad705..d646a756f 100644
--- a/src/demuxers/demux_vox.c
+++ b/src/demuxers/demux_vox.c
@@ -203,7 +203,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_vox_t));
+ this = calloc(1, sizeof(demux_vox_t));
this->stream = stream;
this->input = input;
@@ -247,7 +247,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_vox_init_plugin (xine_t *xine, void *data) {
demux_vox_class_t *this;
- this = xine_xmalloc (sizeof (demux_vox_class_t));
+ this = calloc(1, sizeof(demux_vox_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c
index 40242476b..ae0fd8231 100644
--- a/src/demuxers/demux_vqa.c
+++ b/src/demuxers/demux_vqa.c
@@ -334,7 +334,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_vqa_t *this;
- this = xine_xmalloc (sizeof (demux_vqa_t));
+ this = calloc(1, sizeof(demux_vqa_t));
this->stream = stream;
this->input = input;
@@ -408,7 +408,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_vqa_init_plugin (xine_t *xine, void *data) {
demux_vqa_class_t *this;
- this = xine_xmalloc (sizeof (demux_vqa_class_t));
+ this = calloc(1, sizeof(demux_vqa_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index dede27e11..4a1cc78ec 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -126,7 +126,7 @@ static int open_wav_file(demux_wav_t *this) {
return 0;
this->input->seek(this->input, wave_pos, SEEK_SET);
- this->wave = xine_xmalloc( this->wave_size );
+ this->wave = malloc( this->wave_size );
if (!this->wave || this->input->read(this->input, (void *)this->wave, this->wave_size) !=
this->wave_size) {
@@ -357,7 +357,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_wav_t *this;
uint32_t align;
- this = xine_xmalloc (sizeof (demux_wav_t));
+ this = calloc(1, sizeof(demux_wav_t));
this->stream = stream;
this->input = input;
@@ -443,7 +443,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_wav_init_plugin (xine_t *xine, void *data) {
demux_wav_class_t *this;
- this = xine_xmalloc (sizeof (demux_wav_class_t));
+ this = calloc(1, sizeof(demux_wav_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index b3dcb775f..64ae431fb 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -102,7 +102,7 @@ typedef struct {
} demux_mve_class_t;
/* bizarre palette lookup table */
-const unsigned char wc3_pal_lookup[] = {
+static const unsigned char wc3_pal_lookup[] = {
0x00, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0E, 0x10, 0x12, 0x13, 0x15, 0x16,
0x18, 0x19, 0x1A,
0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2A, 0x2C,
@@ -380,8 +380,6 @@ static int open_mve_file(demux_mve_t *this) {
/* allocate space for the shot offset index and set offsets to 0 */
this->shot_offsets = calloc(this->number_of_shots, sizeof(off_t));
this->current_shot = 0;
- for (i = 0; i < this->number_of_shots; i++)
- this->shot_offsets[i] = 0;
/* skip the SOND chunk */
this->input->seek(this->input, 12, SEEK_CUR);
@@ -674,7 +672,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_mve_t *this;
- this = xine_xmalloc (sizeof (demux_mve_t));
+ this = calloc(1, sizeof(demux_mve_t));
this->stream = stream;
this->input = input;
@@ -748,7 +746,7 @@ static void class_dispose (demux_class_t *this_gen) {
void *demux_wc3movie_init_plugin (xine_t *xine, void *data) {
demux_mve_class_t *this;
- this = xine_xmalloc (sizeof (demux_mve_class_t));
+ this = calloc(1, sizeof(demux_mve_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c
index 9c5856710..ca8234d96 100644
--- a/src/demuxers/demux_yuv4mpeg2.c
+++ b/src/demuxers/demux_yuv4mpeg2.c
@@ -403,7 +403,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_yuv4mpeg2_t *this;
- this = xine_xmalloc (sizeof (demux_yuv4mpeg2_t));
+ this = calloc(1, sizeof(demux_yuv4mpeg2_t));
this->stream = stream;
this->input = input;
@@ -477,7 +477,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_plugin (xine_t *xine, void *data) {
demux_yuv4mpeg2_class_t *this;
- this = xine_xmalloc (sizeof (demux_yuv4mpeg2_class_t));
+ this = calloc(1, sizeof(demux_yuv4mpeg2_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c
index 774329c05..f53ca78ee 100644
--- a/src/demuxers/demux_yuv_frames.c
+++ b/src/demuxers/demux_yuv_frames.c
@@ -203,7 +203,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
* if we reach this point, the input has been accepted.
*/
- this = xine_xmalloc (sizeof (demux_yuv_frames_t));
+ this = calloc(1, sizeof(demux_yuv_frames_t));
this->stream = stream;
this->input = input;
@@ -253,7 +253,7 @@ static void class_dispose (demux_class_t *this_gen) {
static void *init_class (xine_t *xine, void *data) {
demux_yuv_frames_class_t *this;
- this = xine_xmalloc (sizeof (demux_yuv_frames_class_t));
+ this = calloc(1, sizeof(demux_yuv_frames_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.get_description = get_description;
diff --git a/src/demuxers/ebml.h b/src/demuxers/ebml.h
index a38515544..9aa471c0b 100644
--- a/src/demuxers/ebml.h
+++ b/src/demuxers/ebml.h
@@ -65,7 +65,7 @@ typedef struct ebml_parser_s {
} ebml_parser_t;
-ebml_parser_t *new_ebml_parser (xine_t *xine, input_plugin_t *input);
+ebml_parser_t *new_ebml_parser (xine_t *xine, input_plugin_t *input) XINE_MALLOC;
void dispose_ebml_parser (ebml_parser_t *ebml);
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 139939d8e..1fe2373b4 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -198,7 +198,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void* data)
{
dxr3_spudec_class_t *this;
- this = (dxr3_spudec_class_t *)xine_xmalloc(sizeof(dxr3_spudec_class_t));
+ this = calloc(1, sizeof(dxr3_spudec_class_t));
if (!this) return NULL;
this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin;
@@ -221,7 +221,7 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi
if (class->instance) return NULL;
if (!dxr3_present(stream)) return NULL;
- this = (dxr3_spudec_t *)xine_xmalloc(sizeof(dxr3_spudec_t));
+ this = calloc(1, sizeof(dxr3_spudec_t));
if (!this) return NULL;
this->spu_decoder.decode_data = dxr3_spudec_decode_data;
@@ -374,7 +374,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
printf("dxr3_decode_spu: DEBUG: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm);
/* append PCI at the end of the list */
while (node->next) node = node->next;
- node->next = (pci_node_t *)xine_xmalloc(sizeof(pci_node_t));
+ node->next = calloc(1, sizeof(pci_node_t));
node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm);
node->next->next = NULL;
xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t));
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 3f1c273ff..496ef143e 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -193,7 +193,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
{
dxr3_decoder_class_t *this;
- this = (dxr3_decoder_class_t *)xine_xmalloc(sizeof (dxr3_decoder_class_t));
+ this = calloc(1, sizeof (dxr3_decoder_class_t));
if (!this) return NULL;
this->video_decoder_class.open_plugin = dxr3_open_plugin;
@@ -220,7 +220,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_
if (class->instance) return NULL;
if (!dxr3_present(stream)) return NULL;
- this = (dxr3_decoder_t *)xine_xmalloc(sizeof (dxr3_decoder_t));
+ this = calloc(1, sizeof (dxr3_decoder_t));
if (!this) return NULL;
cfg = stream->xine->config;
diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c
index 0c59b0b93..0077a465b 100644
--- a/src/dxr3/dxr3_mpeg_encoders.c
+++ b/src/dxr3/dxr3_mpeg_encoders.c
@@ -124,7 +124,7 @@ int dxr3_rte_init(dxr3_driver_t *drv)
return 0;
}
- this = xine_xmalloc(sizeof(rte_data_t));
+ this = calloc(1, sizeof(rte_data_t));
if (!this) return 0;
this->encoder_data.type = ENC_RTE;
@@ -316,7 +316,7 @@ int dxr3_fame_init(dxr3_driver_t *drv)
{
fame_data_t *this;
- this = xine_xmalloc(sizeof(fame_data_t));
+ this = calloc(1, sizeof(fame_data_t));
if (!this) return 0;
this->encoder_data.type = ENC_FAME;
diff --git a/src/dxr3/dxr3_scr.c b/src/dxr3/dxr3_scr.c
index 8fb049656..c95ab00a7 100644
--- a/src/dxr3/dxr3_scr.c
+++ b/src/dxr3/dxr3_scr.c
@@ -70,7 +70,7 @@ dxr3_scr_t *dxr3_scr_init(xine_t *xine)
int devnum;
char tmpstr[128];
- this = (dxr3_scr_t *)xine_xmalloc(sizeof(dxr3_scr_t));
+ this = calloc(1, sizeof(dxr3_scr_t));
devnum = xine->config->register_num(xine->config,
CONF_KEY, 0, CONF_NAME, CONF_HELP, 10, NULL, NULL);
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index c51354157..3e7c9ab08 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -169,7 +169,7 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
{
dxr3_driver_class_t *this;
- this = (dxr3_driver_class_t *)xine_xmalloc(sizeof(dxr3_driver_class_t));
+ this = calloc(1, sizeof(dxr3_driver_class_t));
if (!this) return NULL;
this->devnum = xine->config->register_num(xine->config,
@@ -232,7 +232,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
if (class->instance) return NULL;
- this = (dxr3_driver_t *)xine_xmalloc(sizeof(dxr3_driver_t));
+ this = calloc(1, sizeof(dxr3_driver_t));
if (!this) return NULL;
this->vo_driver.get_capabilities = dxr3_get_capabilities;
@@ -536,7 +536,7 @@ static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen)
dxr3_frame_t *frame;
dxr3_driver_t *this = (dxr3_driver_t *)this_gen;
- frame = (dxr3_frame_t *)xine_xmalloc(sizeof(dxr3_frame_t));
+ frame = calloc(1, sizeof(dxr3_frame_t));
pthread_mutex_init(&frame->vo_frame.mutex, NULL);
@@ -1334,7 +1334,7 @@ static int lookup_parameter(struct lut_entry *lut, char *name,
static int dxr3_overlay_read_state(dxr3_overlay_t *this)
{
char *loc;
- char fname[256], tmp[128], line[256];
+ char *fname, line[256];
FILE *fp;
struct lut_entry lut[] = {
{"xoffset", TYPE_INT, &this->xoffset},
@@ -1359,18 +1359,16 @@ static int dxr3_overlay_read_state(dxr3_overlay_t *this)
* (used by .overlay/res file) */
setlocale(LC_NUMERIC, "C");
- snprintf(tmp, sizeof(tmp), "/res_%dx%dx%d",
+ asprintf(&fname, "%s/.overlay/res_%dx%dx%d", getenv("HOME"),
this->screen_xres, this->screen_yres, this->screen_depth);
- strncpy(fname, getenv("HOME"), sizeof(fname) - strlen(tmp) - sizeof("/.overlay"));
- fname[sizeof(fname) - strlen(tmp) - sizeof("/.overlay")] = '\0';
- strcat(fname, "/.overlay");
- strcat(fname, tmp);
llprintf(LOG_OVR, "attempting to open %s\n", fname);
if (!(fp = fopen(fname, "r"))) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
_("video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"));
+ free(fname);
return -1;
}
+ free(fname);
while (!feof(fp)) {
if (!fgets(line, 256, fp))
diff --git a/src/input/http_helper.c b/src/input/http_helper.c
index 4883763b0..279d3ff05 100644
--- a/src/input/http_helper.c
+++ b/src/input/http_helper.c
@@ -240,8 +240,7 @@ char *_x_canonicalise_url (const char *base, const char *url) {
++cut;
}
base_length = cut ? (size_t)(cut - base) : strlen (base);
- ret = malloc (base_length + strlen (url) + 1);
- sprintf (ret, "%.*s%s", (int)base_length, base, url);
+ asprintf (&ret, "%.*s%s", (int)base_length, base, url);
return ret;
}
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index f43f79fc3..92eca7559 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -370,7 +370,7 @@ static cdrom_toc * init_cdrom_toc(void) {
cdrom_toc *toc;
- toc = (cdrom_toc *) xine_xmalloc(sizeof (cdrom_toc));
+ toc = calloc(1, sizeof (cdrom_toc));
toc->first_track = toc->last_track = toc->total_tracks = 0;
toc->toc_entries = NULL;
@@ -1307,20 +1307,17 @@ static void _cdda_mkdir_recursive_safe(xine_t *xine, char *path) {
if(p && strlen(p)) {
#ifdef WIN32
- if (*buf2 != '\0') {
+ if (*buf2 != '\0') {
#endif
-
- int size = strlen(buf2);
- snprintf(buf2 + size, sizeof(buf2) - size, "/%s", p);
-
+ size_t size = strlen(buf2);
+ snprintf(buf2 + size, sizeof(buf2) - size, "/%s", p);
#ifdef WIN32
- }
- else {
- snprintf(buf2, sizeof(buf2), "%s", p);
- }
-
+ }
+ else {
+ snprintf(buf2, sizeof(buf2), "%s", p);
+ }
#endif /* WIN32 */
-
+
_cdda_mkdir_safe(xine, buf2);
}
}
@@ -1438,13 +1435,13 @@ static int _cdda_cddb_handle_code(char *buf) {
*/
static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
char cdir[XINE_PATH_MAX + XINE_NAME_MAX + 1];
+ size_t cdir_size = 0;
DIR *dir;
if(this == NULL)
return 0;
- memset(&cdir, 0, sizeof(cdir));
- snprintf(cdir, sizeof(cdir), "%s", this->cddb.cache_dir);
+ cdir_size = snprintf(cdir, sizeof(cdir), "%s", this->cddb.cache_dir);
if((dir = opendir(cdir)) != NULL) {
struct dirent *pdir;
@@ -1452,14 +1449,12 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
while((pdir = readdir(dir)) != NULL) {
char discid[9];
- memset(&discid, 0, sizeof(discid));
snprintf(discid, sizeof(discid), "%08lx", this->cddb.disc_id);
if(!strcasecmp(pdir->d_name, discid)) {
FILE *fd;
- int size = strlen(cdir);
- snprintf(cdir + size, sizeof(cdir) - size, "/%s", discid);
+ cdir_size += snprintf(cdir + cdir_size, sizeof(cdir) - cdir_size, "/%s", discid);
if((fd = fopen(cdir, "r")) == NULL) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"input_cdda: fopen(%s) failed: %s.\n", cdir, strerror(errno));
@@ -1537,14 +1532,9 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
int nyear;
y = strstr(buffer, "YEAR:");
- if(y) {
- if (sscanf(y+5, "%4d", &nyear) == 1) {
- char year[5];
-
- snprintf(year, 5, "%d", nyear);
- if (this->cddb.disc_year == NULL)
- this->cddb.disc_year = strdup(year);
- }
+ if (y && this->cddb.disc_year == NULL) {
+ if (sscanf(y+5, "%4d", &nyear) == 1)
+ asprintf(&this->cddb.disc_year, "%d", nyear);
}
}
}
@@ -1721,12 +1711,11 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) {
/* Send query command */
memset(&buffer, 0, sizeof(buffer));
- sprintf(buffer, "cddb query %08lx %d ", this->cddb.disc_id, this->cddb.num_tracks);
+ size_t size = sprintf(buffer, "cddb query %08lx %d ", this->cddb.disc_id, this->cddb.num_tracks);
for (i = 0; i < this->cddb.num_tracks; i++) {
- int size = strlen(buffer);
- snprintf(buffer + size, sizeof(buffer) - size, "%d ", this->cddb.track[i].start);
+ size += snprintf(buffer + size, sizeof(buffer) - size, "%d ", this->cddb.track[i].start);
}
- snprintf(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), "%d\n", this->cddb.disc_length);
+ snprintf(buffer + strlen(buffer), sizeof(buffer) - size, "%d\n", this->cddb.disc_length);
if ((err = _cdda_cddb_send_command(this, buffer)) <= 0) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"input_cdda: error while sending cddb query command.\n");
@@ -1813,7 +1802,7 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) {
while (strcmp(buffer, ".")) {
char buf[2048];
int tnum;
- int bufsize = strlen(buffercache);
+ size_t bufsize = strlen(buffercache);
memset(&buffer, 0, sizeof(buffer));
_cdda_cddb_socket_read(this, buffer, sizeof(buffer) - 1);
@@ -1881,14 +1870,9 @@ static int _cdda_cddb_retrieve(cdda_input_plugin_t *this) {
int nyear;
y = strstr(buffer, "YEAR:");
- if (y) {
- if (sscanf(y+5, "%4d", &nyear) == 1) {
- char year[5];
-
- snprintf(year, 5, "%d", nyear);
- if (this->cddb.disc_year == NULL)
- this->cddb.disc_year = strdup(year);
- }
+ if (y && this->cddb.disc_year == NULL) {
+ if (sscanf(y+5, "%4d", &nyear) == 1)
+ asprintf(&this->cddb.disc_year, "%d", nyear);
}
}
}
@@ -2514,7 +2498,6 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
cdda_input_class_t *this = (cdda_input_class_t *) this_gen;
cdda_input_plugin_t *ip = this->ip;
cdrom_toc *toc;
- char trackmrl[20];
int fd, i, err = -1;
int num_tracks;
@@ -2536,7 +2519,7 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
* device we are going to open; but it is possible that this function
* gets called, before a plugin instance has been created;
* let's create a dummy instance in such a condition */
- ip = (cdda_input_plugin_t *)xine_xmalloc(sizeof(cdda_input_plugin_t));
+ ip = calloc(1, sizeof(cdda_input_plugin_t));
ip->stream = NULL;
ip->fd = -1;
ip->net_fd = -1;
@@ -2580,10 +2563,8 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
num_tracks = toc->last_track - toc->first_track;
if (toc->ignore_last_track)
num_tracks--;
- for ( i = 0; i <= num_tracks; i++ ) {
- sprintf(trackmrl,"cdda:/%d",i+toc->first_track);
- this->autoplaylist[i] = strdup(trackmrl);
- }
+ for ( i = 0; i <= num_tracks; i++ )
+ asprintf(&this->autoplaylist[i],"cdda:/%d",i+toc->first_track);
*num_files = toc->last_track - toc->first_track + 1;
@@ -2637,7 +2618,7 @@ static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_str
} else
return NULL;
- this = (cdda_input_plugin_t *) xine_xmalloc (sizeof (cdda_input_plugin_t));
+ this = calloc(1, sizeof (cdda_input_plugin_t));
class->ip = this;
this->stream = stream;
@@ -2726,7 +2707,7 @@ static void *init_plugin (xine_t *xine, void *data) {
cdda_input_class_t *this;
config_values_t *config;
- this = (cdda_input_class_t *) xine_xmalloc (sizeof (cdda_input_class_t));
+ this = calloc(1, sizeof (cdda_input_class_t));
this->xine = xine;
this->config = xine->config;
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 957a7beb9..85246ea5c 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -66,14 +66,14 @@
* OSD - this will allow for filtering/searching of epg data - useful for automatic recording :)
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
/* pthread.h must be included first so rest of the headers are imported
thread safely (on some systems). */
#include <pthread.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -513,7 +513,7 @@ time_t dvb_mjdtime (char *buf)
int i;
unsigned int year, month, day, hour, min, sec;
unsigned long int mjd;
- struct tm *tma = xine_xmalloc(sizeof(struct tm));
+ struct tm *tma = calloc(1, sizeof(struct tm));
time_t t;
_x_assert(tma != NULL);
@@ -571,24 +571,23 @@ static void tuner_dispose(tuner_t * this)
}
-static tuner_t *tuner_init(xine_t * xine, int adapter)
+static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter)
{
tuner_t *this;
int x;
int test_video;
- char *video_device=xine_xmalloc(200);
+ char *video_device=malloc(100);
_x_assert(video_device != NULL);
- this = (tuner_t *) xine_xmalloc(sizeof(tuner_t));
+ this = calloc(1, sizeof(tuner_t));
_x_assert(this != NULL);
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "tuner_init adapter=%d\n", adapter);
this->fd_frontend = -1;
- for (x = 0; x < MAX_FILTERS; x++)
- this->fd_pidfilter[x] = 0;
+ memset(this->fd_pidfilter, 0, sizeof(this->fd_pidfilter));
this->xine = xine;
this->adapter_num = adapter;
@@ -885,7 +884,6 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
channel_t *channels = NULL;
int num_channels = 0;
int num_alloc = 0;
- int i;
struct stat st;
snprintf(filename, BUFSIZE, "%s/.xine/channels.conf", xine_get_homedir());
@@ -910,8 +908,8 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
while ( fgets (str, BUFSIZE, f)) {
channel_t channel = {0};
- /* lose trailing spaces & control characters */
- i = strlen (str);
+ /* lose trailing spaces & control characters */
+ size_t i = strlen (str);
while (i && str[i - 1] <= ' ')
--i;
if (i == 0)
@@ -922,7 +920,7 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
continue;
if (num_channels >= num_alloc) {
- channel_t *new_channels = xine_xmalloc((num_alloc += 32) * sizeof (channel_t));
+ channel_t *new_channels = calloc((num_alloc += 32), sizeof (channel_t));
_x_assert(new_channels != NULL);
memcpy(new_channels, channels, num_channels * sizeof (channel_t));
free(channels);
@@ -933,8 +931,7 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
/* Initially there's no EPG data in the EPG structs. */
channels[num_channels].epg_count = 0;
- for (i = 0; i < MAX_EPG_ENTRIES_PER_CHANNEL; ++i)
- channels[num_channels].epg[i] = NULL;
+ memset(channels[num_channels].epg, 0, sizeof(channels[num_channels].epg));
num_channels++;
}
@@ -1229,7 +1226,7 @@ static void dvb_parse_si(dvb_input_plugin_t *this) {
struct pollfd pfd;
tuner_t *tuner = this->tuner;
- tmpbuffer = xine_xmalloc (8192);
+ tmpbuffer = calloc(1, 8192);
_x_assert(tmpbuffer != NULL);
@@ -1437,13 +1434,10 @@ static void load_epg_data(dvb_input_plugin_t *this)
already "found" in the stream. This information is used to initialize the
channel's EPG structs when the EPG information for the channel is seen in
the stream the first time. */
- seen_channels = xine_xmalloc(this->num_channels*sizeof(char));
+ seen_channels = calloc(this->num_channels, sizeof(char));
_x_assert(seen_channels != NULL);
- for (i = 0; i < this->num_channels; i++) {
- seen_channels[i] = 0;
- }
- foo = xine_xmalloc(8192);
+ foo = calloc(1, 8192);
_x_assert(foo != NULL);
fd.fd = this->tuner->fd_pidfilter[EITFILTER];
@@ -1493,19 +1487,19 @@ static void load_epg_data(dvb_input_plugin_t *this)
Allocate space for the strings. */
if (current_channel->epg[current_channel->epg_count] == NULL) {
current_channel->epg[current_channel->epg_count] =
- xine_xmalloc(sizeof(epg_entry_t));
+ calloc(1, sizeof(epg_entry_t));
_x_assert(current_channel->epg[current_channel->epg_count] != NULL);
current_channel->epg[current_channel->epg_count]->progname =
- xine_xmalloc((MAX_EPG_PROGRAM_NAME_LENGTH + 1) * sizeof(char));
+ malloc(MAX_EPG_PROGRAM_NAME_LENGTH + 1);
_x_assert(current_channel->epg[current_channel->epg_count]->progname != NULL);
current_channel->epg[current_channel->epg_count]->description =
- xine_xmalloc((MAX_EPG_PROGRAM_DESCRIPTION_LENGTH + 1) * sizeof(char));
+ malloc(MAX_EPG_PROGRAM_DESCRIPTION_LENGTH + 1);
_x_assert(current_channel->epg[current_channel->epg_count]->description != NULL);
current_channel->epg[current_channel->epg_count]->content =
- xine_xmalloc((MAX_EPG_CONTENT_TYPE_LENGTH + 1) * sizeof(char));
+ malloc(MAX_EPG_CONTENT_TYPE_LENGTH + 1);
_x_assert(current_channel->epg[current_channel->epg_count]->content != NULL);
current_channel->epg[current_channel->epg_count]->running = 0;
@@ -1665,7 +1659,7 @@ static void render_text_area(osd_renderer_t* renderer, osd_object_t* osd, char*
/* The line to be printed next. */
char text_line[512];
int text_width, text_height;
- int old_line_length, line_cursor;
+ size_t old_line_length, line_cursor;
char* bound, *old_bound;
*height = 0;
@@ -1825,7 +1819,7 @@ static void show_program_info(int x, int y, int max_x, int max_y, int* last_y,
if (epg_data == NULL || epg_data->progname == NULL)
return;
- buffer = xine_xmalloc(512);
+ buffer = calloc(1, 512);
_x_assert(buffer != NULL);
@@ -1842,8 +1836,7 @@ static void show_program_info(int x, int y, int max_x, int max_y, int* last_y,
/*Content type and rating, if any. */
if (strlen(epg_data->content) > 3) {
-
- snprintf(buffer, 94, "%s", epg_data->content);
+ strncpy(buffer, epg_data->content, 94-1);
prog_rating = epg_data->rating;
if (prog_rating > 0) {
@@ -1873,7 +1866,7 @@ static void show_program_info(int x, int y, int max_x, int max_y, int* last_y,
/* Print the description. */
if (epg_data->description && strlen(epg_data->description) > 0) {
renderer->set_font(osd, "sans", EPG_DESCRIPTION_FONT_SIZE);
- sprintf(buffer, "%s", epg_data->description);
+ strcpy(buffer, epg_data->description);
/* If the description is not complete (i.e., there is no comma at the end),
add "..." to the end. In my locale they often seem to send incomplete description
texts :( */
@@ -2207,7 +2200,7 @@ static void do_record (dvb_input_plugin_t *this) {
this->stream->osd_renderer->hide (this->paused_osd, 0);
this->record_paused=0;
} else {
- t=xine_xmalloc(sizeof(time_t));
+ t=calloc(1, sizeof(time_t));
_x_assert(t != NULL);
@@ -2819,7 +2812,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
* that the channels have really ugly names, sometimes prefixed
* by numbers...
*/
- int chanlen = strlen(channame);
+ size_t chanlen = strlen(channame);
int offset = 0;
xprintf(this->class->xine, XINE_VERBOSITY_LOG,
@@ -2873,7 +2866,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
}
ptr = this->mrl;
ptr += 7;
- channels = xine_xmalloc(sizeof(channel_t));
+ channels = calloc(1, sizeof(channel_t));
_x_assert(channels != NULL);
if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) {
free(channels);
@@ -2893,7 +2886,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
}
ptr = this->mrl;
ptr += 7;
- channels = xine_xmalloc(sizeof(channel_t));
+ channels = calloc(1, sizeof(channel_t));
_x_assert(channels != NULL);
if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) {
free(channels);
@@ -2916,7 +2909,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
}
ptr = this->mrl;
ptr += 7;
- channels = xine_xmalloc(sizeof(channel_t));
+ channels = calloc(1, sizeof(channel_t));
_x_assert(channels != NULL);
if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0)
{
@@ -2942,7 +2935,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
}
ptr = this->mrl;
ptr += 7;
- channels = xine_xmalloc(sizeof(channel_t));
+ channels = calloc(1, sizeof(channel_t));
_x_assert(channels != NULL);
if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0)
{
@@ -3106,7 +3099,7 @@ static input_plugin_t *dvb_class_get_instance (input_class_t *class_gen,
fprintf(stderr, "input_dvb: continuing in get_instance\n");
- this = (dvb_input_plugin_t *) xine_xmalloc (sizeof(dvb_input_plugin_t));
+ this = calloc(1, sizeof(dvb_input_plugin_t));
_x_assert(this != NULL);
@@ -3223,21 +3216,19 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
for (ch = 0, apch = !!lastchannel_enable.num_value;
ch < num_channels && ch < MAX_AUTOCHANNELS;
++ch, ++apch) {
- snprintf(foobuffer, BUFSIZE, "dvb://%s", channels[ch].name);
- free(class->autoplaylist[apch]);
- class->autoplaylist[apch] = strdup(foobuffer);
- _x_assert(class->autoplaylist[apch] != NULL);
+ free(class->autoplaylist[apch]);
+ asprintf(&(class->autoplaylist[apch]), "dvb://%s", channels[ch].name);
+ _x_assert(class->autoplaylist[apch] != NULL);
}
if (lastchannel_enable.num_value){
+ free(class->autoplaylist[0]);
if (default_channel != -1)
/* plugin has been used before - channel is valid */
- sprintf (foobuffer, "dvb://%s", channels[default_channel].name);
+ asprintf (&(class->autoplaylist[0]), "dvb://%s", channels[default_channel].name);
else
/* set a reasonable default - the first channel */
- sprintf (foobuffer, "dvb://%s", num_channels ? channels[0].name : "0");
- free(class->autoplaylist[0]);
- class->autoplaylist[0]=strdup(foobuffer);
+ asprintf (&(class->autoplaylist[0]), "dvb://%s", num_channels ? channels[0].name : "0");
}
free_channel_list(channels, num_channels);
@@ -3253,7 +3244,7 @@ static void *init_class (xine_t *xine, void *data) {
dvb_input_class_t *this;
config_values_t *config = xine->config;
- this = (dvb_input_class_t *) xine_xmalloc (sizeof (dvb_input_class_t));
+ this = calloc(1, sizeof (dvb_input_class_t));
_x_assert(this != NULL);
this->xine = xine;
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 620ce98c4..a845d7628 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -352,11 +352,14 @@ static void send_mouse_enter_leave_event(dvd_input_plugin_t *this, int direction
}
static int update_title_display(dvd_input_plugin_t *this) {
- char ui_title[MAX_STR_LEN + 1];
- xine_event_t uevent;
xine_ui_data_t data;
+ xine_event_t uevent = {
+ .type = XINE_EVENT_UI_SET_TITLE,
+ .stream = this->stream,
+ .data = &data,
+ .data_length = sizeof(data)
+ };
int tt=-1, pr=-1;
- size_t ui_str_length=0;
int num_tt = 0;
if(!this || !(this->stream))
@@ -386,15 +389,15 @@ static int update_title_display(dvd_input_plugin_t *this) {
dvdnav_get_number_of_parts(this->dvdnav, tt, &num_part);
dvdnav_get_angle_info(this->dvdnav, &cur_angle, &num_angle);
if(num_angle > 1) {
- snprintf(ui_title, MAX_STR_LEN,
- "Title %i, Chapter %i, Angle %i of %i",
- tt,pr,cur_angle, num_angle);
+ data.str_len = snprintf(data.str, sizeof(data.str),
+ "Title %i, Chapter %i, Angle %i of %i",
+ tt,pr,cur_angle, num_angle);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_NUMBER,cur_angle);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_COUNT,num_angle);
} else {
- snprintf(ui_title, MAX_STR_LEN,
- "Title %i, Chapter %i",
- tt,pr);
+ data.str_len = snprintf(data.str, sizeof(data.str),
+ "Title %i, Chapter %i",
+ tt,pr);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_NUMBER,0);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_COUNT,0);
}
@@ -403,9 +406,9 @@ static int update_title_display(dvd_input_plugin_t *this) {
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_CHAPTER_NUMBER,pr);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_CHAPTER_COUNT,num_part);
} else if (tt == 0 && dvdnav_menu_table[pr]) {
- snprintf(ui_title, MAX_STR_LEN,
- "DVD %s Menu",
- dvdnav_menu_table[pr]);
+ data.str_len = snprintf(data.str, sizeof(data.str),
+ "DVD %s Menu",
+ dvdnav_menu_table[pr]);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_TITLE_NUMBER,tt);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_TITLE_COUNT,num_tt);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_CHAPTER_NUMBER,0);
@@ -413,7 +416,8 @@ static int update_title_display(dvd_input_plugin_t *this) {
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_NUMBER,0);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_COUNT,0);
} else {
- strcpy(ui_title, "DVD Menu");
+ strcpy(data.str, "DVD Menu");
+ data.str_len = strlen(data.str);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_TITLE_NUMBER,0);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_TITLE_COUNT,num_tt);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_CHAPTER_NUMBER,0);
@@ -421,22 +425,15 @@ static int update_title_display(dvd_input_plugin_t *this) {
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_NUMBER,0);
_x_stream_info_set(this->stream,XINE_STREAM_INFO_DVD_ANGLE_COUNT,0);
}
- ui_str_length = strlen(ui_title);
if (this->dvd_name && this->dvd_name[0] &&
- (ui_str_length + strlen(this->dvd_name) < MAX_STR_LEN)) {
- snprintf(ui_title+ui_str_length, MAX_STR_LEN - ui_str_length,
- ", %s", this->dvd_name);
+ (data.str_len + strlen(this->dvd_name) < sizeof(data.str))) {
+ data.str_len += snprintf(data.str+data.str_len, sizeof(data.str) - data.str_len,
+ ", %s", this->dvd_name);
}
#ifdef INPUT_DEBUG
- printf("input_dvd: Changing title to read '%s'\n", ui_title);
+ printf("input_dvd: Changing title to read '%s'\n", data.str);
#endif
- uevent.type = XINE_EVENT_UI_SET_TITLE;
- uevent.stream = this->stream;
- uevent.data = &data;
- uevent.data_length = sizeof(data);;
- memcpy(data.str, ui_title, strlen(ui_title) + 1);
- data.str_len = strlen(ui_title) + 1;
xine_event_send(this->stream, &uevent);
return 1;
@@ -1313,7 +1310,7 @@ static int dvd_plugin_get_optional_data (input_plugin_t *this_gen,
if(this && this->stream && this->dvdnav) {
if(!(dvdnav_is_domain_vts(this->dvdnav))) {
- sprintf(data, "%s", "menu");
+ strcpy(data, "menu");
if (channel <= 0)
return INPUT_OPTIONAL_SUCCESS;
else
@@ -1336,7 +1333,7 @@ static int dvd_plugin_get_optional_data (input_plugin_t *this_gen,
return INPUT_OPTIONAL_SUCCESS;
} else {
if(channel == -1) {
- sprintf(data, "%s", "none");
+ strcpy(data, "none");
return INPUT_OPTIONAL_SUCCESS;
}
}
@@ -1369,10 +1366,7 @@ check_solaris_vold_device(dvd_input_class_t *this)
(volume_action = getenv("VOLUME_ACTION")) != NULL &&
strcmp(volume_action, "insert") == 0) {
- device = malloc(strlen(volume_device) + strlen(volume_name) + 2);
- if (device == NULL)
- return;
- sprintf(device, "%s/%s", volume_device, volume_name);
+ asprintf(&device, "%s/%s", volume_device, volume_name);
if (stat(device, &stb) != 0 || !S_ISCHR(stb.st_mode)) {
free(device);
return;
@@ -1625,7 +1619,7 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
if (strncasecmp (data, handled_mrl, strlen(handled_mrl) ) != 0)
return NULL;
- this = (dvd_input_plugin_t *) xine_xmalloc (sizeof (dvd_input_plugin_t));
+ this = calloc(1, sizeof (dvd_input_plugin_t));
if (!this) {
return NULL;
}
@@ -1758,7 +1752,7 @@ static void *init_class (xine_t *xine, void *data) {
printf("input_dvd.c: config = %p\n", config);
#endif
- this = (dvd_input_class_t *) xine_xmalloc (sizeof (dvd_input_class_t));
+ this = (dvd_input_class_t *) calloc(1, sizeof (dvd_input_class_t));
if (!this)
return NULL;
@@ -1820,8 +1814,7 @@ static void *init_class (xine_t *xine, void *data) {
"playing scrambled DVDs."), 20, NULL, NULL);
xine_setenv("DVDCSS_METHOD", decrypt_modes[mode], 0);
- css_cache_default = (char *)malloc(strlen(xine_get_homedir()) + 10);
- sprintf(css_cache_default, "%s/.dvdcss/", xine_get_homedir());
+ asprintf(&css_cache_default, "%s/.dvdcss/", xine_get_homedir());
css_cache = config->register_filename(config, "media.dvd.css_cache_path", css_cache_default, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("path to the title key cache"),
_("Since cracking the copy protection of scrambled DVDs can "
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 62d0d73d5..774f6b081 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -421,7 +421,7 @@ static input_plugin_t *file_class_get_instance (input_class_t *cls_gen, xine_str
return NULL;
}
- this = (file_input_plugin_t *) xine_xmalloc (sizeof (file_input_plugin_t));
+ this = (file_input_plugin_t *) calloc(1, sizeof (file_input_plugin_t));
this->stream = stream;
this->mrl = mrl;
this->fh = -1;
@@ -708,11 +708,8 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
}
else {
- dir_files[num_dir_files].mrl = (char *)
- xine_xmalloc(strlen(current_dir_slashed) + 1 + strlen(pdirent->d_name) + 1);
-
dir_files[num_dir_files].origin = strdup(current_dir);
- sprintf(dir_files[num_dir_files].mrl, "%s%s",
+ asprintf(&(dir_files[num_dir_files].mrl), "%s%s",
current_dir_slashed, pdirent->d_name);
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = get_file_type(fullfilename, current_dir, this->xine);
@@ -730,8 +727,9 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
"input_file: readlink() failed: %s\n", strerror(errno));
else {
- dir_files[num_dir_files].link = (char *) xine_xmalloc(linksize + 1);
- strncpy(dir_files[num_dir_files].link, linkbuf, linksize);
+ dir_files[num_dir_files].link =
+ strndup(linkbuf, linksize);
+
dir_files[num_dir_files].type |= get_file_type(dir_files[num_dir_files].link, current_dir, this->xine);
}
}
@@ -746,11 +744,8 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
/* if user don't want to see hidden files, ignore them */
if(this->show_hidden_files) {
- hide_files[num_hide_files].mrl = (char *)
- xine_xmalloc(strlen(current_dir_slashed) + 1 + strlen(pdirent->d_name) + 1);
-
hide_files[num_hide_files].origin = strdup(current_dir);
- sprintf(hide_files[num_hide_files].mrl, "%s%s",
+ asprintf(&(hide_files[num_hide_files].mrl), "%s%s",
current_dir_slashed, pdirent->d_name);
hide_files[num_hide_files].link = NULL;
hide_files[num_hide_files].type = get_file_type(fullfilename, current_dir, this->xine);
@@ -769,9 +764,8 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
"input_file: readlink() failed: %s\n", strerror(errno));
}
else {
- hide_files[num_hide_files].link = (char *)
- xine_xmalloc(linksize + 1);
- strncpy(hide_files[num_hide_files].link, linkbuf, linksize);
+ hide_files[num_hide_files].link =
+ strndup(linkbuf, linksize);
hide_files[num_hide_files].type |= get_file_type(hide_files[num_hide_files].link, current_dir, this->xine);
}
}
@@ -782,11 +776,8 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
} /* So a *normal* one. */
else {
- norm_files[num_norm_files].mrl = (char *)
- xine_xmalloc(strlen(current_dir_slashed) + 1 + strlen(pdirent->d_name) + 1);
-
norm_files[num_norm_files].origin = strdup(current_dir);
- sprintf(norm_files[num_norm_files].mrl, "%s%s",
+ asprintf(&(norm_files[num_norm_files].mrl), "%s%s",
current_dir_slashed, pdirent->d_name);
norm_files[num_norm_files].link = NULL;
norm_files[num_norm_files].type = get_file_type(fullfilename, current_dir, this->xine);
@@ -805,9 +796,8 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
"input_file: readlink() failed: %s\n", strerror(errno));
}
else {
- norm_files[num_norm_files].link = (char *)
- xine_xmalloc(linksize + 1);
- strncpy(norm_files[num_norm_files].link, linkbuf, linksize);
+ norm_files[num_norm_files].link =
+ strndup(linkbuf, linksize);
norm_files[num_norm_files].type |= get_file_type(norm_files[num_norm_files].link, current_dir, this->xine);
}
}
@@ -849,7 +839,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
@@ -867,7 +857,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
@@ -885,7 +875,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
if(num_files >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}
else
memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
@@ -965,7 +955,7 @@ static void *init_plugin (xine_t *xine, void *data) {
file_input_class_t *this;
config_values_t *config;
- this = (file_input_class_t *) xine_xmalloc (sizeof (file_input_class_t));
+ this = (file_input_class_t *) calloc(1, sizeof (file_input_class_t));
this->xine = xine;
this->config = xine->config;
@@ -979,7 +969,7 @@ static void *init_plugin (xine_t *xine, void *data) {
this->input_class.dispose = file_class_dispose;
this->input_class.eject_media = NULL;
- this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*));
+ this->mrls = (xine_mrl_t **) calloc(1, sizeof(xine_mrl_t*));
this->mrls_allocated_entries = 0;
{
diff --git a/src/input/input_http.c b/src/input/input_http.c
index af696ca14..cbc2e8140 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -235,26 +235,16 @@ static int http_plugin_basicauth (const char *user, const char *password, char*
char *tmp;
char *sptr;
char *dptr;
- int totlen;
+ size_t count;
int enclen;
- int count;
- totlen = strlen (user) + 1;
- if(password != NULL)
- totlen += strlen (password);
-
- enclen = ((totlen + 2) / 3 ) * 4 + 1;
+ count = asprintf(&tmp, "%s:%s", user, (password != NULL) ? password : "");
+
+ enclen = ((count + 2) / 3 ) * 4 + 1;
if (len < enclen)
return -1;
-
- tmp = malloc (sizeof(char) * (totlen + 1));
- strcpy (tmp, user);
- strcat (tmp, ":");
- if (password != NULL)
- strcat (tmp, password);
-
- count = strlen(tmp);
+
sptr = tmp;
dptr = dest;
while (count >= 3) {
@@ -661,7 +651,7 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
int done, len, linenum;
int httpcode;
int res;
- int buflen;
+ size_t buflen;
int use_proxy;
int proxyport;
int mpegurl_redirect = 0;
@@ -753,43 +743,38 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
if (use_proxy) {
if (this->port != DEFAULT_HTTP_PORT) {
- snprintf (this->buf, BUFSIZE, "GET http://%s:%d%s HTTP/1.0\015\012",
- this->host, this->port, this->uri);
+ buflen = snprintf (this->buf, BUFSIZE, "GET http://%s:%d%s HTTP/1.0\015\012",
+ this->host, this->port, this->uri);
} else {
- snprintf (this->buf, BUFSIZE, "GET http://%s%s HTTP/1.0\015\012",
- this->host, this->uri);
+ buflen = snprintf (this->buf, BUFSIZE, "GET http://%s%s HTTP/1.0\015\012",
+ this->host, this->uri);
}
}
else
- snprintf (this->buf, BUFSIZE, "GET %s HTTP/1.0\015\012", this->uri);
+ buflen = snprintf (this->buf, BUFSIZE, "GET %s HTTP/1.0\015\012", this->uri);
- buflen = strlen(this->buf);
if (this->port != DEFAULT_HTTP_PORT)
- snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s:%d\015\012",
- this->host, this->port);
+ buflen += snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s:%d\015\012",
+ this->host, this->port);
else
- snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s\015\012",
- this->host);
+ buflen += snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s\015\012",
+ this->host);
- buflen = strlen(this->buf);
if (this_class->proxyuser && strlen(this_class->proxyuser)) {
- snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Proxy-Authorization: Basic %s\015\012", this->proxyauth);
- buflen = strlen(this->buf);
+ buflen += snprintf (this->buf + buflen, BUFSIZE - buflen,
+ "Proxy-Authorization: Basic %s\015\012", this->proxyauth);
}
if (this->user && strlen(this->user)) {
- snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Authorization: Basic %s\015\012", this->auth);
- buflen = strlen(this->buf);
+ buflen += snprintf (this->buf + buflen, BUFSIZE - buflen,
+ "Authorization: Basic %s\015\012", this->auth);
}
- snprintf(this->buf + buflen, BUFSIZE - buflen,
- "User-Agent: xine/%s\015\012"
- "Accept: */*\015\012"
- "Icy-MetaData: 1\015\012"
- "\015\012",
- VERSION);
- buflen = strlen(this->buf);
+ buflen += snprintf(this->buf + buflen, BUFSIZE - buflen,
+ "User-Agent: xine/%s\015\012"
+ "Accept: */*\015\012"
+ "Icy-MetaData: 1\015\012"
+ "\015\012",
+ VERSION);
if (_x_io_tcp_write (this->stream, this->fh, this->buf, buflen) != buflen) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "couldn't send request", NULL);
xprintf(this_class->xine, XINE_VERBOSITY_DEBUG, "input_http: couldn't send request\n");
@@ -934,7 +919,10 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
/* content type */
if (!strncasecmp(this->buf, TAG_CONTENT_TYPE, sizeof(TAG_CONTENT_TYPE) - 1)) {
- if (!strncasecmp(this->buf + sizeof(TAG_CONTENT_TYPE) - 1, "video/nsv", 9)) {
+ const char *type = this->buf + sizeof (TAG_CONTENT_TYPE) - 1;
+ while (isspace (*type))
+ ++type;
+ if (!strncasecmp (type, "video/nsv", 9)) {
lprintf("shoutcast nsv detected\n");
this->is_nsv = 1;
}
@@ -1022,11 +1010,10 @@ static input_plugin_t *http_class_get_instance (input_class_t *cls_gen, xine_str
strncasecmp (mrl, "peercast://pls/", 15)) {
return NULL;
}
- this = (http_input_plugin_t *) xine_xmalloc(sizeof(http_input_plugin_t));
+ this = calloc(1, sizeof(http_input_plugin_t));
if (!strncasecmp (mrl, "peercast://pls/", 15)) {
- this->mrl = xine_xmalloc (30 + strlen(mrl) - 15);
- sprintf (this->mrl, "http://127.0.0.1:7144/stream/%s", mrl+15);
+ asprintf (&this->mrl, "http://127.0.0.1:7144/stream/%s", mrl+15);
} else {
this->mrl = strdup (mrl);
}
@@ -1073,7 +1060,7 @@ static void *init_class (xine_t *xine, void *data) {
config_values_t *config;
char *proxy_env;
- this = (http_input_class_t *) xine_xmalloc (sizeof (http_input_class_t));
+ this = calloc(1, sizeof (http_input_class_t));
this->xine = xine;
this->config = xine->config;
@@ -1090,25 +1077,21 @@ static void *init_class (xine_t *xine, void *data) {
/*
* honour http_proxy envvar
*/
- if((proxy_env = getenv("http_proxy")) && (strlen(proxy_env))) {
+ if((proxy_env = getenv("http_proxy")) && *proxy_env) {
int proxy_port = DEFAULT_HTTP_PORT;
- char *http_proxy = xine_xmalloc(strlen(proxy_env) + 1);
char *p;
if(!strncmp(proxy_env, "http://", 7))
proxy_env += 7;
+
+ this->proxyhost_env = strdup(proxy_env);
- sprintf(http_proxy, "%s", proxy_env);
-
- if((p = strrchr(&http_proxy[0], ':')) && (strlen(p) > 1)) {
+ if((p = strrchr(this->proxyhost_env, ':')) && (strlen(p) > 1)) {
*p++ = '\0';
proxy_port = (int) strtol(p, &p, 10);
}
- this->proxyhost_env = strdup(http_proxy);
this->proxyport_env = proxy_port;
-
- free(http_proxy);
}
else
proxy_env = NULL; /* proxy_env can be "" */
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index 6a1e729e6..158b40448 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -401,7 +401,7 @@ static input_plugin_t *mms_class_get_instance (input_class_t *cls_gen, xine_stre
return NULL;
}
- this = (mms_input_plugin_t *) xine_xmalloc (sizeof (mms_input_plugin_t));
+ this = calloc(1, sizeof (mms_input_plugin_t));
cls->ip = this;
this->stream = stream;
this->mms = NULL;
@@ -459,7 +459,7 @@ static void *init_class (xine_t *xine, void *data) {
mms_input_class_t *this;
- this = (mms_input_class_t *) xine_xmalloc (sizeof (mms_input_class_t));
+ this = calloc(1, sizeof (mms_input_class_t));
this->xine = xine;
this->ip = NULL;
diff --git a/src/input/input_net.c b/src/input/input_net.c
index fe78c93f4..391f33a60 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -480,7 +480,7 @@ static input_plugin_t *net_class_get_instance (input_class_t *cls_gen, xine_stre
return NULL;
}
- this = xine_xmalloc(sizeof(net_input_plugin_t));
+ this = calloc(1, sizeof(net_input_plugin_t));
this->mrl = strdup(mrl);
this->host_port = strdup(filename);
this->stream = stream;
@@ -528,7 +528,7 @@ static void *init_class (xine_t *xine, void *data) {
net_input_class_t *this;
- this = (net_input_class_t *) xine_xmalloc(sizeof(net_input_class_t));
+ this = calloc(1, sizeof(net_input_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 1d1e5cf53..4790164d5 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -333,65 +333,38 @@ struct input_plugin_s {
/*
* Freeing/zeroing all of entries of given mrl.
*/
-#define MRL_ZERO(m) { \
- if((m)) { \
- if((m)->origin) \
- free((m)->origin); \
- if((m)->mrl) \
- free((m)->mrl); \
- if((m)->link) \
- free((m)->link); \
- (m)->origin = NULL; \
- (m)->mrl = NULL; \
- (m)->link = NULL; \
- (m)->type = 0; \
- (m)->size = (off_t) 0; \
- } \
-}
+#define MRL_ZERO(m) { \
+ if((m)) { \
+ free((m)->origin); \
+ free((m)->mrl); \
+ free((m)->link); \
+ (m)->origin = NULL; \
+ (m)->mrl = NULL; \
+ (m)->link = NULL; \
+ (m)->type = 0; \
+ (m)->size = (off_t) 0; \
+ } \
+ }
/*
* Duplicate two mrls entries (s = source, d = destination).
*/
-#define MRL_DUPLICATE(s, d) { \
- _x_assert((s) != NULL); \
- _x_assert((d) != NULL); \
- \
- if((s)->origin) { \
- if((d)->origin) { \
- (d)->origin = (char *) realloc((d)->origin, strlen((s)->origin) + 1); \
- sprintf((d)->origin, "%s", (s)->origin); \
- } \
- else \
- (d)->origin = strdup((s)->origin); \
- } \
- else \
- (d)->origin = NULL; \
- \
- if((s)->mrl) { \
- if((d)->mrl) { \
- (d)->mrl = (char *) realloc((d)->mrl, strlen((s)->mrl) + 1); \
- sprintf((d)->mrl, "%s", (s)->mrl); \
- } \
- else \
- (d)->mrl = strdup((s)->mrl); \
- } \
- else \
- (d)->mrl = NULL; \
- \
- if((s)->link) { \
- if((d)->link) { \
- (d)->link = (char *) realloc((d)->link, strlen((s)->link) + 1); \
- sprintf((d)->link, "%s", (s)->link); \
- } \
- else \
- (d)->link = strdup((s)->link); \
- } \
- else \
- (d)->link = NULL; \
- \
- (d)->type = (s)->type; \
- (d)->size = (s)->size; \
-}
+#define MRL_DUPLICATE(s, d) { \
+ _x_assert((s) != NULL); \
+ _x_assert((d) != NULL); \
+ \
+ free((d)->origin); \
+ (d)->origin = (s)->origin ? strdup((s)->origin) : NULL; \
+ \
+ free((d)->mrl); \
+ (d)->mrl = (s)->mrl ? strdup((s)->mrl) : NULL; \
+ \
+ free((d)->link); \
+ (d)->link = (s)->link ? strdup((s)->link) : NULL; \
+ \
+ (d)->type = (s)->type; \
+ (d)->size = (s)->size; \
+ }
/*
* Duplicate two arrays of mrls (s = source, d = destination).
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index f4bfa1395..669d24d28 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -229,7 +229,7 @@ static input_plugin_t *pnm_class_get_instance (input_class_t *cls_gen, xine_stre
return NULL;
}
- this = (pnm_input_plugin_t *) xine_xmalloc (sizeof (pnm_input_plugin_t));
+ this = calloc(1, sizeof (pnm_input_plugin_t));
this->stream = stream;
this->pnm = NULL;
@@ -274,7 +274,7 @@ static void *init_class (xine_t *xine, void *data) {
pnm_input_class_t *this;
- this = (pnm_input_class_t *) xine_xmalloc (sizeof (pnm_input_class_t));
+ this = calloc(1, sizeof (pnm_input_class_t));
this->xine = xine;
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 1b8000072..009c76939 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -376,10 +376,10 @@ static void pvrscr_exit (scr_plugin_t *scr) {
free(this);
}
-static pvrscr_t* pvrscr_init (void) {
+static pvrscr_t *XINE_MALLOC pvrscr_init (void) {
pvrscr_t *this;
- this = (pvrscr_t *) xine_xmalloc(sizeof(pvrscr_t));
+ this = calloc(1, sizeof(pvrscr_t));
this->scr.interface_version = 3;
this->scr.get_priority = pvrscr_get_priority;
@@ -504,34 +504,24 @@ static void pvr_adjust_realtime_speed(pvr_input_plugin_t *this, fifo_buffer_t *f
}
#define PVR_FILENAME "%s%08d_%08d.vob"
-#define PVR_FILENAME_SIZE 1+8+1+8+4+1
static char *make_temp_name(pvr_input_plugin_t *this, int page) {
-
char *filename;
- int size = strlen(this->tmp_prefix)+PVR_FILENAME_SIZE;
- filename = malloc(size);
-
- snprintf(filename, size, PVR_FILENAME, this->tmp_prefix, this->session, page);
+ asprintf(&filename, PVR_FILENAME, this->tmp_prefix, this->session, page);
return filename;
}
#define SAVE_BASE_FILENAME "ch%03d %02d-%02d-%04d %02d:%02d:%02d"
-#define SAVE_BASE_FILENAME_SIZE 2+3+1+2+1+2+1+4+1+2+1+2+1+2+1
static char *make_base_save_name(int channel, time_t tm) {
-
struct tm rec_time;
char *filename;
- int size = SAVE_BASE_FILENAME_SIZE;
- filename = malloc(size);
-
localtime_r(&tm, &rec_time);
- snprintf(filename, size, SAVE_BASE_FILENAME,
+ asprintf(&filename, SAVE_BASE_FILENAME,
channel, rec_time.tm_mon+1, rec_time.tm_mday,
rec_time.tm_year+1900, rec_time.tm_hour, rec_time.tm_min,
rec_time.tm_sec);
@@ -539,16 +529,11 @@ static char *make_base_save_name(int channel, time_t tm) {
}
#define SAVE_FILENAME "%s%s_%04d.vob"
-#define SAVE_FILENAME_SIZE 1+4+4+1
static char *make_save_name(pvr_input_plugin_t *this, char *base, int page) {
-
char *filename;
- int size = strlen(this->save_prefix)+strlen(base)+SAVE_FILENAME_SIZE;
- filename = malloc(size);
-
- snprintf(filename, size, SAVE_FILENAME, this->save_prefix, base, page);
+ asprintf(&filename, SAVE_FILENAME, this->save_prefix, base, page);
return filename;
}
@@ -1480,7 +1465,7 @@ static input_plugin_t *pvr_class_get_instance (input_class_t *cls_gen, xine_stre
mrl = strdup(data);
aux = &mrl[5];
- this = (pvr_input_plugin_t *) xine_xmalloc (sizeof (pvr_input_plugin_t));
+ this = calloc(1, sizeof (pvr_input_plugin_t));
this->class = cls;
this->stream = stream;
this->dev_fd = -1;
@@ -1564,7 +1549,7 @@ static void *init_plugin (xine_t *xine, void *data) {
pvr_input_class_t *this;
- this = (pvr_input_class_t *) xine_xmalloc (sizeof (pvr_input_class_t));
+ this = calloc(1, sizeof (pvr_input_class_t));
this->xine = xine;
this->config = xine->config;
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c
index 25498f289..66fcba87e 100644
--- a/src/input/input_rtp.c
+++ b/src/input/input_rtp.c
@@ -717,7 +717,7 @@ static input_plugin_t *rtp_class_get_instance (input_class_t *cls_gen,
}
}
- this = (rtp_input_plugin_t *) xine_xmalloc(sizeof(rtp_input_plugin_t));
+ this = calloc(1, sizeof(rtp_input_plugin_t));
this->stream = stream;
this->mrl = mrl;
this->filename = filename;
@@ -784,7 +784,7 @@ static void *init_class (xine_t *xine, void *data) {
rtp_input_class_t *this;
- this = (rtp_input_class_t *) xine_xmalloc(sizeof(rtp_input_class_t));
+ this = calloc(1, sizeof(rtp_input_class_t));
this->config = xine->config;
this->xine = xine;
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index 42d24ed3a..110c4d4b6 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -244,7 +244,7 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str
if (strncasecmp (mrl, "rtsp://", 6))
return NULL;
- this = (rtsp_input_plugin_t *) xine_xmalloc (sizeof (rtsp_input_plugin_t));
+ this = calloc(1, sizeof (rtsp_input_plugin_t));
this->stream = stream;
this->rtsp = NULL;
@@ -252,8 +252,7 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str
/* since we handle only real streams yet, we can savely add
* an .rm extention to force handling by demux_real.
*/
- this->public_mrl = xine_xmalloc (sizeof (char)*(strlen(this->mrl)+10));
- sprintf(this->public_mrl, "%s.rm", this->mrl);
+ asprintf(&this->public_mrl, "%s.rm", this->mrl);
this->nbc = nbc_init (stream);
@@ -296,7 +295,7 @@ static void *init_class (xine_t *xine, void *data) {
rtsp_input_class_t *this;
- this = (rtsp_input_class_t *) xine_xmalloc (sizeof (rtsp_input_class_t));
+ this = calloc(1, sizeof (rtsp_input_class_t));
this->xine = xine;
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 777b80b46..dbab772c9 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -265,9 +265,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup(current_path);
- dir_files[num_dir_files].mrl = (char *) xine_xmalloc(
- strlen(current_path) + 1 + strlen(pdirent->name) + 1);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", current_path, pdirent->name);
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name);
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
}else if (pdirent->smbc_type == SMBC_SERVER){
@@ -275,17 +273,14 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup("smb:/");
- dir_files[num_dir_files].mrl = (char *) xine_xmalloc(strlen("smb:/") + 4);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", "smb:/", "..");
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", "..");
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
}
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup("smb:/");
- dir_files[num_dir_files].mrl =
- (char *) xine_xmalloc(strlen("smb:/") + 1 + strlen(pdirent->name) + 1);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", "smb:/", pdirent->name);
+ asprintf(*(dir_files[num_dir_files].mrl), "%s/%s", "smb:/", pdirent->name);
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
} else if (pdirent->smbc_type == SMBC_FILE_SHARE){
@@ -293,9 +288,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup(current_path);
- dir_files[num_dir_files].mrl = (char *) xine_xmalloc(
- strlen(current_path) + 3);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", current_path, "..");
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, "..");
dir_files[num_dir_files].type |= mrl_file_directory;
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
@@ -304,9 +297,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup(current_path);
- dir_files[num_dir_files].mrl = (char *) xine_xmalloc(
- strlen(current_path) + 1 + strlen(pdirent->name) + 1);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", current_path, pdirent->name);
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name);
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
}
@@ -314,18 +305,14 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].origin = strdup(current_path);
- dir_files[num_dir_files].mrl =
- (char *) xine_xmalloc(strlen(current_path) + 1 + strlen(pdirent->name) + 1);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", current_path, pdirent->name);
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, pdirent->name);
dir_files[num_dir_files].size = pdirent->dirlen;
num_dir_files ++;
}else if (pdirent->smbc_type == SMBC_FILE){
norm_files[num_norm_files].link = NULL;
norm_files[num_norm_files].type = mrl_file | mrl_file_normal;
norm_files[num_norm_files].origin = strdup(current_path);
- norm_files[num_norm_files].mrl =
- (char *) xine_xmalloc(strlen(current_path) + 1 + strlen(pdirent->name) + 1);
- sprintf(norm_files[num_norm_files].mrl, "%s/%s", current_path, pdirent->name);
+ asprintf(&(norm_files[num_norm_files].mrl), "%s/%s", current_path, pdirent->name);
norm_files[num_norm_files].size = pdirent->dirlen;
num_norm_files ++;
}
@@ -335,8 +322,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
if (num_dir_files == 0) {
dir_files[num_dir_files].link = NULL;
dir_files[num_dir_files].origin = strdup(current_path);
- dir_files[num_dir_files].mrl = (char *) xine_xmalloc(strlen(current_path) + 4);
- sprintf(dir_files[num_dir_files].mrl, "%s/%s", current_path, "..");
+ asprintf(&(dir_files[num_dir_files].mrl), "%s/%s", current_path, "..");
dir_files[num_dir_files].type = mrl_file | mrl_file_directory;
dir_files[num_dir_files].size = 0;
num_dir_files ++;
@@ -359,7 +345,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
++this->mrls_allocated_entries;
this->mrls = realloc(this->mrls,
(this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}else
memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
@@ -376,7 +362,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
++this->mrls_allocated_entries;
this->mrls = realloc(this->mrls,
(this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t));
}else
memset(this->mrls[num_files], 0, sizeof(xine_mrl_t));
@@ -475,7 +461,7 @@ smb_class_get_instance (input_class_t *class_gen, xine_stream_t *stream,
if (strncmp (mrl, "smb://",6))
return NULL;
- this = (smb_input_t *)xine_xmalloc(sizeof(smb_input_t));
+ this = calloc(1, sizeof(smb_input_t));
this->stream = stream;
this->mrl = strdup (mrl);
this->fd = -1;
@@ -514,7 +500,7 @@ static void
if (smbc_init(smb_auth,(xine->verbosity >= XINE_VERBOSITY_DEBUG)))
goto _exit_error;
- this = (smb_input_class_t *) xine_xmalloc(sizeof(smb_input_class_t));
+ this = calloc(1, sizeof(smb_input_class_t));
this->xine = xine;
this->input_class.get_instance = smb_class_get_instance;
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index 465e9c00b..0ae841b4b 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -311,7 +311,7 @@ static input_plugin_t *stdin_class_get_instance (input_class_t *class_gen,
* => create plugin instance
*/
- this = (stdin_input_plugin_t *) xine_xmalloc(sizeof(stdin_input_plugin_t));
+ this = calloc(1, sizeof(stdin_input_plugin_t));
this->stream = stream;
this->curpos = 0;
@@ -362,7 +362,7 @@ static void *init_class (xine_t *xine, void *data) {
stdin_input_class_t *this;
- this = (stdin_input_class_t *) xine_xmalloc (sizeof (stdin_input_class_t));
+ this = calloc(1, sizeof (stdin_input_class_t));
this->xine = xine;
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index d0558b492..304f6f484 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -120,6 +120,10 @@ typedef struct {
int old_zoomx;
int old_zoomy;
int audio_only;
+
+ buf_element_t *frames_base;
+ void *audio_content_base;
+ void *video_content_base;
/* Audio */
buf_element_t *aud_frames;
@@ -345,11 +349,11 @@ static void pvrscr_exit (scr_plugin_t *scr)
free(this);
}
-static pvrscr_t* pvrscr_init (void)
+static pvrscr_t *XINE_MALLOC pvrscr_init (void)
{
pvrscr_t *this;
- this = (pvrscr_t *) xine_xmalloc(sizeof(pvrscr_t));
+ this = calloc(1, sizeof(pvrscr_t));
this->scr.interface_version = 3;
this->scr.get_priority = pvrscr_get_priority;
@@ -711,23 +715,50 @@ static int search_by_channel(v4l_input_plugin_t *this, char *input_source)
return 1;
}
-static void allocate_audio_frames(v4l_input_plugin_t *this)
+static void allocate_frames(v4l_input_plugin_t *this, unsigned dovideo)
{
+ const size_t framescount = dovideo ? 2*NUM_FRAMES : NUM_FRAMES;
+
+ /* Allocate a single memory area for both audio and video frames */
+ buf_element_t *frames = this->frames_base =
+ calloc(framescount, sizeof(buf_element_t));
+ extra_info_t *infos =
+ calloc(framescount, sizeof(extra_info_t));
+
int i;
-
+
+ uint8_t *audio_content = this->audio_content_base =
+ calloc(NUM_FRAMES, this->periodsize);
+
+ /* Set up audio frames */
for (i = 0; i < NUM_FRAMES; i++) {
- buf_element_t *frame;
-
/* Audio frame */
- frame = xine_xmalloc(sizeof(buf_element_t));
-
- frame->content = xine_xmalloc(this->periodsize);
- frame->type = BUF_AUDIO_LPCM_LE;
- frame->source = this;
- frame->free_buffer = store_aud_frame;
- frame->extra_info = xine_xmalloc(sizeof(extra_info_t));
-
- store_aud_frame(frame);
+ frames[i].content = audio_content;
+ frames[i].type = BUF_AUDIO_LPCM_LE;
+ frames[i].source = this;
+ frames[i].free_buffer = store_aud_frame;
+ frames[i].extra_info = &infos[i];
+
+ audio_content += this->periodsize;
+ store_aud_frame(&frames[i]);
+ }
+
+ if ( dovideo ) {
+ uint8_t *video_content = this->video_content_base =
+ calloc(NUM_FRAMES, this->frame_size);
+
+ /* Set up video frames */
+ for (i = NUM_FRAMES; i < 2*NUM_FRAMES; i++) {
+ /* Video frame */
+ frames[i].content = video_content;
+ frames[i].type = this->frame_format;
+ frames[i].source = this;
+ frames[i].free_buffer = store_vid_frame;
+ frames[i].extra_info = &infos[i];
+
+ video_content += this->frame_size;
+ store_vid_frame(&frames[i]);
+ }
}
}
@@ -778,7 +809,7 @@ static int open_radio_capture_device(v4l_input_plugin_t *this)
/* Pre-allocate some frames for audio so it doesn't have to be done during
* capture */
- allocate_audio_frames(this);
+ allocate_frames(this, 0);
this->audio_only = 1;
@@ -850,7 +881,7 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
/* Pre-allocate some frames for audio and video so it doesn't have to be
* done during capture */
- allocate_audio_frames(this);
+ allocate_frames(this, 1);
/* Unmute audio off video capture device */
unmute_audio(this);
@@ -954,20 +985,6 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
break;
}
- for (i = 0; i < NUM_FRAMES; i++) {
- buf_element_t *frame;
-
- frame = xine_xmalloc (sizeof (buf_element_t));
-
- frame->content = xine_xmalloc (this->frame_size);
- frame->type = this->frame_format;
- frame->source = this;
- frame->free_buffer = store_vid_frame;
- frame->extra_info = xine_xmalloc(sizeof(extra_info_t));
-
- store_vid_frame(frame);
- }
-
/* Strip the vbi / sync signal from the image by zooming in */
this->old_zoomx = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_X);
this->old_zoomy = xine_get_param(this->stream, XINE_PARAM_VO_ZOOM_Y);
@@ -1569,52 +1586,18 @@ static void v4l_plugin_dispose (input_plugin_t *this_gen) {
if (this->event_queue)
xine_event_dispose_queue (this->event_queue);
-
- lprintf("Freeing allocated audio frames");
- if (this->aud_frames) {
- buf_element_t *cur_frame = this->aud_frames;
-
- while (cur_frame != NULL) {
- buf_element_t *next_frame = cur_frame->next;
-#ifdef LOG
- printf(".");
-#endif
- if (cur_frame->content)
- free(cur_frame->content);
-
- if (cur_frame->extra_info)
- free(cur_frame->extra_info);
-
- free(cur_frame);
- cur_frame = next_frame;
- }
- }
-#ifdef LOG
- printf("\n");
-#endif
+ /* All the frames, both video and audio, are allocated in a single
+ memory area pointed by the frames_base pointer. The content of
+ the frames is divided in two areas, one pointed by
+ audio_content_base and the other by video_content_base. The
+ extra_info structures are all allocated in the first frame
+ data. */
+ free(this->audio_content_base);
+ free(this->video_content_base);
+ free(this->frames_base->extra_info);
+ free(this->frames_base);
-
- lprintf("Freeing allocated video frames");
- if (this->vid_frames) {
- buf_element_t *cur_frame = this->vid_frames;
-
- while (cur_frame != NULL) {
- buf_element_t *next_frame = cur_frame->next;
-#ifdef LOG
- printf(".");
-#endif
-
- if (cur_frame->content)
- free(cur_frame->content);
-
- if (cur_frame->extra_info)
- free(cur_frame->extra_info);
-
- free(cur_frame);
- cur_frame = next_frame;
- }
- }
#ifdef LOG
printf("\n");
#endif
@@ -1715,7 +1698,7 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen,
return NULL;
}
- this = (v4l_input_plugin_t *) xine_xmalloc (sizeof (v4l_input_plugin_t));
+ this = calloc(1, sizeof (v4l_input_plugin_t));
extract_mrl(this, mrl);
@@ -1900,7 +1883,7 @@ static void *init_video_class (xine_t *xine, void *data)
v4l_input_class_t *this;
config_values_t *config = xine->config;
- this = (v4l_input_class_t *) xine_xmalloc (sizeof (v4l_input_class_t));
+ this = calloc(1, sizeof (v4l_input_class_t));
this->xine = xine;
@@ -1934,7 +1917,7 @@ static void *init_radio_class (xine_t *xine, void *data)
v4l_input_class_t *this;
config_values_t *config = xine->config;
- this = (v4l_input_class_t *) xine_xmalloc (sizeof (v4l_input_class_t));
+ this = calloc(1, sizeof (v4l_input_class_t));
this->xine = xine;
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 007fa5946..90f6fcc70 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -84,7 +84,7 @@ typedef struct {
const char *device;
- char *filelist[100];
+ char **filelist;
int mrls_allocated_entries;
xine_mrl_t **mrls;
@@ -889,7 +889,7 @@ static input_plugin_t *vcd_class_get_instance (input_class_t *cls_gen, xine_stre
return 0;
}
- this = (vcd_input_plugin_t *) xine_xmalloc(sizeof(vcd_input_plugin_t));
+ this = calloc(1, sizeof(vcd_input_plugin_t));
this->stream = stream;
this->mrl = mrl;
@@ -924,6 +924,18 @@ static const char *vcd_class_get_identifier (input_class_t *this_gen) {
return "vcdo";
}
+static void vcd_filelist_dispose(vcd_input_class_t *this) {
+ if ( this->filelist == NULL ) return;
+
+ char **entry = this->filelist;
+
+ while(*(entry)) {
+ free(*(entry++));
+ }
+
+ free(this->filelist);
+}
+
static void vcd_class_dispose (input_class_t *this_gen) {
vcd_input_class_t *this = (vcd_input_class_t *) this_gen;
@@ -932,9 +944,7 @@ static void vcd_class_dispose (input_class_t *this_gen) {
config->unregister_callback(config, "media.vcd.device");
- for (i = 0; i < 100; i++)
- free (this->filelist[i]);
-
+ vcd_filelist_dispose(this);
free (this->mrls);
free (this);
}
@@ -982,33 +992,19 @@ static xine_mrl_t **vcd_class_get_dir (input_class_t *this_gen, const char *file
/* printf ("%d tracks\n", this->total_tracks); */
for (i=1; i<this->total_tracks; i++) { /* FIXME: check if track 0 contains valid data */
- char mrl[1024];
-
- memset(&mrl, 0, sizeof (mrl));
- sprintf(mrl, "vcdo:/%d",i);
-
if((i-1) >= this->mrls_allocated_entries) {
++this->mrls_allocated_entries;
/* note: 1 extra pointer for terminating NULL */
this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*));
- this->mrls[(i-1)] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
+ this->mrls[(i-1)] = calloc(1, sizeof(xine_mrl_t));
}
else {
memset(this->mrls[(i-1)], 0, sizeof(xine_mrl_t));
}
- if(this->mrls[(i-1)]->mrl) {
- this->mrls[(i-1)]->mrl = (char *)
- realloc(this->mrls[(i-1)]->mrl, strlen(mrl) + 1);
- }
- else {
- this->mrls[(i-1)]->mrl = (char *) xine_xmalloc(strlen(mrl) + 1);
- }
-
- this->mrls[i-1]->origin = NULL;
- sprintf(this->mrls[i-1]->mrl, "%s", mrl);
- this->mrls[i-1]->link = NULL;
- this->mrls[i-1]->type = (0 | mrl_vcd);
+ asprintf(&(this->mrls[i-1]->mrl), "vcdo:/%d", i);
+
+ this->mrls[i-1]->type = mrl_vcd;
/* hack */
this->mrls[i-1]->size = vcd_plugin_get_length ((input_plugin_t *) this);
@@ -1055,20 +1051,15 @@ static char ** vcd_class_get_autoplay_list (input_class_t *this_gen, int *num_fi
fd = -1;
*num_files = this->total_tracks - 1;
-
- /* printf ("%d tracks\n", this->total_tracks); */
- for (i = 1; i < this->total_tracks; i++) { /* FIXME: check if track 0 contains valid data */
+ vcd_filelist_dispose(this);
+ this->filelist = calloc(this->total_tracks+1, sizeof(char*));
- if(this->filelist[i - 1] == NULL)
- this->filelist[i - 1] = (char *) realloc(this->filelist[i - 1], sizeof(char *) * 256);
+ /* FIXME: check if track 0 contains valid data */
+ for (i = 1; i < this->total_tracks; i++)
+ asprintf(&this->filelist[i-1], "vcdo:/%d", i);
- sprintf (this->filelist[i - 1], "vcdo:/%d",i);
- /* printf ("list[%d] : %d %s\n", i, this->filelist[i-1], this->filelist[i-1]); */
- }
-
- this->filelist[i - 1] = (char *) realloc(this->filelist[i-1], sizeof(char *));
- this->filelist[i - 1] = NULL;
+ /* printf ("%d tracks\n", this->total_tracks); */
return this->filelist;
}
@@ -1079,7 +1070,7 @@ static void *init_class (xine_t *xine, void *data) {
config_values_t *config = xine->config;
int i;
- this = (vcd_input_class_t *) xine_xmalloc (sizeof (vcd_input_class_t));
+ this = calloc(1, sizeof (vcd_input_class_t));
this->xine = xine;
@@ -1097,13 +1088,9 @@ static void *init_class (xine_t *xine, void *data) {
"you intend to play your VideoCDs with."),
10, device_change_cb, (void *)this);
- this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*));
+ this->mrls = calloc(1, sizeof(xine_mrl_t*));
this->mrls_allocated_entries = 0;
- for (i = 0; i < 100; i++) {
- this->filelist[i] = (char *) xine_xmalloc(sizeof(char *) * 256);
- }
-
return this;
}
diff --git a/src/input/libreal/asmrp.c b/src/input/libreal/asmrp.c
index f7206b583..970fcb0f7 100644
--- a/src/input/libreal/asmrp.c
+++ b/src/input/libreal/asmrp.c
@@ -95,7 +95,7 @@ typedef struct {
} asmrp_t;
-static asmrp_t *asmrp_new () {
+static asmrp_t *XINE_MALLOC asmrp_new () {
asmrp_t *p;
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index fecf9a794..c0e11fa00 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -48,9 +48,6 @@ static const unsigned char xor_table[] = {
#define _X_BE_32C(x,y) do { *(uint32_t *)(x) = be2me_32((y)); } while(0)
#define _X_LE_32C(x,y) do { *(uint32_t *)(x) = le2me_32((y)); } while(0)
-#define MAX(x,y) ((x>y) ? x : y)
-
-
static void hash(char *field, char *param) {
uint32_t a, b, c, d;
@@ -313,7 +310,7 @@ static void calc_response_string (char *result, char *challenge) {
void real_calc_response_and_checksum (char *response, char *chksum, char *challenge) {
- int ch_len, resp_len;
+ size_t ch_len, resp_len;
int i;
char *ptr;
char buf[128];
@@ -449,7 +446,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
if (!desc) return NULL;
buf=xine_buffer_init(2048);
- header = xine_xmalloc(sizeof(rmff_header_t));
+ header = calloc(1, sizeof(rmff_header_t));
header->fileheader=rmff_new_fileheader(4+desc->stream_count);
header->cont=rmff_new_cont(
diff --git a/src/input/libreal/rmff.h b/src/input/libreal/rmff.h
index b03d12b1b..50656349d 100644
--- a/src/input/libreal/rmff.h
+++ b/src/input/libreal/rmff.h
@@ -32,10 +32,10 @@
#include <string.h>
#include <inttypes.h>
-
#ifndef HAVE_RMFF_H
#define HAVE_RMFF_H
+#include "attributes.h"
#define RMFF_HEADER_SIZE 0x12
@@ -220,7 +220,7 @@ rmff_data_t *rmff_new_dataheader(
/*
* reads header infos from data and returns a newly allocated header struct
*/
-rmff_header_t *rmff_scan_header(const char *data);
+rmff_header_t *rmff_scan_header(const char *data) XINE_MALLOC;
/*
* scans a data packet header. Notice, that this function does not allocate
@@ -231,7 +231,7 @@ void rmff_scan_pheader(rmff_pheader_t *h, char *data);
/*
* reads header infos from stream and returns a newly allocated header struct
*/
-rmff_header_t *rmff_scan_header_stream(int fd);
+rmff_header_t *rmff_scan_header_stream(int fd) XINE_MALLOC;
/*
* prints header information in human readible form to stdout
diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c
index 9117d15a5..f3672559c 100644
--- a/src/input/libreal/sdpplin.c
+++ b/src/input/libreal/sdpplin.c
@@ -99,7 +99,7 @@ static char *nl(char *data) {
static int filter(const char *in, const char *filter, char **out) {
- int flen=strlen(filter);
+ size_t flen=strlen(filter);
size_t len;
if (!in)
@@ -120,9 +120,9 @@ static int filter(const char *in, const char *filter, char **out) {
return 0;
}
-static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
+static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
- sdpplin_stream_t *desc = xine_xmalloc(sizeof(sdpplin_stream_t));
+ sdpplin_stream_t *desc = calloc(1, sizeof(sdpplin_stream_t));
char *buf=xine_buffer_init(32);
char *decoded=xine_buffer_init(32);
int handled;
@@ -239,7 +239,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) {
sdpplin_t *sdpplin_parse(char *data) {
- sdpplin_t *desc = xine_xmalloc(sizeof(sdpplin_t));
+ sdpplin_t *desc = calloc(1, sizeof(sdpplin_t));
sdpplin_stream_t *stream;
char *buf=xine_buffer_init(32);
char *decoded=xine_buffer_init(32);
diff --git a/src/input/libreal/sdpplin.h b/src/input/libreal/sdpplin.h
index 72cbaf731..1604ee38c 100644
--- a/src/input/libreal/sdpplin.h
+++ b/src/input/libreal/sdpplin.h
@@ -101,7 +101,7 @@ typedef struct {
} sdpplin_t;
-sdpplin_t *sdpplin_parse(char *data);
+sdpplin_t *sdpplin_parse(char *data) XINE_MALLOC;
void sdpplin_free(sdpplin_t *description);
diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c
index 530ffc6cf..07769064a 100644
--- a/src/input/librtsp/rtsp.c
+++ b/src/input/librtsp/rtsp.c
@@ -21,6 +21,10 @@
* *not* RFC 2326 compilant yet.
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
@@ -123,7 +127,7 @@ static char *rtsp_get(rtsp_t *s) {
static void rtsp_put(rtsp_t *s, const char *string) {
- int len=strlen(string);
+ size_t len=strlen(string);
char *buf = malloc(sizeof(char)*len+2);
lprintf(">> '%s'", string);
@@ -173,9 +177,7 @@ static void rtsp_send_request(rtsp_t *s, const char *type, const char *what) {
char **payload=s->scheduled;
char *buf;
- buf = malloc(strlen(type)+strlen(what)+strlen(rtsp_protocol_version)+3);
-
- sprintf(buf,"%s %s %s",type, what, rtsp_protocol_version);
+ asprintf(&buf,"%s %s %s",type, what, rtsp_protocol_version);
rtsp_put(s,buf);
free(buf);
if (payload)
@@ -200,8 +202,7 @@ static void rtsp_schedule_standard(rtsp_t *s) {
if (s->session) {
char *buf;
- buf = malloc(strlen(s->session)+15);
- sprintf(buf, "Session: %s", s->session);
+ asprintf(&buf, "Session: %s", s->session);
rtsp_schedule_field(s, buf);
free(buf);
}
@@ -232,38 +233,32 @@ static int rtsp_get_answers(rtsp_t *s) {
if (!answer)
return 0;
- if (!strncasecmp(answer,"Cseq:",5)) {
- sscanf(answer,"%*s %u",&answer_seq);
+ if (!strncasecmp(answer,"Cseq: ",6)) {
+ sscanf(answer+6,"%u",&answer_seq);
if (s->cseq != answer_seq) {
lprintf("warning: Cseq mismatch. got %u, assumed %u", answer_seq, s->cseq);
s->cseq=answer_seq;
}
}
- if (!strncasecmp(answer,"Server:",7)) {
- char *buf = xine_xmalloc(strlen(answer));
- sscanf(answer,"%*s %s",buf);
- if (s->server) free(s->server);
- s->server=strdup(buf);
- free(buf);
+ if (!strncasecmp(answer,"Server: ",8)) {
+ free(s->server);
+ s->server = strdup(answer + 8);
}
- if (!strncasecmp(answer,"Session:",8)) {
- char *buf = xine_xmalloc(strlen(answer));
- sscanf(answer,"%*s %s",buf);
+ if (!strncasecmp(answer,"Session: ",9)) {
+ char *tmp = answer + 9;
if (s->session) {
- if (strcmp(buf, s->session)) {
+ if (strcmp(tmp, s->session)) {
xprintf(s->stream->xine, XINE_VERBOSITY_DEBUG,
- "rtsp: warning: setting NEW session: %s\n", buf);
- free(s->session);
- s->session=strdup(buf);
+ "rtsp: warning: setting NEW session: %s\n", tmp);
+ s->session=strdup(tmp);
}
} else
{
lprintf("setting session id to: %s\n", buf);
- s->session=strdup(buf);
+ s->session=strdup(tmp);
}
- free(buf);
}
*answer_ptr=answer;
answer_ptr++;
@@ -304,8 +299,7 @@ int rtsp_request_options(rtsp_t *s, const char *what) {
buf=strdup(what);
} else
{
- buf = malloc(sizeof(char)*(strlen(s->host)+16));
- sprintf(buf,"rtsp://%s:%i", s->host, s->port);
+ asprintf(&buf,"rtsp://%s:%i", s->host, s->port);
}
rtsp_send_request(s,"OPTIONS",buf);
free(buf);
@@ -321,8 +315,7 @@ int rtsp_request_describe(rtsp_t *s, const char *what) {
buf=strdup(what);
} else
{
- buf = malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16));
- sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
+ asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
}
rtsp_send_request(s,"DESCRIBE",buf);
free(buf);
@@ -345,8 +338,7 @@ int rtsp_request_setparameter(rtsp_t *s, const char *what) {
buf=strdup(what);
} else
{
- buf = malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16));
- sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
+ asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
}
rtsp_send_request(s,"SET_PARAMETER",buf);
free(buf);
@@ -362,8 +354,7 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
buf=strdup(what);
} else
{
- buf = malloc(sizeof(char)*(strlen(s->host)+strlen(s->path)+16));
- sprintf(buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
+ asprintf(&buf,"rtsp://%s:%i/%s", s->host, s->port, s->path);
}
rtsp_send_request(s,"PLAY",buf);
free(buf);
@@ -412,8 +403,7 @@ int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) {
}
/* lets make the server happy */
rtsp_put(s, "RTSP/1.0 451 Parameter Not Understood");
- rest = malloc(sizeof(char)*17);
- sprintf(rest,"CSeq: %u", seq);
+ asprintf(&rest,"CSeq: %u", seq);
rtsp_put(s, rest);
free(rest);
rtsp_put(s, "");
@@ -486,9 +476,7 @@ rtsp_t *rtsp_connect(xine_stream_t *stream, const char *mrl, const char *user_ag
pathbegin=slash-mrl_ptr;
hostend=colon-mrl_ptr;
- s->host = malloc(sizeof(char)*hostend+1);
- strncpy(s->host, mrl_ptr, hostend);
- s->host[hostend]=0;
+ s->host = strndup(mrl_ptr, hostend);
if (pathbegin < strlen(mrl_ptr)) s->path=strdup(mrl_ptr+pathbegin+1);
if (colon != slash) {
diff --git a/src/input/librtsp/rtsp.h b/src/input/librtsp/rtsp.h
index dc2624459..2e1fd6aa0 100644
--- a/src/input/librtsp/rtsp.h
+++ b/src/input/librtsp/rtsp.h
@@ -40,7 +40,7 @@
typedef struct rtsp_s rtsp_t;
-rtsp_t* rtsp_connect (xine_stream_t *stream, const char *mrl, const char *user_agent);
+rtsp_t* rtsp_connect (xine_stream_t *stream, const char *mrl, const char *user_agent) XINE_MALLOC;
int rtsp_request_options(rtsp_t *s, const char *what);
int rtsp_request_describe(rtsp_t *s, const char *what);
diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c
index 5b02282e9..4e636410d 100644
--- a/src/input/librtsp/rtsp_session.c
+++ b/src/input/librtsp/rtsp_session.c
@@ -78,7 +78,7 @@ const char *rtsp_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)",
rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) {
- rtsp_session_t *rtsp_session = xine_xmalloc(sizeof(rtsp_session_t));
+ rtsp_session_t *rtsp_session = calloc(1, sizeof(rtsp_session_t));
xine_t *xine = stream->xine;
char *server;
char *mrl_line=strdup(mrl);
diff --git a/src/input/librtsp/rtsp_session.h b/src/input/librtsp/rtsp_session.h
index b47db0730..33ac579e1 100644
--- a/src/input/librtsp/rtsp_session.h
+++ b/src/input/librtsp/rtsp_session.h
@@ -25,7 +25,7 @@
typedef struct rtsp_session_s rtsp_session_t;
-rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl);
+rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) XINE_MALLOC;
void rtsp_session_set_start_time(rtsp_session_t *this, int start_time);
diff --git a/src/input/mms.c b/src/input/mms.c
index f11a89cf3..ab1983955 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -202,9 +202,9 @@ static void mms_buffer_put_64 (mms_buffer_t *mms_buffer, uint64_t value) {
}
+#ifdef LOG
static void print_command (char *data, int len) {
-#ifdef LOG
int i;
int dir = _X_LE_32 (data + 36) >> 16;
int comm = _X_LE_32 (data + 36) & 0xFFFF;
@@ -240,8 +240,10 @@ static void print_command (char *data, int len) {
if (len > CMD_HEADER_LEN)
printf ("\n");
printf ("----------------------------------------------\n");
+}
+#else
+# define print_command(data, len)
#endif
-}
@@ -678,7 +680,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) {
if (!url)
return NULL;
- this = (mms_t*) xine_xmalloc (sizeof (mms_t));
+ this = calloc(1, sizeof (mms_t));
this->stream = stream;
this->url = strdup (url);
@@ -769,12 +771,10 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) {
/* command 0x5 */
{
mms_buffer_t command_buffer;
- char *path;
- int pathlen;
+ char *path = this->uri;
+ size_t pathlen = strlen(path);
/* remove the first '/' */
- path = this->uri;
- pathlen = strlen(path);
if (pathlen > 1) {
path++;
pathlen--;
diff --git a/src/input/mmsh.c b/src/input/mmsh.c
index ae1c62bc1..4ee7ed07d 100644
--- a/src/input/mmsh.c
+++ b/src/input/mmsh.c
@@ -190,11 +190,9 @@ struct mmsh_s {
};
static int send_command (mmsh_t *this, char *cmd) {
- int length;
-
lprintf ("send_command:\n%s\n", cmd);
- length = strlen(cmd);
+ const size_t length = strlen(cmd);
if (_x_io_tcp_write(this->stream, this->s, cmd, length) != length) {
xprintf (this->stream->xine, XINE_LOG_MSG, _("libmmsh: send error\n"));
return 0;
@@ -636,7 +634,7 @@ mmsh_t *mmsh_connect (xine_stream_t *stream, const char *url, int bandwidth) {
report_progress (stream, 0);
- this = (mmsh_t*) xine_xmalloc (sizeof (mmsh_t));
+ this = calloc(1, sizeof (mmsh_t));
this->stream = stream;
this->url = strdup(url);
diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c
index 624af4081..e27ed99f3 100644
--- a/src/input/net_buf_ctrl.c
+++ b/src/input/net_buf_ctrl.c
@@ -118,8 +118,8 @@ void nbc_check_buffers (nbc_t *this) {
}
static void display_stats (nbc_t *this) {
- const char *buffering[2] = {" ", "buf"};
- const char *enabled[2] = {"off", "on "};
+ const char buffering[2][4] = {" ", "buf"};
+ const char enabled[2][4] = {"off", "on "};
printf("bufing: %d, enb: %d\n", this->buffering, this->enabled);
printf("net_buf_ctrl: vid %3d%% %4.1fs %4" PRId64 "kbps %1d, "\
@@ -496,7 +496,7 @@ static void nbc_get_cb (fifo_buffer_t *fifo,
nbc_t *nbc_init (xine_stream_t *stream) {
- nbc_t *this = (nbc_t *) xine_xmalloc (sizeof (nbc_t));
+ nbc_t *this = calloc(1, sizeof (nbc_t));
fifo_buffer_t *video_fifo = stream->video_fifo;
fifo_buffer_t *audio_fifo = stream->audio_fifo;
double video_fifo_factor, audio_fifo_factor;
diff --git a/src/input/net_buf_ctrl.h b/src/input/net_buf_ctrl.h
index 9229144f8..7dfb7b0d1 100644
--- a/src/input/net_buf_ctrl.h
+++ b/src/input/net_buf_ctrl.h
@@ -27,7 +27,7 @@
typedef struct nbc_s nbc_t;
-nbc_t *nbc_init (xine_stream_t *xine);
+nbc_t *nbc_init (xine_stream_t *xine) XINE_MALLOC;
void nbc_check_buffers (nbc_t *this) XINE_DEPRECATED;
diff --git a/src/input/pnm.c b/src/input/pnm.c
index 38d65b850..cbd245e7b 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -21,6 +21,10 @@
* based upon code from joschka
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
@@ -90,7 +94,7 @@ struct pnm_s {
/* header of rm files */
#define RM_HEADER_SIZE 0x12
-const unsigned char rm_header[]={
+static const unsigned char rm_header[]={
0x2e, 0x52, 0x4d, 0x46, /* object_id ".RMF" */
0x00, 0x00, 0x00, 0x12, /* header_size 0x12 */
0x00, 0x00, /* object_version 0x00 */
@@ -100,7 +104,7 @@ const unsigned char rm_header[]={
/* data chunk header */
#define PNM_DATA_HEADER_SIZE 18
-const unsigned char pnm_data_header[]={
+static const unsigned char pnm_data_header[]={
'D','A','T','A',
0,0,0,0, /* data chunk size */
0,0, /* object version */
@@ -411,8 +415,8 @@ static void pnm_send_request(pnm_t *p, uint32_t bandwidth) {
*/
static void pnm_send_response(pnm_t *p, const char *response) {
-
- int size=strlen(response);
+ /** @TODO should check that sze is always < 256 */
+ size_t size=strlen(response);
p->buffer[0]=0x23;
p->buffer[1]=0;
@@ -627,10 +631,7 @@ static int pnm_get_stream_chunk(pnm_t *p) {
*/
n=0;
while (p->buffer[0] != 0x5a) {
- int i;
- for (i=1; i<8; i++) {
- p->buffer[i-1]=p->buffer[i];
- }
+ memmove(p->buffer, &p->buffer[1], 8);
_x_io_tcp_read (p->stream, p->s, &p->buffer[7], 1);
n++;
}
@@ -716,7 +717,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) {
mrl_ptr+=6;
- p = xine_xmalloc(sizeof(pnm_t));
+ p = calloc(1, sizeof(pnm_t));
p->stream = stream;
p->port=7070;
p->url=strdup(mrl);
@@ -732,9 +733,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) {
pathbegin=slash-mrl_ptr;
hostend=colon-mrl_ptr;
- p->host = malloc(sizeof(char)*hostend+1);
- strncpy(p->host, mrl_ptr, hostend);
- p->host[hostend]=0;
+ p->host = strndup(mrl_ptr, hostend);
if (pathbegin < strlen(mrl_ptr)) p->path=strdup(mrl_ptr+pathbegin+1);
if (colon != slash) {
diff --git a/src/input/vcd/xine-extra.c b/src/input/vcd/xine-extra.c
index 79c962a79..e3b6da912 100644
--- a/src/input/vcd/xine-extra.c
+++ b/src/input/vcd/xine-extra.c
@@ -45,8 +45,10 @@ static xine_t *my_xine = NULL;
void
xine_vlog_msg(xine_t *this, int buf, const char *format, va_list args)
{
+ va_list copy;
+ va_copy (copy, args);
xine_vlog(this, buf, format, args);
- vfprintf(stdout, format, args);
+ vfprintf(stdout, format, copy);
}
/*! This routine is like xine_log, except it takes a va_list instead
@@ -59,8 +61,10 @@ xine_vlog_msg(xine_t *this, int buf, const char *format, va_list args)
void
xine_vlog_err(xine_t *this, int buf, const char *format, va_list args)
{
+ va_list copy;
+ va_copy (copy, args);
xine_vlog(this, buf, format, args);
- vfprintf(stderr, format, args);
+ vfprintf(stderr, format, copy);
}
/*! Call this before calling any of the xine_log_msg or xine_log_err
@@ -116,8 +120,8 @@ xine_log_err(const char *format, ...)
{
va_list args;
- va_start(args, format);
if (NULL == my_xine) return false;
+ va_start(args, format);
xine_vlog_err(my_xine, XINE_LOG_MSG, format, args);
va_end(args);
return true;
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 2e52ccc0f..f4f823918 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -272,11 +272,9 @@ vcd_add_mrl_slot(vcd_input_class_t *this, const char *mrl, off_t size,
this->mrls[*i]->type = mrl_vcd;
this->mrls[*i]->size = size * M2F2_SECTOR_SIZE;
- this->mrls[*i]->mrl = (char *) malloc(strlen(mrl) + 1);
+ this->mrls[*i]->mrl = strdup(mrl);
if (NULL==this->mrls[*i]->mrl) {
LOG_ERR("Can't malloc %zu bytes for MRL name %s", sizeof(xine_mrl_t), mrl);
- } else {
- sprintf(this->mrls[*i]->mrl, "%s", mrl);
}
(*i)++;
}
@@ -1767,7 +1765,7 @@ vcd_init (xine_t *xine, void *data)
dbg_print(INPUT_DBG_CALL, "Called\n");
- class = (vcd_input_class_t *) xine_xmalloc (sizeof (vcd_input_class_t));
+ class = calloc(1, sizeof (vcd_input_class_t));
class->xine = xine;
class->config = config = xine->config;
diff --git a/src/liba52/parse.c b/src/liba52/parse.c
index 0bfd02fce..f1adc2f40 100644
--- a/src/liba52/parse.c
+++ b/src/liba52/parse.c
@@ -49,7 +49,7 @@ a52_state_t * a52_init (uint32_t mm_accel)
a52_state_t * state;
int i;
- state = xine_xmalloc (sizeof (a52_state_t));
+ state = calloc(1, sizeof (a52_state_t));
if (state == NULL)
return NULL;
diff --git a/src/liba52/xine_a52_decoder.c b/src/liba52/xine_a52_decoder.c
index b8b500ecd..0f9ed3ad5 100644
--- a/src/liba52/xine_a52_decoder.c
+++ b/src/liba52/xine_a52_decoder.c
@@ -654,7 +654,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
lprintf ("open_plugin called\n");
- this = (a52dec_decoder_t *) xine_xmalloc (sizeof (a52dec_decoder_t));
+ this = calloc(1, sizeof (a52dec_decoder_t));
this->audio_decoder.decode_data = a52dec_decode_data;
this->audio_decoder.reset = a52dec_reset;
@@ -806,7 +806,7 @@ static void *init_plugin (xine_t *xine, void *data) {
a52dec_class_t *this;
config_values_t *cfg;
- this = (a52dec_class_t *) xine_xmalloc (sizeof (a52dec_class_t));
+ this = calloc(1, sizeof (a52dec_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libdts/xine_dts_decoder.c b/src/libdts/xine_dts_decoder.c
index 2b5bedb83..669ae85da 100644
--- a/src/libdts/xine_dts_decoder.c
+++ b/src/libdts/xine_dts_decoder.c
@@ -489,7 +489,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
lprintf("open_plugin\n");
- this = (dts_decoder_t *) xine_xmalloc (sizeof (dts_decoder_t));
+ this = calloc(1, sizeof (dts_decoder_t));
this->audio_decoder.decode_data = dts_decode_data;
this->audio_decoder.reset = dts_reset;
@@ -598,7 +598,7 @@ static void *init_plugin (xine_t *xine, void *data) {
lprintf("init_plugin\n");
- this = (dts_class_t *) xine_xmalloc (sizeof (dts_class_t));
+ this = calloc(1, sizeof (dts_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libfaad/xine_faad_decoder.c b/src/libfaad/xine_faad_decoder.c
index 934140a32..6f86d95fd 100644
--- a/src/libfaad/xine_faad_decoder.c
+++ b/src/libfaad/xine_faad_decoder.c
@@ -320,7 +320,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
if( !this->faac_dec && (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG ) {
- this->dec_config = xine_xmalloc(buf->decoder_info[2]);
+ this->dec_config = malloc(buf->decoder_info[2]);
this->dec_config_size = buf->decoder_info[2];
memcpy(this->dec_config, buf->decoder_info_ptr[2], buf->decoder_info[2]);
@@ -341,7 +341,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
xine_waveformatex *wavex = (xine_waveformatex *) buf->content;
if( wavex->cbSize > 0 ) {
- this->dec_config = xine_xmalloc(wavex->cbSize);
+ this->dec_config = malloc(wavex->cbSize);
this->dec_config_size = wavex->cbSize;
memcpy(this->dec_config, buf->content + sizeof(xine_waveformatex),
wavex->cbSize);
@@ -417,7 +417,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
faad_decoder_t *this ;
- this = (faad_decoder_t *) xine_xmalloc (sizeof (faad_decoder_t));
+ this = calloc(1, sizeof (faad_decoder_t));
this->audio_decoder.decode_data = faad_decode_data;
this->audio_decoder.reset = faad_reset;
@@ -458,7 +458,7 @@ static void *init_plugin (xine_t *xine, void *data) {
faad_class_t *this ;
- this = (faad_class_t *) xine_xmalloc (sizeof (faad_class_t));
+ this = calloc(1, sizeof (faad_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libmad/xine_mad_decoder.c b/src/libmad/xine_mad_decoder.c
index 021814ca9..31b313818 100644
--- a/src/libmad/xine_mad_decoder.c
+++ b/src/libmad/xine_mad_decoder.c
@@ -346,7 +346,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
mad_decoder_t *this ;
- this = (mad_decoder_t *) xine_xmalloc (sizeof (mad_decoder_t));
+ this = (mad_decoder_t *) calloc(1, sizeof(mad_decoder_t));
this->audio_decoder.decode_data = mad_decode_data;
this->audio_decoder.reset = mad_reset;
@@ -390,7 +390,7 @@ static void *init_plugin (xine_t *xine, void *data) {
mad_class_t *this;
- this = (mad_class_t *) xine_xmalloc (sizeof (mad_class_t));
+ this = (mad_class_t *) calloc(1, sizeof(mad_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libmpeg2/xine_mpeg2_decoder.c b/src/libmpeg2/xine_mpeg2_decoder.c
index 4c4cc8654..123374a08 100644
--- a/src/libmpeg2/xine_mpeg2_decoder.c
+++ b/src/libmpeg2/xine_mpeg2_decoder.c
@@ -117,7 +117,7 @@ static void mpeg2dec_dispose (video_decoder_t *this_gen) {
static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
mpeg2dec_decoder_t *this ;
- this = (mpeg2dec_decoder_t *) xine_xmalloc (sizeof (mpeg2dec_decoder_t));
+ this = (mpeg2dec_decoder_t *) calloc(1, sizeof(mpeg2dec_decoder_t));
this->video_decoder.decode_data = mpeg2dec_decode_data;
this->video_decoder.flush = mpeg2dec_flush;
@@ -155,7 +155,7 @@ static void *init_plugin (xine_t *xine, void *data) {
mpeg2_class_t *this;
- this = (mpeg2_class_t *) xine_xmalloc (sizeof (mpeg2_class_t));
+ this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libmpeg2new/xine_mpeg2new_decoder.c b/src/libmpeg2new/xine_mpeg2new_decoder.c
index 7ceac9178..c096ccfa7 100644
--- a/src/libmpeg2new/xine_mpeg2new_decoder.c
+++ b/src/libmpeg2new/xine_mpeg2new_decoder.c
@@ -449,7 +449,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
mpeg2_video_decoder_t *this ;
int32_t n;
- this = (mpeg2_video_decoder_t *) xine_xmalloc (sizeof (mpeg2_video_decoder_t));
+ this = (mpeg2_video_decoder_t *) calloc(1, sizeof(mpeg2_video_decoder_t));
this->video_decoder.decode_data = mpeg2_video_decode_data;
this->video_decoder.flush = mpeg2_video_flush;
@@ -490,7 +490,7 @@ static void *init_plugin (xine_t *xine, void *data) {
mpeg2_class_t *this;
- this = (mpeg2_class_t *) xine_xmalloc (sizeof (mpeg2_class_t));
+ this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libmusepack/xine_musepack_decoder.c b/src/libmusepack/xine_musepack_decoder.c
index 7a2d30a06..115532e86 100644
--- a/src/libmusepack/xine_musepack_decoder.c
+++ b/src/libmusepack/xine_musepack_decoder.c
@@ -214,7 +214,7 @@ static void mpc_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->file_size = buf->decoder_info[0];
/* Initialise the data accumulation buffer */
- this->buf = xine_xmalloc(INIT_BUFSIZE);
+ this->buf = calloc(1, INIT_BUFSIZE);
this->buf_max = INIT_BUFSIZE;
this->read = 0;
this->size = 0;
@@ -396,7 +396,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
mpc_decoder_t *this ;
- this = (mpc_decoder_t *) xine_xmalloc (sizeof (mpc_decoder_t));
+ this = (mpc_decoder_t *) calloc(1, sizeof(mpc_decoder_t));
/* connect the member functions */
this->audio_decoder.decode_data = mpc_decode_data;
@@ -441,7 +441,7 @@ static void *init_plugin (xine_t *xine, void *data) {
mpc_class_t *this ;
- this = (mpc_class_t *) xine_xmalloc (sizeof (mpc_class_t));
+ this = (mpc_class_t *) calloc(1, sizeof(mpc_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c
index ed3159a84..7f4942cc5 100644
--- a/src/libreal/xine_real_audio_decoder.c
+++ b/src/libreal/xine_real_audio_decoder.c
@@ -310,14 +310,14 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
if (this->sps) {
this->frame_size = this->w/this->sps*this->h*this->sps;
- this->frame_buffer = xine_xmalloc (this->frame_size);
- this->frame_reordered = xine_xmalloc (this->frame_size);
+ this->frame_buffer = calloc (1, this->frame_size);
+ this->frame_reordered = calloc (1, this->frame_size);
this->frame_num_bytes = 0;
} else {
this->frame_size = this->w*this->h;
- this->frame_buffer = xine_xmalloc (this->frame_size);
+ this->frame_buffer = calloc (this->w, this->h);
this->frame_reordered = this->frame_buffer;
this->frame_num_bytes = 0;
@@ -477,7 +477,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
real_class_t *cls = (real_class_t *) class_gen;
realdec_decoder_t *this ;
- this = (realdec_decoder_t *) xine_xmalloc (sizeof (realdec_decoder_t));
+ this = (realdec_decoder_t *) calloc(1, sizeof(realdec_decoder_t));
this->audio_decoder.decode_data = realdec_decode_data;
this->audio_decoder.reset = realdec_reset;
@@ -512,7 +512,7 @@ void *init_realadec (xine_t *xine, void *data) {
real_class_t *this;
config_values_t *config = xine->config;
- this = (real_class_t *) xine_xmalloc (sizeof (real_class_t));
+ this = (real_class_t *) calloc(1, sizeof(real_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c
index cb7794cca..e048b04d6 100644
--- a/src/libreal/xine_real_video_decoder.c
+++ b/src/libreal/xine_real_video_decoder.c
@@ -278,7 +278,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) {
this->frame_size = this->width * this->height;
this->frame_buffer = xine_xmalloc (this->width * this->height * 3 / 2);
- this->chunk_buffer = xine_xmalloc (BUF_SIZE);
+ this->chunk_buffer = calloc(1, BUF_SIZE);
this->chunk_buffer_max = BUF_SIZE;
return 1;
@@ -496,7 +496,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
real_class_t *cls = (real_class_t *) class_gen;
realdec_decoder_t *this ;
- this = (realdec_decoder_t *) xine_xmalloc (sizeof (realdec_decoder_t));
+ this = (realdec_decoder_t *) calloc(1, sizeof(realdec_decoder_t));
this->video_decoder.decode_data = realdec_decode_data;
this->video_decoder.flush = realdec_flush;
@@ -535,7 +535,7 @@ void *init_realvdec (xine_t *xine, void *data) {
real_class_t *this;
config_values_t *config = xine->config;
- this = (real_class_t *) xine_xmalloc (sizeof (real_class_t));
+ this = (real_class_t *) calloc(1, sizeof(real_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c
index 8d666e847..67767c61a 100644
--- a/src/libspucc/cc_decoder.c
+++ b/src/libspucc/cc_decoder.c
@@ -216,8 +216,6 @@ static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = {
#define TRANSP_SPACE 0x19 /* code for transparent space, essentially
arbitrary */
-#define MAX(a, b) ((a) > (b)? (a) : (b))
-
/* mapping from PAC row code to actual CC row */
static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6,
7, 8, 9};
@@ -922,7 +920,7 @@ cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
metronom_t *metronom, cc_state_t *cc_state,
int video_width, int video_height)
{
- cc_renderer_t *this = (cc_renderer_t *) xine_xmalloc(sizeof (cc_renderer_t));
+ cc_renderer_t *this = calloc(1, sizeof (cc_renderer_t));
this->osd_renderer = osd_renderer;
this->metronom = metronom;
@@ -1439,7 +1437,7 @@ void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
cc_decoder_t *cc_decoder_open(cc_state_t *cc_state)
{
- cc_decoder_t *this = (cc_decoder_t *) xine_xmalloc(sizeof (cc_decoder_t));
+ cc_decoder_t *this = calloc(1, sizeof (cc_decoder_t));
/* configfile stuff */
this->cc_state = cc_state;
diff --git a/src/libspucc/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c
index 9cdb4c4ea..0018bfa1e 100644
--- a/src/libspucc/xine_cc_decoder.c
+++ b/src/libspucc/xine_cc_decoder.c
@@ -301,7 +301,7 @@ static spu_decoder_t *spudec_open_plugin (spu_decoder_class_t *class, xine_strea
spucc_decoder_t *this ;
- this = (spucc_decoder_t *) xine_xmalloc (sizeof (spucc_decoder_t));
+ this = (spucc_decoder_t *) calloc(1, sizeof(spucc_decoder_t));
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
@@ -338,7 +338,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
spucc_class_t *this ;
- this = (spucc_class_t *) xine_xmalloc (sizeof (spucc_class_t));
+ this = (spucc_class_t *) calloc(1, sizeof(spucc_class_t));
this->spu_class.open_plugin = spudec_open_plugin;
this->spu_class.get_identifier = spudec_get_identifier;
diff --git a/src/libspucmml/xine_cmml_decoder.c b/src/libspucmml/xine_cmml_decoder.c
index b684d21cb..206d8c567 100644
--- a/src/libspucmml/xine_cmml_decoder.c
+++ b/src/libspucmml/xine_cmml_decoder.c
@@ -268,36 +268,30 @@ static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
for (title_node = packet_xml_root->child; title_node != NULL; title_node = title_node->next) {
- if (strcasecmp (title_node->name, "title") == 0) {
+ if (title_node->data &&
+ strcasecmp (title_node->name, "title") == 0) {
/* found a title node */
- xine_event_t uevent;
- char *title;
- int title_len;
-
- title = title_node->data;
-
- if (title)
- {
- xine_ui_data_t data;
- /* found a non-empty title */
- lprintf ("found title: \"%s\"\n", title);
-
- /* set xine meta-info */
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, strdup(title));
-
- /* and push out a new event signifying the title update on the event
- * queue */
- title_len = strlen(title) + 1;
- memcpy(data.str, title, title_len);
- data.str_len = title_len;
-
- uevent.type = XINE_EVENT_UI_SET_TITLE;
- uevent.stream = this->stream;
- uevent.data = &data;
- uevent.data_length = sizeof(data);
- xine_event_send(this->stream, &uevent);
- }
+ xine_ui_data_t data = {
+ .str_len = strlen(title_node->data) + 1
+ };
+ xine_event_t uevent = {
+ .type = XINE_EVENT_UI_SET_TITLE,
+ .stream = this->stream,
+ .data = &data,
+ .data_length = sizeof(data),
+ };
+ strncpy(data.str, title_node->data, sizeof(data.str)-1);
+
+ /* found a non-empty title */
+ lprintf ("found title: \"%s\"\n", data.str);
+
+ /* set xine meta-info */
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, strdup(data.str));
+
+ /* and push out a new event signifying the title update on the event
+ * queue */
+ xine_event_send(this->stream, &uevent);
}
}
} else if (strcasecmp(packet_xml_root->name, "clip") == 0) {
@@ -450,7 +444,7 @@ static spu_decoder_t *spucmml_class_open_plugin (spu_decoder_class_t *class_gen,
spucmml_class_t *class = (spucmml_class_t *)class_gen;
spucmml_decoder_t *this ;
- this = (spucmml_decoder_t *) xine_xmalloc (sizeof (spucmml_decoder_t));
+ this = (spucmml_decoder_t *) calloc(1, sizeof(spucmml_decoder_t));
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
@@ -514,7 +508,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
spucmml_class_t *this ;
- this = (spucmml_class_t *) xine_xmalloc (sizeof (spucmml_class_t));
+ this = (spucmml_class_t *) calloc(1, sizeof(spucmml_class_t));
this->class.open_plugin = spucmml_class_open_plugin;
this->class.get_identifier = spucmml_class_get_identifier;
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
index ce3497ef0..b41387dfb 100644
--- a/src/libspudec/spu.c
+++ b/src/libspudec/spu.c
@@ -209,7 +209,7 @@ void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) {
#endif
/* append PCI at the end of the list */
while (node->next) node = node->next;
- node->next = (pci_node_t *)xine_xmalloc(sizeof(pci_node_t));
+ node->next = malloc(sizeof(pci_node_t));
node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm);
node->next->next = NULL;
xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t));
diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c
index 0ab91d906..c604686e9 100644
--- a/src/libspudec/xine_spu_decoder.c
+++ b/src/libspudec/xine_spu_decoder.c
@@ -227,9 +227,9 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t
video_overlay_manager_t *ovl_manager;
video_overlay_event_t *overlay_event = NULL;
vo_overlay_t *overlay = NULL;
- overlay_event = xine_xmalloc (sizeof(video_overlay_event_t));
+ overlay_event = calloc(1, sizeof(video_overlay_event_t));
- overlay = xine_xmalloc (sizeof(vo_overlay_t));
+ overlay = calloc(1, sizeof(vo_overlay_t));
/* FIXME: Watch out for threads. We should really put a lock on this
* because events is a different thread than decode_data */
@@ -315,7 +315,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t
spudec_decoder_t *this ;
int i;
- this = (spudec_decoder_t *) xine_xmalloc (sizeof (spudec_decoder_t));
+ this = (spudec_decoder_t *) calloc(1, sizeof (spudec_decoder_t));
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
@@ -328,7 +328,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t
this->menu_handle = -1;
this->buttonN = 1;
- this->event.object.overlay = xine_xmalloc(sizeof(vo_overlay_t));
+ this->event.object.overlay = calloc(1, sizeof(vo_overlay_t));
pthread_mutex_init(&this->nav_pci_lock, NULL);
this->pci_cur.pci.hli.hl_gi.hli_ss = 0;
@@ -376,7 +376,7 @@ static void *init_plugin (xine_t *xine, void *data) {
spudec_class_t *this;
- this = (spudec_class_t *) xine_xmalloc (sizeof (spudec_class_t));
+ this = calloc(1, sizeof (spudec_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c
index 602723fcb..40d2a205a 100644
--- a/src/libspudvb/xine_spudvb_decoder.c
+++ b/src/libspudvb/xine_spudvb_decoder.c
@@ -907,7 +907,7 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen
dvb_spu_decoder_t *this;
dvb_spu_class_t *class = (dvb_spu_class_t *) class_gen;
- this = (dvb_spu_decoder_t *) xine_xmalloc (sizeof (dvb_spu_decoder_t));
+ this = calloc(1, sizeof (dvb_spu_decoder_t));
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
@@ -919,10 +919,10 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen
this->class = class;
this->stream = stream;
- this->pes_pkt = xine_xmalloc (1024*65);
- this->spu_descriptor = xine_xmalloc(sizeof(spu_dvb_descriptor_t));
+ this->pes_pkt = calloc(65, 1024);
+ this->spu_descriptor = calloc(1, sizeof(spu_dvb_descriptor_t));
- this->dvbsub = xine_xmalloc (sizeof (dvbsub_func_t));
+ this->dvbsub = calloc(1, sizeof (dvbsub_func_t));
for (i = 0; i < MAX_REGIONS; i++) {
this->dvbsub->page.regions[i].is_visible = 0;
@@ -959,7 +959,7 @@ static void *init_spu_decoder_plugin (xine_t * xine, void *data)
{
dvb_spu_class_t *this;
- this = (dvb_spu_class_t *) xine_xmalloc (sizeof (dvb_spu_class_t));
+ this = calloc(1, sizeof (dvb_spu_class_t));
this->class.open_plugin = dvb_spu_class_open_plugin;
this->class.get_identifier = dvb_spu_class_get_identifier;
diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c
index c80e2b496..741d0612b 100644
--- a/src/libsputext/demux_sputext.c
+++ b/src/libsputext/demux_sputext.c
@@ -129,7 +129,6 @@ static int eol(char p) {
}
static inline void trail_space(char *s) {
- int i;
while (isspace(*s)) {
char *copy = s;
do {
@@ -137,7 +136,7 @@ static inline void trail_space(char *s) {
copy++;
} while(*copy);
}
- i = strlen(s) - 1;
+ size_t i = strlen(s) - 1;
while (i > 0 && isspace(s[i]))
s[i--] = '\0';
}
@@ -262,12 +261,7 @@ static char *sub_readtext(char *source, char **dest) {
p++,len++;
}
- *dest= (char *)xine_xmalloc (len+1);
- if (!(*dest))
- return ERR;
-
- strncpy(*dest, source, len);
- (*dest)[len]=0;
+ *dest = strndup(source, len);
while (*p=='\r' || *p=='\n' || *p=='|')
p++;
@@ -333,10 +327,8 @@ static subtitle_t *sub_read_line_subviewer(demux_sputext_t *this, subtitle_t *cu
p=q=line;
for (current->lines=1; current->lines <= SUB_MAX_TEXT; current->lines++) {
for (q=p,len=0; *p && *p!='\r' && *p!='\n' && *p!='|' && strncasecmp(p,"[br]",4); p++,len++);
- current->text[current->lines-1]=(char *)xine_xmalloc (len+1);
+ current->text[current->lines-1] = strndup(q, len);
if (!current->text[current->lines-1]) return ERR;
- strncpy (current->text[current->lines-1], q, len);
- current->text[current->lines-1][len]='\0';
if (!*p || *p=='\r' || *p=='\n') break;
if (*p=='[') while (*p++!=']');
if (*p=='|') p++;
@@ -396,10 +388,10 @@ static subtitle_t *sub_read_line_subrip(demux_sputext_t *this,subtitle_t *curren
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many characters in a subtitle line\n");
if(temp_line[temp_index-1]=='\0' || temp_index==SUB_BUFSIZE) {
if(temp_index>1) { /* more than 1 char (including '\0') -> that is a valid one */
- current->text[i]=(char *)xine_xmalloc(temp_index);
+ /* temp_index<=SUB_BUFSIZE is always true here */
+ current->text[i] = strndup(temp_line, temp_index);
if(!current->text[i])
return ERR;
- strncpy(current->text[i],temp_line,temp_index); /* temp_index<=SUB_BUFSIZE is always true here */
i++;
temp_index=0;
} else
@@ -565,9 +557,7 @@ static subtitle_t *sub_read_line_ssa(demux_sputext_t *this,subtitle_t *current)
current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
while (((tmp=strstr(line2, "\\n")) != NULL) || ((tmp=strstr(line2, "\\N")) != NULL) ){
- current->text[num]=(char *)malloc(tmp-line2+1);
- strncpy (current->text[num], line2, tmp-line2);
- current->text[num][tmp-line2]='\0';
+ current->text[num] = strndup(line2, tmp-line2);
line2=tmp+2;
num++;
current->lines++;
@@ -802,26 +792,19 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur
++p;
}
if (isalpha(*p)||*p == '[') {
- int cont, jLength;
-
if (sscanf(p, "%s %" LINE_LEN_QUOT "[^\n\r]", directive, line1) < 2)
return ERR;
- jLength = strlen(directive);
- for (cont = 0; cont < jLength; ++cont) {
- if (isalpha(*(directive + cont)))
- *(directive + cont) = toupper(*(directive + cont));
- }
- if ((strstr(directive, "RDB") != NULL)
- || (strstr(directive, "RDC") != NULL)
- || (strstr(directive, "RLB") != NULL)
- || (strstr(directive, "RLG") != NULL)) {
+ if ((strcasestr(directive, "RDB") != NULL)
+ || (strcasestr(directive, "RDC") != NULL)
+ || (strcasestr(directive, "RLB") != NULL)
+ || (strcasestr(directive, "RLG") != NULL)) {
continue;
}
/* no alignment */
#if 0
- if (strstr(directive, "JL") != NULL) {
+ if (strcasestr(directive, "JL") != NULL) {
current->alignment = SUB_ALIGNMENT_HLEFT;
- } else if (strstr(directive, "JR") != NULL) {
+ } else if (strcasestr(directive, "JR") != NULL) {
current->alignment = SUB_ALIGNMENT_HRIGHT;
} else {
current->alignment = SUB_ALIGNMENT_HCENTER;
@@ -930,10 +913,9 @@ static subtitle_t *sub_read_line_subviewer2(demux_sputext_t *this, subtitle_t *c
len=0;
for (p=line; *p!='\n' && *p!='\r' && *p; ++p,++len);
if (len) {
- current->text[i]=(char *)malloc (len+1);
- if (!current->text[i]) return ERR;
- strncpy (current->text[i], line, len); current->text[i][len]='\0';
- ++i;
+ current->text[i] = strndup(line, len);
+ if (!current->text[i]) return ERR;
+ ++i;
} else {
break;
}
@@ -1165,7 +1147,7 @@ static subtitle_t *sub_read_file (demux_sputext_t *this) {
this->buflen = 0;
this->num=0;n_max=32;
- first = (subtitle_t *) xine_xmalloc(n_max*sizeof(subtitle_t));
+ first = calloc(n_max, sizeof(subtitle_t));
if(!first) return NULL;
timeout = ((demux_sputext_class_t *)
(this->demux_plugin.demux_class))->max_timeout;
@@ -1250,9 +1232,8 @@ static int demux_sputext_next (demux_sputext_t *this_gen) {
*val++ = (this->uses_time) ? sub->end * 10 : sub->end;
str = (char *)val;
for (line = 0; line < sub->lines; line++, str+=strlen(str)+1) {
- if( strlen(sub->text[line]) > SUB_BUFSIZE )
- sub->text[line][SUB_BUFSIZE] = '\0';
- strcpy(str, sub->text[line]);
+ strncpy(str, sub->text[line], SUB_BUFSIZE-1);
+ str[SUB_BUFSIZE-1] = '\0';
}
this->stream->video_fifo->put(this->stream->video_fifo, buf);
@@ -1363,7 +1344,7 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_
lprintf("open_plugin() called\n");
- this = xine_xmalloc (sizeof (demux_sputext_t));
+ this = calloc(1, sizeof (demux_sputext_t));
this->stream = stream;
this->input = input;
@@ -1465,7 +1446,7 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) {
lprintf("initializing\n");
- this = xine_xmalloc (sizeof (demux_sputext_class_t));
+ this = calloc(1, sizeof (demux_sputext_class_t));
this->demux_class.open_plugin = open_demux_plugin;
this->demux_class.get_description = get_demux_description;
diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c
index d0cab9cbf..55082476f 100644
--- a/src/libsputext/xine_sputext_decoder.c
+++ b/src/libsputext/xine_sputext_decoder.c
@@ -643,7 +643,7 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
buf[0] = 0;
for(line = 0; line < this->lines; line++) {
- int len = strlen(buf);
+ size_t len = strlen(buf);
if (len) {
buf[len] = ' ';
len++;
@@ -1081,7 +1081,7 @@ static spu_decoder_t *sputext_class_open_plugin (spu_decoder_class_t *class_gen,
sputext_class_t *class = (sputext_class_t *)class_gen;
sputext_decoder_t *this ;
- this = (sputext_decoder_t *) xine_xmalloc (sizeof (sputext_decoder_t));
+ this = (sputext_decoder_t *) calloc(1, sizeof(sputext_decoder_t));
this->spu_decoder.decode_data = spudec_decode_data;
this->spu_decoder.reset = spudec_reset;
@@ -1135,7 +1135,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
lprintf("init class\n");
- this = (sputext_class_t *) xine_xmalloc (sizeof (sputext_class_t));
+ this = (sputext_class_t *) calloc(1, sizeof(sputext_class_t));
this->class.open_plugin = sputext_class_open_plugin;
this->class.get_identifier = sputext_class_get_identifier;
diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c
index 3053b2b68..99e2ba9d4 100644
--- a/src/libw32dll/qt_decoder.c
+++ b/src/libw32dll/qt_decoder.c
@@ -553,7 +553,7 @@ static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen,
qta_decoder_t *this ;
- this = (qta_decoder_t *) xine_xmalloc (sizeof (qta_decoder_t));
+ this = (qta_decoder_t *) calloc(1, sizeof(qta_decoder_t));
this->audio_decoder.decode_data = qta_decode_data;
this->audio_decoder.reset = qta_reset;
@@ -592,7 +592,7 @@ static void *qta_init_class (xine_t *xine, void *data) {
pthread_once (&once_control, init_routine);
- this = (qta_class_t *) xine_xmalloc (sizeof (qta_class_t));
+ this = (qta_class_t *) calloc(1, sizeof(qta_class_t));
this->decoder_class.open_plugin = qta_open_plugin;
this->decoder_class.get_identifier = qta_get_identifier;
@@ -1063,7 +1063,7 @@ static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen,
qtv_class_t *cls = (qtv_class_t *) class_gen;
qtv_decoder_t *this ;
- this = (qtv_decoder_t *) xine_xmalloc (sizeof (qtv_decoder_t));
+ this = (qtv_decoder_t *) calloc(1, sizeof(qtv_decoder_t));
this->video_decoder.decode_data = qtv_decode_data;
this->video_decoder.flush = qtv_flush;
@@ -1116,7 +1116,7 @@ static void *qtv_init_class (xine_t *xine, void *data) {
pthread_once (&once_control, init_routine);
- this = (qtv_class_t *) xine_xmalloc (sizeof (qtv_class_t));
+ this = (qtv_class_t *) calloc(1, sizeof(qtv_class_t));
this->decoder_class.open_plugin = qtv_open_plugin;
this->decoder_class.get_identifier = qtv_get_identifier;
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 88790ebc7..64d29aeac 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.c
@@ -1550,7 +1550,7 @@ static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_
w32v_decoder_t *this ;
- this = (w32v_decoder_t *) xine_xmalloc (sizeof (w32v_decoder_t));
+ this = (w32v_decoder_t *) calloc(1, sizeof(w32v_decoder_t));
this->video_decoder.decode_data = w32v_decode_data;
this->video_decoder.flush = w32v_flush;
@@ -1593,7 +1593,7 @@ static void *init_video_decoder_class (xine_t *xine, void *data) {
cfg = xine->config;
if ((win32_def_path = get_win32_codecs_path(cfg)) == NULL) return NULL;
- this = (w32v_class_t *) xine_xmalloc (sizeof (w32v_class_t));
+ this = (w32v_class_t *) calloc(1, sizeof(w32v_class_t));
this->decoder_class.open_plugin = open_video_decoder_plugin;
this->decoder_class.get_identifier = get_video_identifier;
@@ -1614,7 +1614,7 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_
w32a_decoder_t *this ;
- this = (w32a_decoder_t *) xine_xmalloc (sizeof (w32a_decoder_t));
+ this = (w32a_decoder_t *) calloc(1, sizeof(w32a_decoder_t));
this->audio_decoder.decode_data = w32a_decode_data;
this->audio_decoder.reset = w32a_reset;
@@ -1655,7 +1655,7 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) {
cfg = xine->config;
if ((win32_def_path = get_win32_codecs_path(cfg)) == NULL) return NULL;
- this = (w32a_class_t *) xine_xmalloc (sizeof (w32a_class_t));
+ this = (w32a_class_t *) calloc(1, sizeof(w32a_class_t));
this->decoder_class.open_plugin = open_audio_decoder_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c
index 0f91499b3..0ccf3de9b 100644
--- a/src/libw32dll/wine/registry.c
+++ b/src/libw32dll/wine/registry.c
@@ -311,8 +311,7 @@ static void init_registry(void)
localregpathname = regpathname;
#else
#ifdef XINE_MAJOR
- localregpathname = (char *)malloc(strlen(xine_get_homedir()) + 21);
- sprintf(localregpathname, "%s/.xine/win32registry", xine_get_homedir());
+ asprintf(&localregpathname, "%s/.xine/win32registry", xine_get_homedir());
#else
// regpathname is an external pointer
//
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c
index 9b627a10a..9d99e1a25 100644
--- a/src/libw32dll/wine/win32.c
+++ b/src/libw32dll/wine/win32.c
@@ -3491,9 +3491,9 @@ static HANDLE WINAPI expCreateFileA(LPCSTR cs1,DWORD i1,DWORD i2,
if(strstr(cs1, ".qtx"))
{
int result;
- char* tmp=(char*)malloc(strlen(win32_def_path)+250);
char* x=strrchr(cs1,'\\');
- sprintf(tmp,"%s/%s",win32_def_path,x?(x+1):cs1);
+ char* tmp;
+ asprintf(&tmp,"%s/%s",win32_def_path,x?(x+1):cs1);
// printf("### Open: %s -> %s\n",cs1,tmp);
result=open(tmp, O_RDONLY);
free(tmp);
diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c
index 5ab4fa1f6..319eefb0e 100644
--- a/src/libxineadec/fooaudio.c
+++ b/src/libxineadec/fooaudio.c
@@ -91,7 +91,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
this->channels = buf->decoder_info[3];
/* initialize the data accumulation buffer */
- this->buf = xine_xmalloc(AUDIOBUFSIZE);
+ this->buf = calloc(1, AUDIOBUFSIZE);
this->bufsize = AUDIOBUFSIZE;
this->size = 0;
@@ -255,7 +255,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
fooaudio_decoder_t *this ;
- this = (fooaudio_decoder_t *) xine_xmalloc (sizeof (fooaudio_decoder_t));
+ this = (fooaudio_decoder_t *) calloc(1, sizeof(fooaudio_decoder_t));
/* connect the member functions */
this->audio_decoder.decode_data = fooaudio_decode_data;
diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c
index 23c0d2104..c67382bc5 100644
--- a/src/libxineadec/gsm610.c
+++ b/src/libxineadec/gsm610.c
@@ -101,7 +101,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
this->sample_rate = buf->decoder_info[1];
- this->buf = xine_xmalloc(AUDIOBUFSIZE);
+ this->buf = calloc(1, AUDIOBUFSIZE);
this->bufsize = AUDIOBUFSIZE;
this->size = 0;
@@ -233,7 +233,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
gsm610_decoder_t *this ;
- this = (gsm610_decoder_t *) xine_xmalloc (sizeof (gsm610_decoder_t));
+ this = (gsm610_decoder_t *) calloc(1, sizeof(gsm610_decoder_t));
this->audio_decoder.decode_data = gsm610_decode_data;
this->audio_decoder.reset = gsm610_reset;
@@ -265,7 +265,7 @@ static void *init_plugin (xine_t *xine, void *data) {
gsm610_class_t *this ;
- this = (gsm610_class_t *) xine_xmalloc (sizeof (gsm610_class_t));
+ this = (gsm610_class_t *) calloc(1, sizeof(gsm610_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/nsf.c b/src/libxineadec/nsf.c
index bdf523f1d..0c9cdbf55 100644
--- a/src/libxineadec/nsf.c
+++ b/src/libxineadec/nsf.c
@@ -90,7 +90,7 @@ static void nsf_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->song_number = buf->content[4];
/* allocate a buffer for the file */
this->nsf_size = _X_BE_32(&buf->content[0]);
- this->nsf_file = xine_xmalloc(this->nsf_size);
+ this->nsf_file = calloc(1, this->nsf_size);
this->nsf_index = 0;
/* peform any other required initialization */
@@ -205,7 +205,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
nsf_decoder_t *this ;
- this = (nsf_decoder_t *) xine_xmalloc (sizeof (nsf_decoder_t));
+ this = (nsf_decoder_t *) calloc(1, sizeof(nsf_decoder_t));
/* connect the member functions */
this->audio_decoder.decode_data = nsf_decode_data;
@@ -255,7 +255,7 @@ static void *init_plugin (xine_t *xine, void *data) {
nsf_class_t *this ;
- this = (nsf_class_t *) xine_xmalloc (sizeof (nsf_class_t));
+ this = (nsf_class_t *) calloc(1, sizeof(nsf_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c
index eeed7ba35..e1d81a8bb 100644
--- a/src/libxineadec/xine_lpcm_decoder.c
+++ b/src/libxineadec/xine_lpcm_decoder.c
@@ -240,7 +240,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
lpcm_decoder_t *this ;
- this = (lpcm_decoder_t *) xine_xmalloc (sizeof (lpcm_decoder_t));
+ this = (lpcm_decoder_t *) calloc(1, sizeof(lpcm_decoder_t));
this->audio_decoder.decode_data = lpcm_decode_data;
this->audio_decoder.reset = lpcm_reset;
@@ -275,7 +275,7 @@ static void *init_plugin (xine_t *xine, void *data) {
lpcm_class_t *this ;
- this = (lpcm_class_t *) xine_xmalloc (sizeof (lpcm_class_t));
+ this = (lpcm_class_t *) calloc(1, sizeof(lpcm_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_speex_decoder.c b/src/libxineadec/xine_speex_decoder.c
index dd7f988e2..46ea3a9f9 100644
--- a/src/libxineadec/xine_speex_decoder.c
+++ b/src/libxineadec/xine_speex_decoder.c
@@ -170,16 +170,16 @@ void read_metadata (speex_decoder_t *this, char * comments, int length)
#endif
for (i = 0; speex_comment_keys[i].key != NULL; i++) {
+ size_t keylen = strlen(speex_comment_keys[i].key);
if ( !strncasecmp (speex_comment_keys[i].key, c,
- strlen(speex_comment_keys[i].key)) ) {
- int keylen = strlen(speex_comment_keys[i].key);
+ keylen) ) {
char meta_info[(len - keylen) + 1];
lprintf ("known metadata %d %d\n",
i, speex_comment_keys[i].xine_metainfo_index);
- snprintf(meta_info, (len - keylen), "%s", c + keylen);
+ strncpy(meta_info, &c[keylen], len-keylen);
_x_meta_info_set_utf8(this->stream, speex_comment_keys[i].xine_metainfo_index, meta_info);
}
}
@@ -355,7 +355,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
speex_decoder_t *this ;
static SpeexStereoState init_stereo = SPEEX_STEREO_STATE_INIT;
- this = (speex_decoder_t *) xine_xmalloc (sizeof (speex_decoder_t));
+ this = (speex_decoder_t *) calloc(1, sizeof(speex_decoder_t));
this->audio_decoder.decode_data = speex_decode_data;
this->audio_decoder.reset = speex_reset;
@@ -396,7 +396,7 @@ static void *init_plugin (xine_t *xine, void *data) {
speex_class_t *this;
- this = (speex_class_t *) xine_xmalloc (sizeof (speex_class_t));
+ this = (speex_class_t *) calloc(1, sizeof(speex_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/libxineadec/xine_vorbis_decoder.c
index b3acff811..218c26033 100644
--- a/src/libxineadec/xine_vorbis_decoder.c
+++ b/src/libxineadec/xine_vorbis_decoder.c
@@ -315,7 +315,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
vorbis_decoder_t *this ;
- this = (vorbis_decoder_t *) xine_xmalloc (sizeof (vorbis_decoder_t));
+ this = (vorbis_decoder_t *) calloc(1, sizeof(vorbis_decoder_t));
this->audio_decoder.decode_data = vorbis_decode_data;
this->audio_decoder.reset = vorbis_reset;
@@ -328,7 +328,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
this->convsize = 0;
this->bufsize = INIT_BUFSIZE;
- this->buf = xine_xmalloc(INIT_BUFSIZE);
+ this->buf = calloc(1, INIT_BUFSIZE);
this->size = 0;
vorbis_info_init(&this->vi);
@@ -359,7 +359,7 @@ static void *init_plugin (xine_t *xine, void *data) {
vorbis_class_t *this;
- this = (vorbis_class_t *) xine_xmalloc (sizeof (vorbis_class_t));
+ this = (vorbis_class_t *) calloc(1, sizeof(vorbis_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c
index a3bdba74b..057511c29 100644
--- a/src/libxinevdec/bitplane.c
+++ b/src/libxinevdec/bitplane.c
@@ -252,7 +252,7 @@ static uint8_t *bitplane_decode_byterun1 (uint8_t *compressed,
int i = 0;
int j = 0;
- uint8_t *uncompressed = xine_xmalloc( size_uncompressed );
+ uint8_t *uncompressed = calloc(1, size_uncompressed );
while ( i < size_compressed &&
pixel_ptr < size_uncompressed ) {
@@ -1189,7 +1189,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
if (this->buf)
free (this->buf);
this->bufsize = VIDEOBUFSIZE;
- this->buf = xine_xmalloc(this->bufsize);
+ this->buf = calloc(1, this->bufsize);
this->size = 0;
this->framenumber = 0;
@@ -1255,7 +1255,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
case BUF_VIDEO_BITPLANE:
/* uncompressed Buffer, set decoded_buf pointer direct to input stream */
if( this->buf_uk == NULL )
- this->buf_uk = xine_xmalloc( (this->size) );
+ this->buf_uk = malloc(this->size);
xine_fast_memcpy (this->buf_uk, this->buf, this->size);
break;
case BUF_VIDEO_BITPLANE_BR1:
@@ -1294,7 +1294,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
}
}
if( this->buf_uk_hist == NULL ) {
- this->buf_uk_hist = xine_xmalloc( (this->size_uk) );
+ this->buf_uk_hist = malloc(this->size_uk);
xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
xine_fast_memcpy (this->index_buf_hist, this->index_buf,
(this->num_pixel * this->bytes_per_pixel));
@@ -1306,20 +1306,12 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
/* when no start-picture is given, create a empty one */
if( this->buf_uk_hist == NULL ) {
this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
- this->buf_uk = xine_xmalloc( (this->size_uk) );
- this->buf_uk_hist = xine_xmalloc( (this->size_uk) );
- for (i = 0; i < this->size_uk; i++) {
- this->buf_uk[i] = 0;
- this->buf_uk_hist[i] = 0;
- }
+ this->buf_uk = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
+ this->buf_uk_hist = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
}
if( this->index_buf == NULL ) {
this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
- for (i = 0; i < (this->num_pixel * this->bytes_per_pixel); i++) {
- this->index_buf[i] = 0;
- this->index_buf_hist[i] = 0;
- }
}
switch( anhd->operation ) {
@@ -1523,7 +1515,7 @@ static void bitplane_dispose (video_decoder_t *this_gen) {
static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
- bitplane_decoder_t *this = (bitplane_decoder_t *) xine_xmalloc (sizeof (bitplane_decoder_t));
+ bitplane_decoder_t *this = (bitplane_decoder_t *) calloc(1, sizeof(bitplane_decoder_t));
this->video_decoder.decode_data = bitplane_decode_data;
this->video_decoder.flush = bitplane_flush;
@@ -1558,7 +1550,7 @@ static void dispose_class (video_decoder_class_t *this) {
static void *init_plugin (xine_t *xine, void *data) {
- bitplane_class_t *this = (bitplane_class_t *) xine_xmalloc (sizeof (bitplane_class_t));
+ bitplane_class_t *this = (bitplane_class_t *) calloc(1, sizeof(bitplane_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c
index 98e0ebc0b..e0e0883dc 100644
--- a/src/libxinevdec/foovideo.c
+++ b/src/libxinevdec/foovideo.c
@@ -206,7 +206,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
foovideo_decoder_t *this ;
- this = (foovideo_decoder_t *) xine_xmalloc (sizeof (foovideo_decoder_t));
+ this = (foovideo_decoder_t *) calloc(1, sizeof(foovideo_decoder_t));
this->video_decoder.decode_data = foovideo_decode_data;
this->video_decoder.flush = foovideo_flush;
@@ -256,7 +256,7 @@ static void *init_plugin (xine_t *xine, void *data) {
foovideo_class_t *this;
- this = (foovideo_class_t *) xine_xmalloc (sizeof (foovideo_class_t));
+ this = (foovideo_class_t *) calloc(1, sizeof(foovideo_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c
index b5acdfa42..d41a958d8 100644
--- a/src/libxinevdec/gdkpixbuf.c
+++ b/src/libxinevdec/gdkpixbuf.c
@@ -236,7 +236,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
g_type_init ();
- this = (image_decoder_t *) xine_xmalloc (sizeof (image_decoder_t));
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
this->video_decoder.decode_data = image_decode_data;
this->video_decoder.flush = image_flush;
@@ -277,7 +277,7 @@ static void *init_class (xine_t *xine, void *data) {
image_class_t *this;
- this = (image_class_t *) xine_xmalloc (sizeof (image_class_t));
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c
index a338e3cab..51e5d0309 100644
--- a/src/libxinevdec/image.c
+++ b/src/libxinevdec/image.c
@@ -212,7 +212,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
lprintf("opened\n");
- this = (image_decoder_t *) xine_xmalloc (sizeof (image_decoder_t));
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
this->video_decoder.decode_data = image_decode_data;
this->video_decoder.flush = image_flush;
@@ -255,7 +255,7 @@ static void *init_class (xine_t *xine, void *data) {
image_class_t *this;
- this = (image_class_t *) xine_xmalloc (sizeof (image_class_t));
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c
index 0e7be4c18..c1e7f398b 100644
--- a/src/libxinevdec/rgb.c
+++ b/src/libxinevdec/rgb.c
@@ -145,7 +145,7 @@ static void rgb_decode_data (video_decoder_t *this_gen,
/* minimal buffer size */
this->bufsize = this->width * this->height * this->bytes_per_pixel;
- this->buf = xine_xmalloc(this->bufsize);
+ this->buf = calloc(1, this->bufsize);
this->size = 0;
init_yuv_planes(&this->yuv_planes, this->width, this->height);
@@ -398,7 +398,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
rgb_decoder_t *this ;
- this = (rgb_decoder_t *) xine_xmalloc (sizeof (rgb_decoder_t));
+ this = (rgb_decoder_t *) calloc(1, sizeof(rgb_decoder_t));
this->video_decoder.decode_data = rgb_decode_data;
this->video_decoder.flush = rgb_flush;
@@ -432,7 +432,7 @@ static void *init_plugin (xine_t *xine, void *data) {
rgb_class_t *this;
- this = (rgb_class_t *) xine_xmalloc (sizeof (rgb_class_t));
+ this = (rgb_class_t *) calloc(1, sizeof(rgb_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/xine_theora_decoder.c b/src/libxinevdec/xine_theora_decoder.c
index c71ce7559..d15625812 100644
--- a/src/libxinevdec/xine_theora_decoder.c
+++ b/src/libxinevdec/xine_theora_decoder.c
@@ -312,7 +312,7 @@ static video_decoder_t *theora_open_plugin (video_decoder_class_t *class_gen, xi
theora_decoder_t *this ;
- this = (theora_decoder_t *) xine_xmalloc (sizeof (theora_decoder_t));
+ this = (theora_decoder_t *) calloc(1, sizeof(theora_decoder_t));
this->theora_decoder.decode_data = theora_decode_data;
this->theora_decoder.flush = theora_flush;
@@ -370,7 +370,7 @@ static void *init_plugin (xine_t *xine, void *data) {
/*initialize our plugin*/
theora_class_t *this;
- this = (theora_class_t *) xine_xmalloc (sizeof (theora_class_t));
+ this = (theora_class_t *) calloc(1, sizeof(theora_class_t));
this->decoder_class.open_plugin = theora_open_plugin;
this->decoder_class.get_identifier = theora_get_identifier;
diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c
index 2b8657685..49b2363fb 100644
--- a/src/libxinevdec/yuv.c
+++ b/src/libxinevdec/yuv.c
@@ -321,7 +321,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
yuv_decoder_t *this ;
- this = (yuv_decoder_t *) xine_xmalloc (sizeof (yuv_decoder_t));
+ this = (yuv_decoder_t *) calloc(1, sizeof(yuv_decoder_t));
this->video_decoder.decode_data = yuv_decode_data;
this->video_decoder.flush = yuv_flush;
@@ -355,7 +355,7 @@ static void *init_plugin (xine_t *xine, void *data) {
yuv_class_t *this;
- this = (yuv_class_t *) xine_xmalloc (sizeof (yuv_class_t));
+ this = (yuv_class_t *) calloc(1, sizeof(yuv_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c
index 5aa7a0617..6930fea3d 100644
--- a/src/post/audio/stretch.c
+++ b/src/post/audio/stretch.c
@@ -152,10 +152,10 @@ static void stretchscr_exit (scr_plugin_t *scr) {
free(this);
}
-static stretchscr_t* stretchscr_init (double *stretch_factor) {
+static stretchscr_t *XINE_MALLOC stretchscr_init (double *stretch_factor) {
stretchscr_t *this;
- this = (stretchscr_t *) xine_xmalloc(sizeof(stretchscr_t));
+ this = calloc(1, sizeof(stretchscr_t));
this->scr.interface_version = 3;
this->scr.get_priority = stretchscr_get_priority;
@@ -620,7 +620,7 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_stretch_t *this = (post_plugin_stretch_t *)xine_xmalloc(sizeof(post_plugin_stretch_t));
+ post_plugin_stretch_t *this = calloc(1, sizeof(post_plugin_stretch_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index e1b2afbe3..725439c1f 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.c
@@ -181,7 +181,7 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream,
}
pthread_mutex_lock (&this->lock);
- this->sub = xine_xmalloc(sizeof(af_sub_t));
+ this->sub = calloc(1, sizeof(af_sub_t));
if (!this->sub) {
pthread_mutex_unlock (&this->lock);
return 0;
@@ -379,7 +379,7 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_upmix_t *this = (post_plugin_upmix_t *)xine_xmalloc(sizeof(post_plugin_upmix_t));
+ post_plugin_upmix_t *this = calloc(1, sizeof(post_plugin_upmix_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c
index 195831123..2d3429788 100644
--- a/src/post/audio/upmix_mono.c
+++ b/src/post/audio/upmix_mono.c
@@ -192,32 +192,32 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
_x_extra_info_merge(buf1->extra_info, buf->extra_info);
{
- int step = buf->format.bits / 8;
+ const size_t step = buf->format.bits / 8;
uint8_t *src = (uint8_t *)buf->mem;
uint8_t *dst0 = (uint8_t *)buf0->mem;
uint8_t *dst1 = (uint8_t *)buf1->mem;
- int i, k;
+ int i;
for (i = 0; i < buf->num_frames / 2; i++)
{
- for (k = 0; k < step; k++)
- *dst0++ = *src++;
+ memcpy(dst0, src, step);
+ dst0 += step;
- src -= step;
+ memcpy(dst0, src, step);
+ dst0 += step;
- for (k = 0; k < step; k++)
- *dst0++ = *src++;
+ src += step;
}
for (i = buf->num_frames / 2; i < buf->num_frames; i++)
{
- for (k = 0; k < step; k++)
- *dst1++ = *src++;
+ memcpy(dst1, src, step);
+ dst1 += step;
- src -= step;
+ memcpy(dst1, src, step);
+ dst1 += step;
- for (k = 0; k < step; k++)
- *dst1++ = *src++;
+ src += step;
}
}
@@ -244,11 +244,11 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
_x_extra_info_merge(buf0->extra_info, buf->extra_info);
{
- int step = buf->format.bits / 8;
+ const size_t step = buf->format.bits / 8;
uint8_t *src = (uint8_t *)buf->mem;
uint8_t *dst0 = (uint8_t *)buf0->mem;
int cur_channel = this->params.channel;
- int i, j, k;
+ int i, j;
if( cur_channel >= this->channels )
cur_channel = this->channels-1;
@@ -259,8 +259,8 @@ static void upmix_mono_port_put_buffer(xine_audio_port_t *port_gen,
{
for (j = 0; j < this->channels; j++ )
{
- for (k = 0; k < step; k++)
- *dst0++ = *(src+k);
+ memcpy(dst0, src, step);
+ dst0 += step;
}
src += this->channels * step;
}
@@ -293,7 +293,7 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_upmix_mono_t *this = (post_plugin_upmix_mono_t *)xine_xmalloc(sizeof(post_plugin_upmix_mono_t));
+ post_plugin_upmix_mono_t *this = calloc(1, sizeof(post_plugin_upmix_mono_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c
index 783c1e26d..4fdb7dbfc 100644
--- a/src/post/audio/volnorm.c
+++ b/src/post/audio/volnorm.c
@@ -407,7 +407,7 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_volnorm_t *this = (post_plugin_volnorm_t *)xine_xmalloc(sizeof(post_plugin_volnorm_t));
+ post_plugin_volnorm_t *this = calloc(1, sizeof(post_plugin_volnorm_t));
post_in_t *input;
post_out_t *output;
xine_post_in_t *input_api;
@@ -426,9 +426,8 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs,
this->mul = MUL_INIT;
this->lastavg = MID_S16;
this->idx = 0;
- for (i = 0; i < NSAMPLES; i++)
- this->mem[i].len = this->mem[i].avg = 0;
-
+ memset(this->mem, 0, sizeof(this->mem));
+
port = _x_post_intercept_audio_port(&this->post, audio_target[0], &input, &output);
port->new_port.open = volnorm_port_open;
port->new_port.close = volnorm_port_close;
diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c
index 477e6812b..8115198af 100644
--- a/src/post/deinterlace/xine_plugin.c
+++ b/src/post/deinterlace/xine_plugin.c
@@ -291,7 +291,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream)
static void *deinterlace_init_plugin(xine_t *xine, void *data)
{
- post_class_deinterlace_t *class = (post_class_deinterlace_t *)xine_xmalloc(sizeof(post_class_deinterlace_t));
+ post_class_deinterlace_t *class = calloc(1, sizeof(post_class_deinterlace_t));
uint32_t config_flags = xine_mm_accel();
int i;
@@ -364,7 +364,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)xine_xmalloc(sizeof(post_plugin_deinterlace_t));
+ post_plugin_deinterlace_t *this = calloc(1, sizeof(post_plugin_deinterlace_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/goom/goom_core.c b/src/post/goom/goom_core.c
index b24f2f496..35fd7fc35 100644
--- a/src/post/goom/goom_core.c
+++ b/src/post/goom/goom_core.c
@@ -841,7 +841,7 @@ void update_message (PluginInfo *goomInfo, char *message) {
if (message) {
int i=1,j=0;
- sprintf (goomInfo->update_message.message, "%s", message);
+ strcpy(goomInfo->update_message.message, message);
for (j=0;goomInfo->update_message.message[j];j++)
if (goomInfo->update_message.message[j]=='\n')
i++;
@@ -855,8 +855,8 @@ void update_message (PluginInfo *goomInfo, char *message) {
char *ptr = msg;
int pos;
float ecart;
+ strncpy(msg, goomInfo->update_message.message, goomInfo->update_message.longueur);
message = msg;
- sprintf (msg, "%s", goomInfo->update_message.message);
while (!fin) {
while (1) {
diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c
index 8cd06dbd6..5cd5406b2 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.c
@@ -187,7 +187,7 @@ static void csc_method_changed_cb(void *data, xine_cfg_entry_t *cfg) {
static void *goom_init_plugin(xine_t *xine, void *data)
{
- post_class_goom_t *this = (post_class_goom_t *)xine_xmalloc(sizeof(post_class_goom_t));
+ post_class_goom_t *this = calloc(1, sizeof(post_class_goom_t));
config_values_t *cfg;
if (!this)
@@ -234,7 +234,7 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_goom_t *this = (post_plugin_goom_t *)xine_xmalloc(sizeof(post_plugin_goom_t));
+ post_plugin_goom_t *this = calloc(1, sizeof(post_plugin_goom_t));
post_class_goom_t *class = (post_class_goom_t*) class_gen;
post_in_t *input;
post_out_t *output;
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index 40f0ffb4c..d99bab43b 100644
--- a/src/post/mosaico/mosaico.c
+++ b/src/post/mosaico/mosaico.c
@@ -22,6 +22,10 @@
* simple video mosaico plugin
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#define LOG_MODULE "mosaico"
#define LOG_VERBOSE
/*
@@ -122,7 +126,7 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream);
static void *mosaico_init_plugin(xine_t *xine, void *data)
{
- post_class_mosaico_t *this = (post_class_mosaico_t *)xine_xmalloc(sizeof(post_class_mosaico_t));
+ post_class_mosaico_t *this = calloc(1, sizeof(post_class_mosaico_t));
if (!this)
return NULL;
@@ -140,7 +144,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_mosaico_t *this = (post_mosaico_t *)xine_xmalloc(sizeof(post_mosaico_t));
+ post_mosaico_t *this = calloc(1, sizeof(post_mosaico_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
@@ -178,8 +182,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
this->pip[i].y = 50;
this->pip[i].w = 150;
this->pip[i].h = 150;
- this->pip[i].input_name = (char *)xine_xmalloc(sizeof("video in ") + 10);
- snprintf(this->pip[i].input_name, sizeof("video in ") + 10, "video in %d", i+1);
+ asprintf(&(this->pip[i].input_name), "video in %d", i+1);
port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL);
port->new_port.close = mosaico_close;
diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c
index 8fec5ee77..a01c821b2 100644
--- a/src/post/mosaico/switch.c
+++ b/src/post/mosaico/switch.c
@@ -101,7 +101,7 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream);
static void *switch_init_plugin(xine_t *xine, void *data)
{
- post_class_switch_t *this = (post_class_switch_t *)xine_xmalloc(sizeof(post_class_switch_t));
+ post_class_switch_t *this = calloc(1, sizeof(post_class_switch_t));
if (!this)
return NULL;
@@ -119,7 +119,7 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_switch_t *this = (post_switch_t *)xine_xmalloc(sizeof(post_switch_t));
+ post_switch_t *this = calloc(1, sizeof(post_switch_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c
index b7a6f524f..edad304a6 100644
--- a/src/post/planar/boxblur.c
+++ b/src/post/planar/boxblur.c
@@ -154,7 +154,7 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)xine_xmalloc(sizeof(post_plugin_boxblur_t));
+ post_plugin_boxblur_t *this = calloc(1, sizeof(post_plugin_boxblur_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c
index fb3c1102b..74ed02250 100644
--- a/src/post/planar/denoise3d.c
+++ b/src/post/planar/denoise3d.c
@@ -194,7 +194,7 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)xine_xmalloc(sizeof(post_plugin_denoise3d_t));
+ post_plugin_denoise3d_t *this = calloc(1, sizeof(post_plugin_denoise3d_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c
index b2cf6e50f..92dae8e36 100644
--- a/src/post/planar/eq.c
+++ b/src/post/planar/eq.c
@@ -246,7 +246,7 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_eq_t *this = (post_plugin_eq_t *)xine_xmalloc(sizeof(post_plugin_eq_t));
+ post_plugin_eq_t *this = calloc(1, sizeof(post_plugin_eq_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 6b277c347..0ead54f55 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -427,7 +427,7 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_eq2_t *this = (post_plugin_eq2_t *)xine_xmalloc(sizeof(post_plugin_eq2_t));
+ post_plugin_eq2_t *this = calloc(1, sizeof(post_plugin_eq2_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
@@ -442,26 +442,15 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
_x_post_init(&this->post, 0, 1);
- eq2 = &this->eq2;
- for (i = 0; i < 3; i++) {
- eq2->buf[i] = NULL;
- eq2->buf_w[i] = 0;
- eq2->buf_h[i] = 0;
-
- eq2->param[i].adjust = NULL;
- eq2->param[i].c = 1.0;
- eq2->param[i].b = 0.0;
- eq2->param[i].g = 1.0;
- eq2->param[i].lut_clean = 0;
- }
+ memset(&this->eq2, 0, sizeof(this->eq2));
- eq2->gamma = this->params.gamma = 1.0;
- eq2->contrast = this->params.contrast = 1.0;
- eq2->brightness = this->params.brightness = 0.0;
- eq2->saturation = this->params.saturation = 1.0;
- eq2->rgamma = this->params.rgamma = 1.0;
- eq2->ggamma = this->params.ggamma = 1.0;
- eq2->bgamma = this->params.bgamma = 1.0;
+ this->eq2.gamma = this->params.gamma = 1.0;
+ this->eq2.contrast = this->params.contrast = 1.0;
+ this->eq2.brightness = this->params.brightness = 0.0;
+ this->eq2.saturation = this->params.saturation = 1.0;
+ this->eq2.rgamma = this->params.rgamma = 1.0;
+ this->eq2.ggamma = this->params.ggamma = 1.0;
+ this->eq2.bgamma = this->params.bgamma = 1.0;
pthread_mutex_init(&this->lock, NULL);
diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c
index 67d449153..52bc2b37a 100644
--- a/src/post/planar/expand.c
+++ b/src/post/planar/expand.c
@@ -148,7 +148,7 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_expand_t *this = (post_expand_t *)xine_xmalloc(sizeof(post_expand_t));
+ post_expand_t *this = calloc(1, sizeof(post_expand_t));
post_in_t *input;
xine_post_in_t *input_param;
post_out_t *output;
diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c
index 32a9d5dfb..98c572777 100644
--- a/src/post/planar/fill.c
+++ b/src/post/planar/fill.c
@@ -66,7 +66,7 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c
index 1aa5c2a2e..d1f0c8d4e 100644
--- a/src/post/planar/invert.c
+++ b/src/post/planar/invert.c
@@ -67,7 +67,7 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t));
+ post_plugin_t *this = calloc(1, sizeof(post_plugin_t));
post_in_t *input;
post_out_t *output;
post_video_port_t *port;
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index 8c04f2e72..e15c6fb4d 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -471,7 +471,7 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_noise_t *this = (post_plugin_noise_t *)xine_xmalloc(sizeof(post_plugin_noise_t));
+ post_plugin_noise_t *this = calloc(1, sizeof(post_plugin_noise_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index e658dadd0..51d28b33d 100644
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
@@ -20,6 +20,10 @@
* plugin for ffmpeg libpostprocess
*/
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
#include "xine_internal.h"
#include "post.h"
#include "xineutils.h"
@@ -119,12 +123,9 @@ static char * get_help (void) {
);
static char *help = NULL;
- if( !help ) {
- help = malloc( strlen(help1) + strlen(help2) + strlen(pp_help) + 1);
- strcpy(help, help1);
- strcat(help, pp_help);
- strcat(help, help2);
- }
+ if( !help )
+ asprintf(&help, "%s%s%s", help1, help2, pp_help);
+
return help;
}
@@ -174,7 +175,7 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_pp_t *this = (post_plugin_pp_t *)xine_xmalloc(sizeof(post_plugin_pp_t));
+ post_plugin_pp_t *this = calloc(1, sizeof(post_plugin_pp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c
index b9b791a8e..da41708d0 100644
--- a/src/post/planar/unsharp.c
+++ b/src/post/planar/unsharp.c
@@ -26,13 +26,6 @@
#include "xineutils.h"
#include <pthread.h>
-#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#endif
-#ifndef MAX
-#define MAX(a,b) (((a)>(b))?(a):(b))
-#endif
-
/*===========================================================================*/
#define MIN_MATRIX_SIZE 3
@@ -287,7 +280,7 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_unsharp_t *this = (post_plugin_unsharp_t *)xine_xmalloc(sizeof(post_plugin_unsharp_t));
+ post_plugin_unsharp_t *this = calloc(1, sizeof(post_plugin_unsharp_t));
post_in_t *input;
xine_post_in_t *input_api;
post_out_t *output;
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index 5068bd37a..0cf27faf8 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -415,7 +415,7 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_fftgraph_t *class = (post_class_fftgraph_t *)class_gen;
- post_plugin_fftgraph_t *this = (post_plugin_fftgraph_t *)xine_xmalloc(sizeof(post_plugin_fftgraph_t));
+ post_plugin_fftgraph_t *this = calloc(1, sizeof(post_plugin_fftgraph_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index ba34437f5..2c6297a44 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -435,7 +435,7 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target)
{
- post_plugin_fftscope_t *this = (post_plugin_fftscope_t *)xine_xmalloc(sizeof(post_plugin_fftscope_t));
+ post_plugin_fftscope_t *this = calloc(1, sizeof(post_plugin_fftscope_t));
post_class_fftscope_t *class = (post_class_fftscope_t *)class_gen;
post_in_t *input;
post_out_t *output;
diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c
index 21854afc6..2219143be 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.c
@@ -247,7 +247,7 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_fooviz_t *class = (post_class_fooviz_t *)class_gen;
- post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)xine_xmalloc(sizeof(post_plugin_fooviz_t));
+ post_plugin_fooviz_t *this = calloc(1, sizeof(post_plugin_fooviz_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;
diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c
index a435604d4..099920b42 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -318,7 +318,7 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
xine_video_port_t **video_target)
{
post_class_oscope_t *class = (post_class_oscope_t *)class_gen;
- post_plugin_oscope_t *this = (post_plugin_oscope_t *)xine_xmalloc(sizeof(post_plugin_oscope_t));
+ post_plugin_oscope_t *this = calloc(1, sizeof(post_plugin_oscope_t));
post_in_t *input;
post_out_t *output;
post_out_t *outputv;
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index 012db9665..770b75a10 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.c
@@ -106,7 +106,7 @@ static vo_frame_t *aa_alloc_frame(vo_driver_t *this_gen) {
/* aa_driver_t *this = (aa_driver_t*) this_gen; */
aa_frame_t *frame;
- frame = (aa_frame_t *) xine_xmalloc (sizeof (aa_frame_t));
+ frame = calloc(1, sizeof (aa_frame_t));
if (!frame)
return NULL;
@@ -276,7 +276,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
aa_class_t *class = (aa_class_t *) class_gen;
aa_driver_t *this;
- this = (aa_driver_t*) xine_xmalloc (sizeof (aa_driver_t));
+ this = (aa_driver_t*) calloc(1, sizeof(aa_driver_t));
this->context = (aa_context*) visual_gen;
@@ -316,7 +316,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
/* aa_context *context = (aa_context*) visual_gen; */
aa_class_t *this;
- this = (aa_class_t *) xine_xmalloc(sizeof(aa_class_t));
+ this = calloc(1, sizeof(aa_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c
index 866eabcd8..3eec45211 100644
--- a/src/video_out/video_out_caca.c
+++ b/src/video_out/video_out_caca.c
@@ -120,7 +120,7 @@ static vo_frame_t *caca_alloc_frame(vo_driver_t *this_gen) {
caca_driver_t *this = (caca_driver_t*) this_gen;
caca_frame_t *frame;
- frame = (caca_frame_t *) xine_xmalloc (sizeof (caca_frame_t));
+ frame = calloc(1, sizeof (caca_frame_t));
if (!frame)
return NULL;
@@ -278,7 +278,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
caca_class_t *class = (caca_class_t *) class_gen;
caca_driver_t *this;
- this = (caca_driver_t*) xine_xmalloc (sizeof (caca_driver_t));
+ this = calloc(1, sizeof (caca_driver_t));
this->config = class->config;
this->xine = class->xine;
@@ -322,7 +322,7 @@ static void dispose_class (video_driver_class_t *this_gen) {
static void *init_class (xine_t *xine, void *visual_gen) {
caca_class_t *this;
- this = (caca_class_t *) xine_xmalloc(sizeof(caca_class_t));
+ this = calloc(1, sizeof(caca_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index e6e333a0c..2e9874cc0 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -168,10 +168,6 @@ typedef struct {
"no-deinit-check"
-#ifndef MAX
-# define MAX( a, b ) (((a) > (b)) ? (a) : (b))
-#endif
-
#define YCBCR_TO_RGB( y, cb, cr, r, g, b ) \
do { \
int _y, _cb, _cr, _r, _g, _b; \
@@ -232,7 +228,7 @@ static vo_frame_t *directfb_alloc_frame (vo_driver_t *this_gen) {
directfb_driver_t *this = (directfb_driver_t *) this_gen;
directfb_frame_t *frame;
- frame = (directfb_frame_t *) xine_xmalloc (sizeof (directfb_frame_t));
+ frame = (directfb_frame_t *) calloc(1, sizeof(directfb_frame_t));
if (!frame) {
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
"video_out_directfb: directfb_alloc_frame: out of memory\n");
@@ -1753,7 +1749,7 @@ static vo_driver_t *open_plugin_fb (video_driver_class_t *class_gen, const void
DFBDisplayLayerID id;
DFBResult ret;
- this = xine_xmalloc (sizeof (directfb_driver_t));
+ this = calloc(1, sizeof(directfb_driver_t));
if (!this)
return NULL;
@@ -1908,7 +1904,7 @@ static void *init_class_fb (xine_t *xine, void *visual_gen) {
return NULL;
}
- this = (directfb_class_t *) xine_xmalloc (sizeof (directfb_class_t));
+ this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t));
this->driver_class.open_plugin = open_plugin_fb;
this->driver_class.get_identifier = get_identifier_fb;
this->driver_class.get_description = get_description_fb;
@@ -1939,7 +1935,7 @@ static vo_driver_t *open_plugin_x11 (video_driver_class_t *class_gen, const void
DFBDisplayLayerID id = DLID_PRIMARY;
DFBResult ret;
- this = xine_xmalloc (sizeof (directfb_driver_t));
+ this = calloc(1, sizeof(directfb_driver_t));
if (!this)
return NULL;
@@ -2127,7 +2123,7 @@ static void *init_class_x11 (xine_t *xine, void *visual_gen) {
if (strcmp (XServerVendor (visual->display), "Denis Oliver Kropp"))
return NULL;
- this = (directfb_class_t *) xine_xmalloc (sizeof (directfb_class_t));
+ this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t));
this->driver_class.open_plugin = open_plugin_x11;
this->driver_class.get_identifier = get_identifier_x11;
this->driver_class.get_description = get_description_x11;
diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c
index 11ee709e1..f1136eab0 100644
--- a/src/video_out/video_out_directx.c
+++ b/src/video_out/video_out_directx.c
@@ -863,7 +863,7 @@ static vo_frame_t * win32_alloc_frame( vo_driver_t * vo_driver )
{
win32_frame_t *win32_frame;
- win32_frame = ( win32_frame_t * ) xine_xmalloc( sizeof( win32_frame_t ) );
+ win32_frame = calloc(1, sizeof(win32_frame_t));
if (!win32_frame)
return NULL;
@@ -1183,7 +1183,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *wi
/*vo_driver_t *init_video_out_plugin( config_values_t * config, void * win32_visual )*/
{
directx_class_t *class = (directx_class_t *)class_gen;
- win32_driver_t *win32_driver = ( win32_driver_t * ) xine_xmalloc ( sizeof( win32_driver_t ) );
+ win32_driver_t *win32_driver = calloc(1, sizeof(win32_driver_t));
_x_alphablend_init(&win32_driver->alphablend_extra_data, class->xine);
@@ -1249,7 +1249,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
/*
* from this point on, nothing should go wrong anymore
*/
- directx = (directx_class_t *) xine_xmalloc (sizeof (directx_class_t));
+ directx = calloc(1, sizeof (directx_class_t));
directx->driver_class.open_plugin = open_plugin;
directx->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index 6a331c910..d67b0870d 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.c
@@ -221,7 +221,7 @@ static vo_frame_t *fb_alloc_frame(vo_driver_t *this_gen)
this->total_num_native_buffers <= this->used_num_buffers)
return 0;
- frame = (fb_frame_t *)xine_xmalloc(sizeof(fb_frame_t));
+ frame = calloc(1, sizeof(fb_frame_t));
if(!frame)
return NULL;
@@ -992,7 +992,7 @@ static vo_driver_t *fb_open_plugin(video_driver_class_t *class_gen,
config = class->config;
/* allocate plugin struct */
- this = (fb_driver_t *) xine_xmalloc(sizeof(fb_driver_t));
+ this = calloc(1, sizeof(fb_driver_t));
if(!this)
return NULL;
@@ -1075,7 +1075,7 @@ static void fb_dispose_class(video_driver_class_t *this_gen)
static void *fb_init_class(xine_t *xine, void *visual_gen)
{
- fb_class_t *this = (fb_class_t *)xine_xmalloc(sizeof(fb_class_t));
+ fb_class_t *this = calloc(1, sizeof(fb_class_t));
this->driver_class.open_plugin = fb_open_plugin;
this->driver_class.get_identifier = fb_get_identifier;
diff --git a/src/video_out/video_out_macosx.m b/src/video_out/video_out_macosx.m
index a13de239f..b5b4d731c 100644
--- a/src/video_out/video_out_macosx.m
+++ b/src/video_out/video_out_macosx.m
@@ -97,7 +97,7 @@ static vo_frame_t *macosx_alloc_frame(vo_driver_t *vo_driver) {
/* macosx_driver_t *this = (macosx_driver_t *) vo_driver; */
macosx_frame_t *frame;
- frame = (macosx_frame_t *) xine_xmalloc(sizeof(macosx_frame_t));
+ frame = calloc(1, sizeof(macosx_frame_t));
if(!frame)
return NULL;
@@ -320,7 +320,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *
macosx_driver_t *driver;
XineOpenGLView *view = (XineOpenGLView *) visual;
- driver = (macosx_driver_t *) xine_xmalloc(sizeof(macosx_driver_t));
+ driver = calloc(1, sizeof(macosx_driver_t));
driver->config = class->config;
driver->xine = class->xine;
@@ -366,7 +366,7 @@ static void dispose_class (video_driver_class_t *driver_class) {
static void *init_class (xine_t *xine, void *visual) {
macosx_class_t *this;
- this = (macosx_class_t *) xine_xmalloc(sizeof(macosx_class_t));
+ this = calloc(1, sizeof(macosx_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c
index 5f2424a60..0de6e34e8 100644
--- a/src/video_out/video_out_none.c
+++ b/src/video_out/video_out_none.c
@@ -88,7 +88,7 @@ static vo_frame_t *none_alloc_frame(vo_driver_t *vo_driver) {
/* none_driver_t *this = (none_driver_t *) vo_driver; */
none_frame_t *frame;
- frame = (none_frame_t *) xine_xmalloc(sizeof(none_frame_t));
+ frame = calloc(1, sizeof(none_frame_t));
if(!frame)
return NULL;
@@ -243,7 +243,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *
none_class_t *class = (none_class_t *) driver_class;
none_driver_t *driver;
- driver = (none_driver_t *) xine_xmalloc(sizeof(none_driver_t));
+ driver = calloc(1, sizeof(none_driver_t));
driver->config = class->config;
driver->xine = class->xine;
@@ -286,7 +286,7 @@ static void dispose_class (video_driver_class_t *driver_class) {
static void *init_class (xine_t *xine, void *visual) {
none_class_t *this;
- this = (none_class_t *) xine_xmalloc(sizeof(none_class_t));
+ this = calloc(1, sizeof(none_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index 54696f452..af1093e91 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -669,8 +669,8 @@ static int render_image_envtex (opengl_driver_t *this, opengl_frame_t *frame) {
* Render setup functions
*/
static int render_help_verify_ext (opengl_driver_t *this, char *ext) {
- int ret = 0;
- int l = strlen (ext);
+ int ret = 0;
+ const size_t l = strlen (ext);
const char *e;
for (e = (char *) this->gl_exts; e && *e; e = strchr (e, ' ')) {
while (isspace (*e))
@@ -694,10 +694,9 @@ static void *getdladdr (const GLubyte *_funcName) {
return NULL;
#elif defined(__APPLE__)
- char *temp = xine_xmalloc (strlen (funcName) + 2);
+ char *temp;
+ asprintf(&temp, "_%s", funcName);
void *res = NULL;
- temp[0] = '_'; /* Mac OS X prepends an underscore on function names */
- strcpy (temp+1, funcName);
if (NSIsSymbolNameDefined (temp)) {
NSSymbol symbol = NSLookupAndBindSymbol (temp);
res = NSAddressOfSymbol (symbol);
@@ -1281,7 +1280,7 @@ static vo_frame_t *opengl_alloc_frame (vo_driver_t *this_gen) {
opengl_frame_t *frame;
opengl_driver_t *this = (opengl_driver_t *) this_gen;
- frame = (opengl_frame_t *) xine_xmalloc (sizeof (opengl_frame_t));
+ frame = (opengl_frame_t *) calloc(1, sizeof(opengl_frame_t));
if (!frame)
return NULL;
@@ -1820,7 +1819,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen, const v
char **render_fun_names;
int i;
- this = (opengl_driver_t *) xine_xmalloc (sizeof (opengl_driver_t));
+ this = (opengl_driver_t *) calloc(1, sizeof(opengl_driver_t));
if (!this)
return NULL;
@@ -1876,8 +1875,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen, const v
this->drawable, X11OSD_SHAPED);
XUnlockDisplay (this->display);
- render_fun_names = xine_xmalloc ((sizeof(opengl_rb)/sizeof(opengl_render_t)+1)
- * sizeof (const char *));
+ render_fun_names = calloc((sizeof(opengl_rb)/sizeof(opengl_render_t)+1), sizeof(const char*));
for (i = 0; i < sizeof (opengl_rb) / sizeof (opengl_render_t); i++)
render_fun_names[i] = opengl_rb[i].name;
render_fun_names[i] = NULL;
@@ -1970,7 +1968,7 @@ static void opengl_dispose_class (video_driver_class_t *this_gen) {
}
static void *opengl_init_class (xine_t *xine, void *visual_gen) {
- opengl_class_t *this = (opengl_class_t *) xine_xmalloc (sizeof (opengl_class_t));
+ opengl_class_t *this = (opengl_class_t *) calloc(1, sizeof(opengl_class_t));
this->driver_class.open_plugin = opengl_open_plugin;
this->driver_class.get_identifier = opengl_get_identifier;
diff --git a/src/video_out/video_out_pgx32.c b/src/video_out/video_out_pgx32.c
index d903efc89..45a54cc76 100644
--- a/src/video_out/video_out_pgx32.c
+++ b/src/video_out/video_out_pgx32.c
@@ -386,7 +386,7 @@ static vo_frame_t *pgx32_alloc_frame(vo_driver_t *this_gen)
/*pgx32_driver_t *this = (pgx32_driver_t *)(void *)this_gen;*/
pgx32_frame_t *frame;
- frame = (pgx32_frame_t *) xine_xmalloc(sizeof(pgx32_frame_t));
+ frame = calloc(1, sizeof(pgx32_frame_t));
if (!frame) {
return NULL;
}
@@ -800,7 +800,7 @@ static vo_driver_t *pgx32_init_driver(video_driver_class_t *class_gen, const voi
pgx32_driver_class_t *class = (pgx32_driver_class_t *)(void *)class_gen;
pgx32_driver_t *this;
- this = (pgx32_driver_t *)xine_xmalloc(sizeof(pgx32_driver_t));
+ this = calloc(1, sizeof(pgx32_driver_t));
if (!this) {
return NULL;
}
@@ -869,7 +869,7 @@ static void *pgx32_init_class(xine_t *xine, void *visual_gen)
{
pgx32_driver_class_t *class;
- class = (pgx32_driver_class_t *)xine_xmalloc(sizeof(pgx32_driver_class_t));
+ class = calloc(1, sizeof(pgx32_driver_class_t));
if (!class) {
return NULL;
}
diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c
index 4abb794d7..abda51e2b 100644
--- a/src/video_out/video_out_pgx64.c
+++ b/src/video_out/video_out_pgx64.c
@@ -561,7 +561,7 @@ static vo_frame_t *pgx64_alloc_frame(vo_driver_t *this_gen)
/*pgx64_driver_t *this = (pgx64_driver_t *)(void *)this_gen;*/
pgx64_frame_t *frame;
- frame = (pgx64_frame_t *) xine_xmalloc(sizeof(pgx64_frame_t));
+ frame = calloc(1, sizeof(pgx64_frame_t));
if (!frame) {
return NULL;
}
@@ -1352,7 +1352,7 @@ static vo_driver_t *pgx64_init_driver(video_driver_class_t *class_gen, const voi
struct fbgattr attr;
long page_size;
- this = (pgx64_driver_t *)xine_xmalloc(sizeof(pgx64_driver_t));
+ this = calloc(1, sizeof(pgx64_driver_t));
if (!this) {
return NULL;
}
@@ -1493,7 +1493,7 @@ static void *pgx64_init_class(xine_t *xine, void *visual_gen)
{
pgx64_driver_class_t *class;
- class = (pgx64_driver_class_t *)xine_xmalloc(sizeof(pgx64_driver_class_t));
+ class = calloc(1, sizeof(pgx64_driver_class_t));
if (!class) {
return NULL;
}
diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c
index 29d93d794..45cfc1eda 100644
--- a/src/video_out/video_out_raw.c
+++ b/src/video_out/video_out_raw.c
@@ -292,7 +292,7 @@ static vo_frame_t *raw_alloc_frame (vo_driver_t *this_gen)
raw_frame_t *frame;
raw_driver_t *this = (raw_driver_t *) this_gen;
- frame = (raw_frame_t *) xine_xmalloc (sizeof (raw_frame_t));
+ frame = (raw_frame_t *) calloc(1, sizeof(raw_frame_t));
if (!frame)
return NULL;
@@ -505,7 +505,7 @@ static vo_driver_t *raw_open_plugin (video_driver_class_t *class_gen, const void
raw_driver_t *this;
int i;
- this = (raw_driver_t *) xine_xmalloc (sizeof (raw_driver_t));
+ this = (raw_driver_t *) calloc(1, sizeof(raw_driver_t));
if (!this)
return NULL;
@@ -580,7 +580,7 @@ static void raw_dispose_class (video_driver_class_t *this_gen)
static void *raw_init_class (xine_t *xine, void *visual_gen)
{
- raw_class_t *this = (raw_class_t *) xine_xmalloc (sizeof (raw_class_t));
+ raw_class_t *this = (raw_class_t *) calloc(1, sizeof(raw_class_t));
this->driver_class.open_plugin = raw_open_plugin;
this->driver_class.get_identifier = raw_get_identifier;
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index 6705b4176..b53d1d31c 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.c
@@ -138,7 +138,7 @@ static vo_frame_t *sdl_alloc_frame (vo_driver_t *this_gen) {
/* sdl_driver_t *this = (sdl_driver_t *) this_gen; */
sdl_frame_t *frame ;
- frame = (sdl_frame_t *) xine_xmalloc (sizeof (sdl_frame_t));
+ frame = (sdl_frame_t *) calloc(1, sizeof(sdl_frame_t));
if (!frame)
return NULL;
@@ -475,7 +475,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XWindowAttributes window_attributes;
#endif
- this = (sdl_driver_t *) xine_xmalloc (sizeof (sdl_driver_t));
+ this = (sdl_driver_t *) calloc(1, sizeof(sdl_driver_t));
if (!this)
return NULL;
@@ -596,7 +596,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
}
SDL_QuitSubSystem (SDL_INIT_VIDEO);
- this = (sdl_class_t*) xine_xmalloc (sizeof (sdl_class_t));
+ this = (sdl_class_t*) calloc(1, sizeof(sdl_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c
index dfc4ae385..00dd80251 100644
--- a/src/video_out/video_out_stk.c
+++ b/src/video_out/video_out_stk.c
@@ -133,7 +133,7 @@ static vo_frame_t *stk_alloc_frame(vo_driver_t *this_gen) {
stk_frame_t* frame;
//printf("video_out_stk: alloc_frame()\n");
- frame = (stk_frame_t *) xine_xmalloc(sizeof(stk_frame_t));
+ frame = calloc(1, sizeof(stk_frame_t));
if (!frame)
return NULL;
@@ -389,7 +389,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
//printf("video_out_stk: open_plugin()\n");
- this = (stk_driver_t *) xine_xmalloc (sizeof (stk_driver_t));
+ this = calloc(1, sizeof (stk_driver_t));
if (!this)
return NULL;
@@ -463,7 +463,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
//printf("video_out_stk: init_class()\n");
- this = (stk_class_t *) xine_xmalloc(sizeof(stk_class_t));
+ this = calloc(1, sizeof(stk_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index b1fadbd58..f66817f36 100644
--- a/src/video_out/video_out_syncfb.c
+++ b/src/video_out/video_out_syncfb.c
@@ -478,7 +478,7 @@ static vo_frame_t* syncfb_alloc_frame(vo_driver_t* this_gen)
/* syncfb_driver_t *this = (syncfb_driver_t *) this_gen; */
syncfb_frame_t *frame;
- frame = (syncfb_frame_t *) xine_xmalloc(sizeof(syncfb_frame_t));
+ frame = calloc(1, sizeof(syncfb_frame_t));
if(!frame)
return NULL;
@@ -882,7 +882,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
display = visual->display;
- if(!(this = xine_xmalloc(sizeof (syncfb_driver_t))))
+ if(!(this = calloc(1, sizeof (syncfb_driver_t))))
return NULL;
_x_alphablend_init(&this->alphablend_extra_data, class->xine);
@@ -1105,7 +1105,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
/*
* from this point on, nothing should go wrong anymore
*/
- this = (syncfb_class_t *) xine_xmalloc (sizeof (syncfb_class_t));
+ this = calloc(1, sizeof (syncfb_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 9e3f870b1..482841a09 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.c
@@ -370,7 +370,7 @@ static vo_frame_t *vidix_alloc_frame (vo_driver_t *this_gen) {
/* vidix_driver_t *this = (vidix_driver_t *) this_gen; */
vidix_frame_t *frame ;
- frame = (vidix_frame_t *) xine_xmalloc (sizeof (vidix_frame_t));
+ frame = (vidix_frame_t *) calloc(1, sizeof(vidix_frame_t));
if (!frame)
return NULL;
@@ -947,7 +947,7 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) {
vidix_driver_t *this;
int err;
- this = (vidix_driver_t *) xine_xmalloc (sizeof (vidix_driver_t));
+ this = (vidix_driver_t *) calloc(1, sizeof(vidix_driver_t));
if (!this)
return NULL;
@@ -1089,7 +1089,7 @@ static void *init_class (xine_t *xine, void *visual_gen) {
vidix_class_t *this;
int err;
- this = (vidix_class_t *) xine_xmalloc (sizeof (vidix_class_t));
+ this = (vidix_class_t *) calloc(1, sizeof(vidix_class_t));
if (!this)
return NULL;
diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c
index 2ac579555..a5282a24f 100644
--- a/src/video_out/video_out_xcbshm.c
+++ b/src/video_out/video_out_xcbshm.c
@@ -295,7 +295,7 @@ static vo_frame_t *xshm_alloc_frame (vo_driver_t *this_gen) {
xshm_frame_t *frame;
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- frame = (xshm_frame_t *) xine_xmalloc (sizeof (xshm_frame_t));
+ frame = (xshm_frame_t *) calloc(1, sizeof(xshm_frame_t));
if (!frame)
return NULL;
@@ -1015,7 +1015,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
const xcb_query_extension_reply_t *query_extension_reply;
- this = (xshm_driver_t *) xine_xmalloc (sizeof (xshm_driver_t));
+ this = (xshm_driver_t *) calloc(1, sizeof(xshm_driver_t));
if (!this)
return NULL;
@@ -1250,7 +1250,7 @@ static void xshm_dispose_class (video_driver_class_t *this_gen) {
}
static void *xshm_init_class (xine_t *xine, void *visual_gen) {
- xshm_class_t *this = (xshm_class_t *) xine_xmalloc (sizeof (xshm_class_t));
+ xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t));
this->driver_class.open_plugin = xshm_open_plugin;
this->driver_class.get_identifier = xshm_get_identifier;
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index f83512bd0..a4a3c3812 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -186,7 +186,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) {
/* xv_driver_t *this = (xv_driver_t *) this_gen; */
xv_frame_t *frame ;
- frame = (xv_frame_t *) xine_xmalloc (sizeof (xv_frame_t));
+ frame = (xv_frame_t *) calloc(1, sizeof(xv_frame_t));
if (!frame)
return NULL;
@@ -1295,7 +1295,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
xcb_xv_adaptor_info_iterator_t adaptor_it;
xcb_xv_image_format_info_iterator_t format_it;
- this = (xv_driver_t *) xine_xmalloc (sizeof (xv_driver_t));
+ this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t));
if (!this)
return NULL;
@@ -1629,7 +1629,7 @@ static void dispose_class (video_driver_class_t *this_gen) {
}
static void *init_class (xine_t *xine, void *visual_gen) {
- xv_class_t *this = (xv_class_t *) xine_xmalloc (sizeof (xv_class_t));
+ xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index ec97aa5c1..74791f145 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -387,7 +387,7 @@ static vo_frame_t *xshm_alloc_frame (vo_driver_t *this_gen) {
xshm_frame_t *frame;
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- frame = (xshm_frame_t *) xine_xmalloc (sizeof (xshm_frame_t));
+ frame = (xshm_frame_t *) calloc(1, sizeof(xshm_frame_t));
if (!frame)
return NULL;
@@ -1083,7 +1083,7 @@ static vo_driver_t *xshm_open_plugin_2 (video_driver_class_t *class_gen, const v
int cpu_byte_order;
XColor dummy;
- this = (xshm_driver_t *) xine_xmalloc (sizeof (xshm_driver_t));
+ this = (xshm_driver_t *) calloc(1, sizeof(xshm_driver_t));
if (!this)
return NULL;
@@ -1310,7 +1310,7 @@ static void xshm_dispose_class (video_driver_class_t *this_gen) {
}
static void *xshm_init_class (xine_t *xine, void *visual_gen) {
- xshm_class_t *this = (xshm_class_t *) xine_xmalloc (sizeof (xshm_class_t));
+ xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t));
this->driver_class.open_plugin = xshm_open_plugin_old;
this->driver_class.get_identifier = xshm_get_identifier;
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 65559c16f..e1f6d0de0 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -208,7 +208,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) {
/* xv_driver_t *this = (xv_driver_t *) this_gen; */
xv_frame_t *frame ;
- frame = (xv_frame_t *) xine_xmalloc (sizeof (xv_frame_t));
+ frame = (xv_frame_t *) calloc(1, sizeof(xv_frame_t));
if (!frame)
return NULL;
@@ -1340,7 +1340,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
XvAdaptorInfo *adaptor_info;
unsigned int adaptor_num;
- this = (xv_driver_t *) xine_xmalloc (sizeof (xv_driver_t));
+ this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t));
if (!this)
return NULL;
@@ -1712,7 +1712,7 @@ static void dispose_class (video_driver_class_t *this_gen) {
}
static void *init_class (xine_t *xine, void *visual_gen) {
- xv_class_t *this = (xv_class_t *) xine_xmalloc (sizeof (xv_class_t));
+ xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t));
this->driver_class.open_plugin = open_plugin_old;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c
index a17e4d6a0..79c2a80a3 100644
--- a/src/video_out/video_out_xvmc.c
+++ b/src/video_out/video_out_xvmc.c
@@ -556,7 +556,7 @@ static vo_frame_t *xvmc_alloc_frame (vo_driver_t *this_gen) {
lprintf ("xvmc_alloc_frame\n");
- frame = (xvmc_frame_t *) xine_xmalloc (sizeof (xvmc_frame_t));
+ frame = calloc(1, sizeof (xvmc_frame_t));
if (!frame)
return NULL;
@@ -595,8 +595,8 @@ static cxid_t *xvmc_set_context (xvmc_driver_t *this,
/* initialize block & macro block pointers first time */
if(macroblocks->blocks == NULL || macroblocks->macro_blocks == NULL) {
- macroblocks->blocks = xine_xmalloc(sizeof(XvMCBlockArray));
- macroblocks->macro_blocks = xine_xmalloc(sizeof(XvMCMacroBlockArray));
+ macroblocks->blocks = calloc(1, sizeof(XvMCBlockArray));
+ macroblocks->macro_blocks = calloc(1, sizeof(XvMCMacroBlockArray));
lprintf("macroblocks->blocks %lx ->macro_blocks %lx\n",
macroblocks->blocks,macroblocks->macro_blocks);
@@ -1348,7 +1348,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
display = visual->display;
/* TODO ??? */
- this = (xvmc_driver_t *) xine_xmalloc (sizeof (xvmc_driver_t));
+ this = calloc(1, sizeof (xvmc_driver_t));
if (!this)
return NULL;
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index 28679e95d..b016a8bd1 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -162,14 +162,10 @@ static void xxmc_xvmc_surface_handler_construct(xxmc_driver_t *this)
xvmc_surface_handler_t *handler = &this->xvmc_surf_handler;
pthread_mutex_init(&handler->mutex,NULL);
- for (i=0; i<XVMC_MAX_SURFACES; ++i) {
- handler->surfInUse[i] = 0;
- handler->surfValid[i] = 0;
- }
- for (i=0; i<XVMC_MAX_SUBPICTURES; ++i) {
- handler->subInUse[i] = 0;
- handler->subValid[i] = 0;
- }
+ memset(handler->surfInUse, 0, sizeof(handler->surfInUse));
+ memset(handler->surfValid, 0, sizeof(handler->surfValid));
+ memset(handler->subInUse, 0, sizeof(handler->subInUse));
+ memset(handler->subValid, 0, sizeof(handler->subValid));
}
static void xxmc_xvmc_destroy_surfaces(xxmc_driver_t *this)
@@ -550,7 +546,7 @@ static vo_frame_t *xxmc_alloc_frame (vo_driver_t *this_gen) {
xxmc_driver_t *this = (xxmc_driver_t *) this_gen;
xxmc_frame_t *frame ;
- frame = (xxmc_frame_t *) xine_xmalloc (sizeof (xxmc_frame_t));
+ frame = calloc(1, sizeof (xxmc_frame_t));
if (!frame)
return NULL;
@@ -2373,7 +2369,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
int use_more_frames;
int use_unscaled;
- this = (xxmc_driver_t *) xine_xmalloc (sizeof (xxmc_driver_t));
+ this = calloc(1, sizeof (xxmc_driver_t));
if (!this)
return NULL;
@@ -2744,7 +2740,7 @@ static void dispose_class (video_driver_class_t *this_gen) {
}
static void *init_class (xine_t *xine, void *visual_gen) {
- xxmc_class_t *this = (xxmc_class_t *) xine_xmalloc (sizeof (xxmc_class_t));
+ xxmc_class_t *this = calloc(1, sizeof (xxmc_class_t));
this->driver_class.open_plugin = open_plugin;
this->driver_class.get_identifier = get_identifier;
diff --git a/src/video_out/x11osd.c b/src/video_out/x11osd.c
index e0cb6f1f6..4d0e46287 100644
--- a/src/video_out/x11osd.c
+++ b/src/video_out/x11osd.c
@@ -245,7 +245,7 @@ x11osd_create (xine_t *xine, Display *display, int screen, Window window, enum x
XSetWindowAttributes attr;
XWindowAttributes getattr;
- osd = xine_xmalloc (sizeof (x11osd));
+ osd = calloc(1, sizeof(x11osd));
if (!osd)
return NULL;
diff --git a/src/video_out/xcbosd.c b/src/video_out/xcbosd.c
index 4bb2b60af..d8cf119a2 100644
--- a/src/video_out/xcbosd.c
+++ b/src/video_out/xcbosd.c
@@ -238,7 +238,7 @@ xcbosd *xcbosd_create(xine_t *xine, xcb_connection_t *connection, xcb_screen_t *
xcb_void_cookie_t generic_cookie;
xcb_generic_error_t *generic_error;
- osd = xine_xmalloc (sizeof (xcbosd));
+ osd = calloc(1, sizeof(xcbosd));
if (!osd)
return NULL;
diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c
index c98dd518f..fb2d63e6c 100644
--- a/src/video_out/yuv2rgb.c
+++ b/src/video_out/yuv2rgb.c
@@ -3144,7 +3144,7 @@ static void yuy22rgb_c_init (yuv2rgb_factory_t *this)
static yuv2rgb_t *yuv2rgb_create_converter (yuv2rgb_factory_t *factory) {
- yuv2rgb_t *this = xine_xmalloc (sizeof (yuv2rgb_t));
+ yuv2rgb_t *this = calloc(1, sizeof(yuv2rgb_t));
this->swapped = factory->swapped;
this->cmap = factory->cmap;
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index 8635526ed..22e67efa8 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -38,8 +38,6 @@
#include "xineutils.h"
#include "yuv2rgb.h"
-#define MIN(a, b) (((a) < (b)) ? (a) : (b))
-
static void mlib_yuv420_rgb24(yuv2rgb_t *this,
uint8_t * image, uint8_t * py,
uint8_t * pu, uint8_t * pv)
diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c
index a7ab33cf8..6f3ac3ebe 100644
--- a/src/xine-engine/alphablend.c
+++ b/src/xine-engine/alphablend.c
@@ -1110,12 +1110,12 @@ static uint8_t *(*blend_yuv_grow_extra_data(alphablend_t *extra_data, int osd_wi
uint8_t *data[ 3 ][ 2 ];
} *header = (struct header_s *)extra_data->buffer;
- int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]);
+ size_t needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]);
if (extra_data->buffer_size < needed_buffer_size) {
free(extra_data->buffer);
- header = xine_xmalloc(needed_buffer_size);
+ header = calloc(1, needed_buffer_size);
if (!header) {
extra_data->buffer_size = 0;
return 0;
@@ -1552,12 +1552,12 @@ static uint8_t *(*blend_yuy2_grow_extra_data(alphablend_t *extra_data, int osd_w
uint8_t *data[ 3 ];
} *header = (struct header_s *)extra_data->buffer;
- int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ]);
+ size_t needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ]);
if (extra_data->buffer_size < needed_buffer_size) {
free(extra_data->buffer);
- header = xine_xmalloc(needed_buffer_size);
+ header = calloc(1, needed_buffer_size);
if (!header) {
extra_data->buffer_size = 0;
return 0;
diff --git a/src/xine-engine/alphablend.h b/src/xine-engine/alphablend.h
index 3c9a693d9..7aa63b306 100644
--- a/src/xine-engine/alphablend.h
+++ b/src/xine-engine/alphablend.h
@@ -39,22 +39,7 @@ typedef struct {
void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED;
void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED;
-/* _MSC_VER port changes */
-#undef ATTRIBUTE_PACKED
-#undef PRAGMA_PACK_BEGIN
-#undef PRAGMA_PACK_END
-
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined(__ICC)
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#define PRAGMA_PACK 0
-#endif
-
-#if !defined(ATTRIBUTE_PACKED)
-#define ATTRIBUTE_PACKED
-#define PRAGMA_PACK 1
-#endif
-
-#if PRAGMA_PACK
+#if !SUPPORT_ATTRIBUTE_PACKED
#pragma pack(8)
#endif
@@ -63,10 +48,10 @@ typedef struct { /* CLUT == Color LookUp Table */
uint8_t cr;
uint8_t y;
uint8_t foo;
-} ATTRIBUTE_PACKED clut_t;
+} XINE_PACKED clut_t;
-#if PRAGMA_PACK
+#if !SUPPORT_ATTRIBUTE_PACKED
#pragma pack()
#endif
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 4dcdb5af0..d28c45ea6 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -290,11 +290,11 @@ struct audio_fifo_s {
static int ao_get_property (xine_audio_port_t *this_gen, int property);
static int ao_set_property (xine_audio_port_t *this_gen, int property, int value);
-static audio_fifo_t *fifo_new (xine_t *xine) {
+static audio_fifo_t *XINE_MALLOC fifo_new (xine_t *xine) {
audio_fifo_t *fifo;
- fifo = (audio_fifo_t *) xine_xmalloc (sizeof (audio_fifo_t));
+ fifo = (audio_fifo_t *) calloc(1, sizeof(audio_fifo_t));
if (!fifo)
return NULL;
@@ -2051,7 +2051,7 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
static const char* resample_modes[] = {"auto", "off", "on", NULL};
static const char* av_sync_methods[] = {"metronom feedback", "resample", NULL};
- this = xine_xmalloc (sizeof (aos_t)) ;
+ this = calloc(1, sizeof(aos_t)) ;
this->driver = driver;
this->xine = xine;
@@ -2085,7 +2085,7 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
this->grab_only = grab_only;
this->flush_audio_driver = 0;
this->discard_buffers = 0;
- this->zero_space = xine_xmalloc (ZERO_BUF_SIZE * 4 * 6); /* MAX as 32bit, 6 channels. */
+ this->zero_space = calloc (1, ZERO_BUF_SIZE * 4 * 6); /* MAX as 32bit, 6 channels. */
pthread_mutex_init( &this->flush_audio_driver_lock, NULL );
pthread_cond_init( &this->flush_audio_driver_reached, NULL );
@@ -2196,8 +2196,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
audio_buffer_t *buf;
- buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t));
- buf->mem = xine_xmalloc (AUDIO_BUF_SIZE);
+ buf = (audio_buffer_t *) calloc(1, sizeof(audio_buffer_t));
+ buf->mem = calloc (1, AUDIO_BUF_SIZE);
buf->mem_size = AUDIO_BUF_SIZE;
buf->extra_info = malloc(sizeof(extra_info_t));
@@ -2211,8 +2211,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
audio_buffer_t *buf;
- buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t));
- buf->mem = xine_xmalloc (4*AUDIO_BUF_SIZE);
+ buf = (audio_buffer_t *) calloc(1, sizeof(audio_buffer_t));
+ buf->mem = calloc(4, AUDIO_BUF_SIZE);
buf->mem_size = 4*AUDIO_BUF_SIZE;
buf->extra_info = malloc(sizeof(extra_info_t));
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index c4581ec24..5f4420363 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -259,7 +259,7 @@ struct audio_driver_class_s {
* this initiates the audio_out sync routines
* found in ./src/xine-engine/audio_out.c
*/
-xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_PROTECTED;
+xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_MALLOC XINE_PROTECTED;
/*
* audio output modes + capabilities
diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c
index 1d2f01366..5ce1619d1 100644
--- a/src/xine-engine/broadcaster.c
+++ b/src/xine-engine/broadcaster.c
@@ -323,7 +323,7 @@ broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port)
signal( SIGPIPE, SIG_IGN );
- this = xine_xmalloc(sizeof(broadcaster_t));
+ this = calloc(1, sizeof(broadcaster_t));
this->port = port;
this->stream = stream;
this->msock = msock;
diff --git a/src/xine-engine/broadcaster.h b/src/xine-engine/broadcaster.h
index 093fb4af0..0c6a291eb 100644
--- a/src/xine-engine/broadcaster.h
+++ b/src/xine-engine/broadcaster.h
@@ -33,7 +33,7 @@ extern "C" {
typedef struct broadcaster_s broadcaster_t;
-broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_PROTECTED;
+broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) XINE_MALLOC XINE_PROTECTED;
void _x_close_broadcaster(broadcaster_t *this) XINE_PROTECTED;
int _x_get_broadcaster_port(broadcaster_t *this) XINE_PROTECTED;
diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c
index 93ad75ba0..417fee745 100644
--- a/src/xine-engine/buffer.c
+++ b/src/xine-engine/buffer.c
@@ -500,7 +500,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) {
int alignment = 2048;
unsigned char *multi_buffer = NULL;
- this = xine_xmalloc (sizeof (fifo_buffer_t));
+ this = calloc(1, sizeof(fifo_buffer_t));
this->first = NULL;
this->last = NULL;
@@ -551,7 +551,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) {
for (i = 0; i<num_buffers; i++) {
buf_element_t *buf;
- buf = xine_xmalloc (sizeof (buf_element_t));
+ buf = calloc(1, sizeof(buf_element_t));
buf->mem = multi_buffer;
multi_buffer += buf_size;
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index ebb308a04..5e43028e8 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -607,8 +607,8 @@ struct fifo_buffer_s
* allocate num_buffers of buf_size bytes each
*/
-fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
-fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
+fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
+fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
/* return BUF_VIDEO_xxx given the fourcc
@@ -627,7 +627,7 @@ uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED;
char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
-#ifndef ATTRIBUTE_PACKED
+#ifndef SUPPORT_ATTRIBUTE_PACKED
/* no attribute packed? let's try with pragma pack as a last resort */
#pragma pack(2)
#endif
@@ -636,7 +636,7 @@ char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
* - will always use machine endian format, so demuxers reading
* stuff from win32 formats must use the function below.
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int32_t biSize;
int32_t biWidth;
int32_t biHeight;
@@ -653,7 +653,7 @@ typedef struct __attribute__((__packed__)) {
/* this is xine version of WAVEFORMATEX
* (the same comments from xine_bmiheader)
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int16_t wFormatTag;
int16_t nChannels;
int32_t nSamplesPerSec;
@@ -662,7 +662,7 @@ typedef struct __attribute__((__packed__)) {
int16_t wBitsPerSample;
int16_t cbSize;
} xine_waveformatex;
-#ifndef ATTRIBUTE_PACKED
+#ifndef SUPPORT_ATTRIBUTE_PACKED
#pragma pack()
#endif
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index 2dc89f0af..cfe6f6a35 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -319,11 +319,11 @@ static void config_insert(config_values_t *this, cfg_entry_t *new_entry) {
this->first = new_entry;
}
-static cfg_entry_t *config_add (config_values_t *this, const char *key, int exp_level) {
+static cfg_entry_t *XINE_MALLOC config_add (config_values_t *this, const char *key, int exp_level) {
cfg_entry_t *entry;
- entry = (cfg_entry_t *) xine_xmalloc (sizeof (cfg_entry_t));
+ entry = calloc (1, sizeof (cfg_entry_t));
entry->config = this;
entry->key = strdup(key);
entry->type = XINE_CONFIG_TYPE_UNKNOWN;
@@ -369,8 +369,7 @@ static const char *config_translate_key (const char *key) {
*/
if (!strncmp (key, "decoder.", 8) &&
!strcmp (key + (trans = strlen (key)) - 9, "_priority")) {
- newkey = realloc (newkey, trans + 27 - 17); /* diff. in string lengths */
- sprintf (newkey, "engine.decoder_priorities.%.*s", trans - 17, key + 8);
+ asprintf (&newkey, "engine.decoder_priorities.%.*s", trans - 17, key + 8);
return newkey;
}
@@ -1005,7 +1004,7 @@ void xine_config_save (xine_t *xine, const char *filename) {
char *buf = NULL;
size_t rlen;
- buf = (char *) xine_xmalloc(config_stat.st_size + 1);
+ buf = (char *) malloc(config_stat.st_size + 1);
if((rlen = fread(buf, 1, config_stat.st_size, f_config)) && ((off_t)rlen == config_stat.st_size)) {
(void) fwrite(buf, 1, rlen, f_backup);
}
@@ -1204,7 +1203,7 @@ config_values_t *_x_config_init (void) {
config_values_t *this;
pthread_mutexattr_t attr;
- if (!(this = xine_xmalloc(sizeof(config_values_t)))) {
+ if (!(this = calloc(1, sizeof(config_values_t)))) {
printf ("configfile: could not allocate config object\n");
_x_abort();
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
index e21b08db0..e1dca7b18 100644
--- a/src/xine-engine/configfile.h
+++ b/src/xine-engine/configfile.h
@@ -200,7 +200,7 @@ struct config_values_s {
/*
* allocate and init a new xine config object
*/
-config_values_t *_x_config_init (void) XINE_PROTECTED;
+config_values_t *_x_config_init (void) XINE_MALLOC XINE_PROTECTED;
/*
* interpret stream_setup part of mrls for config value changes
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 24ee1b86d..257a72383 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -47,11 +47,6 @@
#include <winsock.h>
#endif
-#ifdef MIN
-#undef MIN
-#endif
-#define MIN(a,b) ( (a) < (b) ) ? (a) : (b)
-
/*
* Flush audio and video buffers. It is called from demuxers on
* seek/stop, and may be useful when user input changes a stream and
@@ -440,7 +435,7 @@ int _x_demux_read_header( input_plugin_t *input, unsigned char *buffer, off_t si
read_size = input->read(input, buffer, size);
input->seek(input, 0, SEEK_SET);
} else if (input->get_capabilities(input) & INPUT_CAP_PREVIEW) {
- buf = xine_xmalloc(MAX_PREVIEW_SIZE);
+ buf = malloc(MAX_PREVIEW_SIZE);
read_size = input->get_optional_data(input, buf, INPUT_OPTIONAL_DATA_PREVIEW);
read_size = MIN (read_size, size);
memcpy(buffer, buf, read_size);
@@ -657,7 +652,7 @@ void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative,
xine_mrl_reference_data_ext_t *e;
xine_mrl_reference_data_t *b;
} data;
- int mrl_len = strlen (mrl);
+ const size_t mrl_len = strlen (mrl);
if (!title)
title = "";
diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c
index 1ac4ed982..242805915 100644
--- a/src/xine-engine/info_helper.c
+++ b/src/xine-engine/info_helper.c
@@ -131,7 +131,7 @@ uint32_t _x_stream_info_get_public(xine_stream_t *stream, int info) {
* at the end of the string
*/
static void meta_info_chomp(char *str) {
- int i, len;
+ size_t i, len;
len = strlen(str);
if (!len)
@@ -340,11 +340,10 @@ void _x_meta_info_set_utf8(xine_stream_t *stream, int info, const char *str) {
void _x_meta_info_n_set(xine_stream_t *stream, int info, const char *buf, int len) {
pthread_mutex_lock(&stream->meta_mutex);
if(meta_valid(info) && len) {
- char *str = xine_xmalloc(len + 1);
+ char *str = strndup(buf, len);
- snprintf(str, len + 1 , "%s", buf);
- meta_info_set_unlocked(stream, info, (const char *) &str[0]);
- free(str);
+ meta_info_set_unlocked(stream, info, str);
+ free(str);
}
pthread_mutex_unlock(&stream->meta_mutex);
}
@@ -359,7 +358,7 @@ void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) {
va_list ap;
char *args[1025];
char *buf;
- int n, len;
+ size_t n, len;
len = n = 0;
@@ -376,7 +375,7 @@ void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) {
if(len) {
char *p, *meta;
- p = meta = (char *) xine_xmalloc(len + 1);
+ p = meta = (char *) malloc(len + 1);
n = 0;
while(args[n]) {
diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c
index 30b1ba4aa..4eb524af6 100644
--- a/src/xine-engine/input_cache.c
+++ b/src/xine-engine/input_cache.c
@@ -356,7 +356,7 @@ input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahe
lprintf("mrl: %s\n", main_plugin->get_mrl(main_plugin));
- this = (cache_input_plugin_t *)xine_xmalloc(sizeof(cache_input_plugin_t));
+ this = calloc(1, sizeof(cache_input_plugin_t));
if (!this)
return NULL;
@@ -386,7 +386,7 @@ input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahe
this->buf_size = DEFAULT_BUFFER_SIZE;
}
- this->buf = (char *)xine_xmalloc(this->buf_size);
+ this->buf = calloc(1, this->buf_size);
if (!this->buf) {
free (this);
return NULL;
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c
index 0c185aa1b..8db7eaaf5 100644
--- a/src/xine-engine/input_rip.c
+++ b/src/xine-engine/input_rip.c
@@ -517,10 +517,9 @@ static void rip_plugin_dispose(input_plugin_t *this_gen) {
* returns non-zero, if there was enough space
*/
static int dir_file_concat(char *target, size_t maxlen, const char *dir, const char *name) {
- size_t len_dir, len_name, pos_name = 0;
-
- len_name = strlen(name);
- len_dir = strlen(dir);
+ size_t len_name = strlen(name);
+ size_t len_dir = strlen(dir);
+ size_t pos_name = 0;
/* remove slashes */
if (dir[len_dir - 1] == '/') len_dir--;
@@ -585,7 +584,7 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f
return NULL;
}
- this = (rip_input_plugin_t *)xine_xmalloc(sizeof(rip_input_plugin_t));
+ this = calloc(1, sizeof(rip_input_plugin_t));
this->main_input_plugin = main_plugin;
this->stream = stream;
this->curpos = 0;
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index b8471e907..031c94984 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -313,7 +313,6 @@ static void _insert_node (xine_t *this,
const input_info_t *input_old;
uint32_t *types;
char key[80];
- char desc[100];
int i;
_x_assert(list);
@@ -325,8 +324,8 @@ static void _insert_node (xine_t *this,
return;
}
- entry = xine_xmalloc(sizeof(plugin_node_t));
- entry->info = xine_xmalloc(sizeof(plugin_info_t));
+ entry = calloc(1, sizeof(plugin_node_t));
+ entry->info = calloc(1, sizeof(plugin_info_t));
*(entry->info) = *info;
entry->info->id = strdup(info->id);
entry->info->init = info->init;
@@ -339,7 +338,7 @@ static void _insert_node (xine_t *this,
case PLUGIN_VIDEO_OUT:
vo_old = info->special_info;
- vo_new = xine_xmalloc(sizeof(vo_info_t));
+ vo_new = calloc(1, sizeof(vo_info_t));
entry->priority = vo_new->priority = vo_old->priority;
vo_new->visual_type = vo_old->visual_type;
entry->info->special_info = vo_new;
@@ -347,7 +346,7 @@ static void _insert_node (xine_t *this,
case PLUGIN_AUDIO_OUT:
ao_old = info->special_info;
- ao_new = xine_xmalloc(sizeof(ao_info_t));
+ ao_new = calloc(1, sizeof(ao_info_t));
entry->priority = ao_new->priority = ao_old->priority;
entry->info->special_info = ao_new;
break;
@@ -356,7 +355,7 @@ static void _insert_node (xine_t *this,
case PLUGIN_VIDEO_DECODER:
case PLUGIN_SPU_DECODER:
decoder_old = info->special_info;
- decoder_new = xine_xmalloc(sizeof(decoder_info_t));
+ decoder_new = calloc(1, sizeof(decoder_info_t));
if (decoder_old == NULL) {
if (file)
xprintf (this, XINE_VERBOSITY_DEBUG,
@@ -368,22 +367,21 @@ static void _insert_node (xine_t *this,
info->id);
_x_abort();
}
- for (i=0; decoder_old->supported_types[i] != 0; ++i);
- types = xine_xmalloc((i+1)*sizeof(uint32_t));
- for (i=0; decoder_old->supported_types[i] != 0; ++i){
- types[i] = decoder_old->supported_types[i];
+ {
+ size_t supported_types_size;
+ for (supported_types_size=0; decoder_old->supported_types[supported_types_size] != 0; ++supported_types_size);
+ types = calloc((supported_types_size+1), sizeof(uint32_t));
+ memcpy(types, decoder_old->supported_types, supported_types_size*sizeof(uint32_t));
+ decoder_new->supported_types = types;
}
- decoder_new->supported_types = types;
entry->priority = decoder_new->priority = decoder_old->priority;
snprintf(key, sizeof(key), "engine.decoder_priorities.%s", info->id);
- snprintf(desc, sizeof(desc), _("priority for %s decoder"), info->id);
/* write the description on the heap because the config system
* does not strdup() it, so we have to provide a different pointer
* for each decoder */
for (i = 0; catalog->prio_desc[i]; i++);
- catalog->prio_desc[i] = malloc(strlen(desc) + 1);
- strcpy(catalog->prio_desc[i], desc);
+ asprintf(&catalog->prio_desc[i], _("priority for %s decoder"), info->id);
this->config->register_num (this->config,
key,
0,
@@ -402,14 +400,14 @@ static void _insert_node (xine_t *this,
case PLUGIN_POST:
post_old = info->special_info;
- post_new = xine_xmalloc(sizeof(post_info_t));
+ post_new = calloc(1, sizeof(post_info_t));
post_new->type = post_old->type;
entry->info->special_info = post_new;
break;
case PLUGIN_DEMUX:
demux_old = info->special_info;
- demux_new = xine_xmalloc(sizeof(demuxer_info_t));
+ demux_new = calloc(1, sizeof(demuxer_info_t));
if (demux_old) {
entry->priority = demux_new->priority = demux_old->priority;
@@ -426,7 +424,7 @@ static void _insert_node (xine_t *this,
case PLUGIN_INPUT:
input_old = info->special_info;
- input_new = xine_xmalloc(sizeof(input_info_t));
+ input_new = calloc(1, sizeof(input_info_t));
if (input_old) {
entry->priority = input_new->priority = input_old->priority;
@@ -463,12 +461,12 @@ static int _plugin_node_comparator(void *a, void *b) {
}
}
-static plugin_catalog_t *_new_catalog(void){
+static plugin_catalog_t *XINE_MALLOC _new_catalog(void){
plugin_catalog_t *catalog;
int i;
- catalog = xine_xmalloc(sizeof(plugin_catalog_t));
+ catalog = calloc(1, sizeof(plugin_catalog_t));
for (i = 0; i < PLUGIN_TYPE_MAX; i++) {
catalog->plugin_lists[i] = xine_sarray_new(0, _plugin_node_comparator);
@@ -556,25 +554,20 @@ static void collect_plugins(xine_t *this, char *path){
dir = opendir(path);
if (dir) {
struct dirent *pEntry;
- size_t path_len, str_size;
- char *str = NULL;
- path_len = strlen(path);
- str_size = path_len * 2 + 2; /* +2 for '/' and '\0' */
- str = malloc(str_size);
- xine_fast_memcpy(str, path, path_len);
- str[path_len] = '/';
- str[path_len + 1] = '\0';
+ size_t path_len = strlen(path);
+ size_t str_size = path_len * 2 + 2; /* +2 for '/' and '\0' */
+ char *str = malloc(str_size);
+ sprintf(str, "%s/", path);
while ((pEntry = readdir (dir)) != NULL) {
- size_t new_str_size, d_len;
void *lib = NULL;
plugin_info_t *info = NULL;
struct stat statbuffer;
- d_len = strlen(pEntry->d_name);
- new_str_size = path_len + d_len + 2;
+ size_t d_len = strlen(pEntry->d_name);
+ size_t new_str_size = path_len + d_len + 2;
if (str_size < new_str_size) {
str_size = new_str_size + new_str_size / 2;
str = realloc(str, str_size);
@@ -941,8 +934,8 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
if( node ) {
xine_sarray_add (plugins, node);
}
- node = xine_xmalloc(sizeof(plugin_node_t));
- file = xine_xmalloc(sizeof(plugin_file_t));
+ node = calloc(1, sizeof(plugin_node_t));
+ file = calloc(1, sizeof(plugin_file_t));
node->file = file;
file->filename = strdup(line+1);
node->info = calloc(2, sizeof(plugin_info_t));
@@ -981,34 +974,34 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
case PLUGIN_VIDEO_OUT:
node->info->special_info = vo_info =
- xine_xmalloc(sizeof(vo_info_t));
+ calloc(1, sizeof(vo_info_t));
break;
case PLUGIN_AUDIO_OUT:
node->info->special_info = ao_info =
- xine_xmalloc(sizeof(ao_info_t));
+ calloc(1, sizeof(ao_info_t));
break;
case PLUGIN_DEMUX:
node->info->special_info = demuxer_info =
- xine_xmalloc(sizeof(demuxer_info_t));
+ calloc(1, sizeof(demuxer_info_t));
break;
case PLUGIN_INPUT:
node->info->special_info = input_info =
- xine_xmalloc(sizeof(input_info_t));
+ calloc(1, sizeof(input_info_t));
break;
case PLUGIN_AUDIO_DECODER:
case PLUGIN_VIDEO_DECODER:
case PLUGIN_SPU_DECODER:
node->info->special_info = decoder_info =
- xine_xmalloc(sizeof(decoder_info_t));
+ calloc(1, sizeof(decoder_info_t));
break;
case PLUGIN_POST:
node->info->special_info = post_info =
- xine_xmalloc(sizeof(post_info_t));
+ calloc(1, sizeof(post_info_t));
break;
}
@@ -1072,15 +1065,13 @@ static void save_catalog (xine_t *this) {
char *cachefile, *dirfile;
const char *relname = CACHE_CATALOG_FILE;
const char *dirname = CACHE_CATALOG_DIR;
+
+ const char *const homedir = xine_get_homedir();
- cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(relname) + 2);
- sprintf(cachefile, "%s/%s", xine_get_homedir(), relname);
+ asprintf(&cachefile, "%s/%s", homedir, relname);
/* make sure homedir (~/.xine) exists */
- dirfile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(dirname) + 2);
- sprintf(dirfile, "%s/%s", xine_get_homedir(), dirname);
+ asprintf(&dirfile, "%s/%s", homedir, dirname);
mkdir (dirfile, 0755);
free (dirfile);
@@ -1107,9 +1098,7 @@ static void load_cached_catalog (xine_t *this) {
char *cachefile;
const char *relname = CACHE_CATALOG_FILE;
- cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) +
- strlen(relname) + 2);
- sprintf(cachefile, "%s/%s", xine_get_homedir(), relname);
+ asprintf(&cachefile, "%s/%s", xine_get_homedir(), relname);
if( (fp = fopen(cachefile,"r")) != NULL ) {
load_plugin_list (fp, this->plugin_catalog->cache_list);
@@ -2420,6 +2409,32 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) {
* their disposal if they are still in use => post.c handles the counting for us */
}
+/**
+ * @brief Concantenates an array of strings into a single
+ * string separated with a given string.
+ *
+ * @param strings Array of strings to concatenate.
+ * @param count Number of elements in the @p strings array.
+ * @param joining String to use to join the various strings together.
+ * @param final_length The pre-calculated final length of the string.
+ */
+static char *_x_concatenate_with_string(char **strings, size_t count, char *joining, size_t final_length) {
+ size_t i;
+ char *const result = malloc(final_length+1); /* Better be safe */
+ char *str = result;
+
+ size_t pos = 0;
+ for(i = 0; i < count; i++, strings++) {
+ if ( *strings ) {
+ int offset = snprintf(str, final_length, "%s%s", *strings, joining);
+ str += offset;
+ final_length -= offset;
+ }
+ }
+
+ return result;
+}
+
/* get a list of file extensions for file types supported by xine
* the list is separated by spaces
*
@@ -2427,66 +2442,35 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) {
char *xine_get_file_extensions (xine_t *self) {
plugin_catalog_t *catalog = self->plugin_catalog;
- int len, pos;
- plugin_node_t *node;
- char *str;
- int list_id, list_size;
+ int list_id;
pthread_mutex_lock (&catalog->lock);
- /* calc length of output */
+ /* calc length of output string and create an array of strings to
+ concatenate */
+ size_t len = 0;
+ const int list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
+ const char **extensions = calloc(list_size, sizeof(char*));
- len = 0;
- list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
for (list_id = 0; list_id < list_size; list_id++) {
- demux_class_t *cls;
- const char *exts;
-
- node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
+ plugin_node_t *const node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
-
- cls = (demux_class_t *)node->plugin_class;
-
- if((exts = cls->get_extensions(cls)) && *exts)
- len += strlen(exts) + 1;
- }
- }
-
- /* create output */
- str = malloc (len); /* '\0' space is already counted in the previous loop */
- pos = 0;
-
- list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
- for (list_id = 0; list_id < list_size; list_id++) {
- demux_class_t *cls;
- const char *e;
- int l;
-
- node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
- if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
-
- cls = (demux_class_t *)node->plugin_class;
-
- if((e = cls->get_extensions (cls)) && *e) {
- l = strlen(e);
- memcpy (&str[pos], e, l);
-
- pos += l;
-
- /* Don't add ' ' char at the end of str */
- if((pos + 1) < len) {
- str[pos] = ' ';
- pos++;
- }
- }
+ demux_class_t *const cls = (demux_class_t *)node->plugin_class;
+ if( (extensions[list_id] = cls->get_extensions(cls)) != NULL )
+ len += strlen(extensions[list_id]) +1;
}
}
- str[pos] = 0;
+ /* create output string */
+ char *const result = _x_concatenate_with_string(extensions, list_size, " ", len);
+ free(extensions);
+ /* Drop the last whitespace */
+ result[len-1] = '\0';
+
pthread_mutex_unlock (&catalog->lock);
- return str;
+ return result;
}
/* get a list of mime types supported by xine
@@ -2495,65 +2479,34 @@ char *xine_get_file_extensions (xine_t *self) {
char *xine_get_mime_types (xine_t *self) {
plugin_catalog_t *catalog = self->plugin_catalog;
- int len, pos;
- plugin_node_t *node;
- char *str;
- int list_id, list_size;
+ int list_id;
pthread_mutex_lock (&catalog->lock);
/* calc length of output */
- len = 0;
- list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
+ /* calc length of output string and create an array of strings to
+ concatenate */
+ size_t len = 0;
+ const int list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
+ const char **mimetypes = calloc(list_size, sizeof(char*));
for (list_id = 0; list_id < list_size; list_id++) {
- demux_class_t *cls;
- const char *s;
-
- node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
+ plugin_node_t *const node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
-
- cls = (demux_class_t *)node->plugin_class;
-
- s = cls->get_mimetypes (cls);
- if (s)
- len += strlen(s);
+ demux_class_t *const cls = (demux_class_t *)node->plugin_class;
+ if( (mimetypes[list_id] = cls->get_mimetypes(cls)) != NULL )
+ len += strlen(mimetypes[list_id]);
}
}
- /* create output */
-
- str = malloc (len+1);
- pos = 0;
-
- list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
-
- for (list_id = 0; list_id < list_size; list_id++) {
- demux_class_t *cls;
- const char *s;
- int l;
+ /* create output string */
+ char *const result = _x_concatenate_with_string(mimetypes, list_size, "", len);
+ free(mimetypes);
- node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
- if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
-
- cls = (demux_class_t *)node->plugin_class;
-
- s = cls->get_mimetypes (cls);
- if (s) {
- l = strlen(s);
- memcpy (&str[pos], s, l);
-
- pos += l;
- }
- }
- }
-
- str[pos] = 0;
-
pthread_mutex_unlock (&catalog->lock);
- return str;
+ return result;
}
@@ -2566,47 +2519,38 @@ char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) {
plugin_catalog_t *catalog = self->plugin_catalog;
plugin_node_t *node;
char *id = NULL;
- char *mime_arg, *mime_demux;
- char *s;
- const char *mt;
int list_id, list_size;
+ const size_t mime_type_len = strlen (mime_type);
- /* create a copy and convert to lower case */
- mime_arg = strdup(mime_type);
- for(s=mime_arg; *s; s++)
- *s = tolower(*s);
-
pthread_mutex_lock (&catalog->lock);
list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_DEMUX - 1]);
for (list_id = 0; (list_id < list_size) && !id; list_id++) {
- demux_class_t *cls;
node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
- cls = (demux_class_t *)node->plugin_class;
-
- mt = cls->get_mimetypes (cls);
- if (mt) {
- mime_demux = strdup(mt);
-
- for(s=mime_demux; *s; s++)
- *s = tolower(*s);
-
- if( strstr(mime_demux, mime_arg) )
- id = strdup(node->info->id);
-
- free(mime_demux);
+ demux_class_t *cls = (demux_class_t *)node->plugin_class;
+ const char *mime = cls->get_mimetypes (cls);
+ while (mime)
+ {
+ while (*mime == ';' || isspace (*mime))
+ ++mime;
+ if (!strncmp (mime, mime_type, mime_type_len) &&
+ (!mime[mime_type_len] || mime[mime_type_len] == ':' || mime[mime_type_len] == ';'))
+ {
+ free (id);
+ id = strdup(node->info->id);
+ break;
+ }
+ mime = strchr (mime, ';');
}
}
}
pthread_mutex_unlock (&catalog->lock);
- free(mime_arg);
-
return id;
}
diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c
index 6da846a7c..6f8ac8479 100644
--- a/src/xine-engine/lrb.c
+++ b/src/xine-engine/lrb.c
@@ -30,7 +30,7 @@ lrb_t *lrb_new (int max_num_entries,
lrb_t *this;
- this = xine_xmalloc (sizeof (lrb_t));
+ this = calloc(1, sizeof(lrb_t));
this->max_num_entries = max_num_entries;
this->cur_num_entries = 0;
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 5d3e0a12d..84b936941 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -172,11 +172,10 @@ static void unixscr_exit (scr_plugin_t *scr) {
free(this);
}
-static scr_plugin_t* unixscr_init () {
+static scr_plugin_t *XINE_MALLOC unixscr_init () {
unixscr_t *this;
- this = (unixscr_t *) xine_xmalloc(sizeof(unixscr_t));
- memset(this, 0, sizeof(*this));
+ this = calloc(1, sizeof(unixscr_t));
this->scr.interface_version = 3;
this->scr.get_priority = unixscr_get_priority;
@@ -909,7 +908,7 @@ static void metronom_clock_exit (metronom_clock_t *this) {
metronom_t * _x_metronom_init (int have_video, int have_audio, xine_t *xine) {
- metronom_t *this = xine_xmalloc (sizeof (metronom_t));
+ metronom_t *this = calloc(1, sizeof (metronom_t));
this->set_audio_rate = metronom_set_audio_rate;
this->got_video_frame = metronom_got_video_frame;
@@ -962,7 +961,7 @@ metronom_t * _x_metronom_init (int have_video, int have_audio, xine_t *xine) {
metronom_clock_t *_x_metronom_clock_init(xine_t *xine)
{
- metronom_clock_t *this = (metronom_clock_t *) xine_xmalloc(sizeof(metronom_clock_t));
+ metronom_clock_t *this = calloc(1, sizeof(metronom_clock_t));
int err;
this->set_option = metronom_clock_set_option;
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 20e31117c..c7a594d89 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -223,7 +223,7 @@ struct metronom_s {
#define METRONOM_VPTS_OFFSET 6
#define METRONOM_PREBUFFER 7
-metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_PROTECTED;
+metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_MALLOC XINE_PROTECTED;
/* FIXME: reorder this structure on the next cleanup to remove the dummies */
struct metronom_clock_s {
@@ -319,7 +319,7 @@ struct metronom_clock_s {
#endif
};
-metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_PROTECTED;
+metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_MALLOC XINE_PROTECTED;
/*
* clock options
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index ef888e7a4..36ce47e44 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -83,17 +83,6 @@
# define UCS2_ENCODING "UCS-2LE"
#endif
-#ifdef MAX
-#undef MAX
-#endif
-#define MAX(a,b) ( (a) > (b) ) ? (a) : (b)
-
-#ifdef MIN
-#undef MIN
-#endif
-#define MIN(a,b) ( (a) < (b) ) ? (a) : (b)
-
-
#if (FREETYPE_MAJOR > 2) || \
(FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 1) || \
(FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3)
@@ -143,13 +132,13 @@ struct osd_ft2context_s {
* for the sake of simplicity)
*/
-static osd_object_t *osd_new_object (osd_renderer_t *this, int width, int height) {
+static osd_object_t *XINE_MALLOC osd_new_object (osd_renderer_t *this, int width, int height) {
osd_object_t *osd;
pthread_mutex_lock (&this->osd_mutex);
- osd = xine_xmalloc( sizeof(osd_object_t) );
+ osd = calloc(1, sizeof(osd_object_t));
osd->renderer = this;
osd->next = this->osds;
this->osds = osd;
@@ -670,7 +659,7 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) {
/* fixme: check for all read errors... */
if( (fp = gzopen(filename,"rb")) != NULL ) {
- font = xine_xmalloc( sizeof(osd_font_t) );
+ font = calloc(1, sizeof(osd_font_t));
gzread(fp, font->name, sizeof(font->name) );
font->version = gzread_i16(fp);
@@ -818,7 +807,7 @@ static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) {
#ifdef HAVE_FT2
static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int size ) {
if (!osd->ft2) {
- osd->ft2 = xine_xmalloc(sizeof(osd_ft2context_t));
+ osd->ft2 = calloc(1, sizeof(osd_ft2context_t));
if(FT_Init_FreeType( &osd->ft2->library )) {
xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG,
_("osd: cannot initialize ft2 library\n"));
@@ -1410,10 +1399,9 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) {
if( p ) {
osd_font_t *font;
- char *pathname;
*p++ = '\0';
- font = xine_xmalloc( sizeof(osd_font_t) );
+ font = calloc(1, sizeof(osd_font_t) );
strncpy(font->name, s, sizeof(font->name));
font->size = atoi(p);
@@ -1421,9 +1409,7 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) {
lprintf("font '%s' size %d is preloaded\n",
font->name, font->size);
- pathname = (char *) xine_xmalloc(strlen(path) + strlen(entry->d_name) + 2);
- sprintf (pathname, "%s/%s", path, entry->d_name);
- font->filename = pathname;
+ asprintf (&font->filename, "%s/%s", path, entry->d_name);
font->next = this->fonts;
this->fonts = font;
@@ -1579,9 +1565,9 @@ osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) {
osd_renderer_t *this;
char str[1024];
- this = xine_xmalloc(sizeof(osd_renderer_t));
+ this = calloc(1, sizeof(osd_renderer_t));
this->stream = stream;
- this->event.object.overlay = xine_xmalloc( sizeof(vo_overlay_t) );
+ this->event.object.overlay = calloc(1, sizeof(vo_overlay_t));
pthread_mutex_init (&this->osd_mutex, NULL);
diff --git a/src/xine-engine/osd.h b/src/xine-engine/osd.h
index 38b5d1fdd..70193a2ea 100644
--- a/src/xine-engine/osd.h
+++ b/src/xine-engine/osd.h
@@ -226,7 +226,7 @@ struct osd_renderer_s {
/*
* initialize the osd rendering engine
*/
-osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream );
+osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC;
/*
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index 5d8d67037..4d8032bc0 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -207,7 +207,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) {
post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *original,
post_in_t **input, post_out_t **output) {
- post_video_port_t *port = (post_video_port_t *)xine_xmalloc(sizeof(post_video_port_t));
+ post_video_port_t *port = calloc(1, sizeof(post_video_port_t));
if (!port)
return NULL;
@@ -235,7 +235,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
pthread_mutex_init(&port->free_frames_lock, NULL);
if (input) {
- *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t));
+ *input = calloc(1, sizeof(post_in_t));
if (!*input) return port;
(*input)->xine_in.name = "video in";
(*input)->xine_in.type = XINE_POST_DATA_VIDEO;
@@ -245,7 +245,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
}
if (output) {
- *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t));
+ *output = calloc(1, sizeof(post_out_t));
if (!*output) return port;
(*output)->xine_out.name = "video out";
(*output)->xine_out.type = XINE_POST_DATA_VIDEO;
@@ -353,7 +353,7 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *
new_frame = port->free_frame_slots;
port->free_frame_slots = new_frame->next;
} else {
- new_frame = (vo_frame_t *)xine_xmalloc(sizeof(vo_frame_t));
+ new_frame = calloc(1, sizeof(vo_frame_t));
}
pthread_mutex_unlock(&port->free_frames_lock);
@@ -716,7 +716,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) {
post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *original,
post_in_t **input, post_out_t **output) {
- post_audio_port_t *port = (post_audio_port_t *)xine_xmalloc(sizeof(post_audio_port_t));
+ post_audio_port_t *port = calloc(1, sizeof(post_audio_port_t));
if (!port)
return NULL;
@@ -739,7 +739,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_
pthread_mutex_init(&port->usage_lock, NULL);
if (input) {
- *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t));
+ *input = calloc(1, sizeof(post_in_t));
if (!*input) return port;
(*input)->xine_in.name = "audio in";
(*input)->xine_in.type = XINE_POST_DATA_AUDIO;
@@ -749,7 +749,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_
}
if (output) {
- *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t));
+ *output = calloc(1, sizeof(post_out_t));
if (!*output) return port;
(*output)->xine_out.name = "audio out";
(*output)->xine_out.type = XINE_POST_DATA_AUDIO;
diff --git a/src/xine-engine/refcounter.c b/src/xine-engine/refcounter.c
index 539abf3ed..8e952952b 100644
--- a/src/xine-engine/refcounter.c
+++ b/src/xine-engine/refcounter.c
@@ -30,7 +30,7 @@ refcounter_t* _x_new_refcounter(void *object, void (*destructor)(void *))
{
refcounter_t *new_refcounter;
- new_refcounter = (refcounter_t *) xine_xmalloc (sizeof (refcounter_t));
+ new_refcounter = (refcounter_t *) calloc(1, sizeof(refcounter_t));
new_refcounter->count = 1;
new_refcounter->object = object;
new_refcounter->destructor = destructor;
diff --git a/src/xine-engine/refcounter.h b/src/xine-engine/refcounter.h
index 87abd6321..d51973675 100644
--- a/src/xine-engine/refcounter.h
+++ b/src/xine-engine/refcounter.h
@@ -35,7 +35,7 @@ typedef struct {
typedef void (*refcounter_destructor)(void*);
-refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_PROTECTED;
+refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_MALLOC XINE_PROTECTED;
int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED;
diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c
index 065f8fa0a..696e99ffb 100644
--- a/src/xine-engine/scratch.c
+++ b/src/xine-engine/scratch.c
@@ -50,12 +50,11 @@ static void __attribute__((__format__(__printf__, 2, 0)))
localtime_r (&t, &tm);
if ( ! this->lines[this->cur] )
- this->lines[this->cur] = xine_xmalloc(SCRATCH_LINE_LEN_MAX+1);
+ this->lines[this->cur] = malloc(SCRATCH_LINE_LEN_MAX+1);
if ( ! this->lines[this->cur] )
return;
- strftime (this->lines[this->cur], SCRATCH_LINE_LEN_MAX, "%X: ", &tm);
- l = strlen (this->lines[this->cur]);
+ l = strftime (this->lines[this->cur], SCRATCH_LINE_LEN_MAX, "%X: ", &tm);
vsnprintf (this->lines[this->cur] + l, SCRATCH_LINE_LEN_MAX - l, format, argp);
lprintf ("printing format %s to line %d\n", format, this->cur);
@@ -106,7 +105,7 @@ static void scratch_dispose (scratch_buffer_t *this) {
scratch_buffer_t *_x_new_scratch_buffer (int num_lines) {
scratch_buffer_t *this;
- this = xine_xmalloc (sizeof (scratch_buffer_t));
+ this = calloc(1, sizeof(scratch_buffer_t));
this->lines = calloc ((num_lines + 1), sizeof(char*));
this->ordered = calloc ((num_lines + 1), sizeof(char*));
diff --git a/src/xine-engine/scratch.h b/src/xine-engine/scratch.h
index c0e591d31..1029276e3 100644
--- a/src/xine-engine/scratch.h
+++ b/src/xine-engine/scratch.h
@@ -51,6 +51,6 @@ struct scratch_buffer_s {
pthread_mutex_t lock;
};
-scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_PROTECTED;
+scratch_buffer_t *_x_new_scratch_buffer (int num_lines) XINE_MALLOC XINE_PROTECTED;
#endif
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index a8464ac40..be062cc5d 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -139,11 +139,11 @@ typedef struct {
* frame queue (fifo) util functions
*/
-static img_buf_fifo_t *vo_new_img_buf_queue () {
+static img_buf_fifo_t *XINE_MALLOC vo_new_img_buf_queue () {
img_buf_fifo_t *queue;
- queue = (img_buf_fifo_t *) xine_xmalloc (sizeof (img_buf_fifo_t));
+ queue = (img_buf_fifo_t *) calloc(1, sizeof(img_buf_fifo_t));
if( queue ) {
queue->first = NULL;
queue->last = NULL;
@@ -1771,7 +1771,7 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
int num_frame_buffers;
- this = xine_xmalloc (sizeof (vos_t)) ;
+ this = calloc(1, sizeof(vos_t)) ;
this->xine = xine;
this->clock = xine->clock;
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index 4d9c80565..fb01805df 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -448,7 +448,7 @@ struct video_overlay_manager_s {
* build a video_out_port from
* a given video driver
*/
-xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_PROTECTED;
+xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_MALLOC XINE_PROTECTED;
#ifdef __cplusplus
}
diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c
index c189fa56b..945df3cb9 100644
--- a/src/xine-engine/video_overlay.c
+++ b/src/xine-engine/video_overlay.c
@@ -199,7 +199,7 @@ static void video_overlay_reset (video_overlay_t *this) {
pthread_mutex_lock (&this->events_mutex);
for (i=0; i < MAX_EVENTS; i++) {
if (this->events[i].event == NULL) {
- this->events[i].event = xine_xmalloc (sizeof(video_overlay_event_t));
+ this->events[i].event = calloc(1, sizeof(video_overlay_event_t));
#ifdef LOG_DEBUG
printf ("video_overlay: MALLOC2: this->events[%d].event %p, len=%d\n",
i,
@@ -293,7 +293,7 @@ static int32_t video_overlay_add_event(video_overlay_manager_t *this_gen, void
event->object.overlay->hili_trans[i] = OVL_MAX_OPACITY;
}
- this->events[new_event].event->object.overlay = xine_xmalloc (sizeof(vo_overlay_t));
+ this->events[new_event].event->object.overlay = calloc(1, sizeof(vo_overlay_t));
xine_fast_memcpy(this->events[new_event].event->object.overlay,
event->object.overlay, sizeof(vo_overlay_t));
@@ -587,7 +587,7 @@ video_overlay_manager_t *_x_video_overlay_new_manager (xine_t *xine) {
video_overlay_t *this;
- this = (video_overlay_t *) xine_xmalloc (sizeof (video_overlay_t));
+ this = (video_overlay_t *) calloc(1, sizeof(video_overlay_t));
this->xine = xine;
this->video_overlay.init = video_overlay_init;
diff --git a/src/xine-engine/video_overlay.h b/src/xine-engine/video_overlay.h
index d580a1e83..01f3a2a3a 100644
--- a/src/xine-engine/video_overlay.h
+++ b/src/xine-engine/video_overlay.h
@@ -98,6 +98,6 @@ typedef struct video_overlay_event_s {
video_overlay_object_t object; /* The image data. */
} video_overlay_event_t;
-video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_PROTECTED;
+video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_MALLOC XINE_PROTECTED;
#endif
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index d58b4ea55..984b6ade9 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -304,10 +304,10 @@ static void ticket_dispose(xine_ticket_t *this) {
free(this);
}
-static xine_ticket_t *ticket_init(void) {
+static xine_ticket_t *XINE_MALLOC ticket_init(void) {
xine_ticket_t *port_ticket;
- port_ticket = (xine_ticket_t *) xine_xmalloc(sizeof(xine_ticket_t));
+ port_ticket = calloc(1, sizeof(xine_ticket_t));
port_ticket->acquire_nonblocking = ticket_acquire_nonblocking;
port_ticket->acquire = ticket_acquire;
@@ -553,7 +553,7 @@ static int stream_rewire_video(xine_post_out_t *output, void *data)
return 1;
}
-void xine_dispose_internal (xine_stream_t *stream);
+static void xine_dispose_internal (xine_stream_t *stream);
xine_stream_t *xine_stream_new (xine_t *this,
xine_audio_port_t *ao, xine_video_port_t *vo) {
@@ -570,7 +570,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
pthread_mutex_lock (&this->streams_lock);
- stream = (xine_stream_t *) xine_xmalloc (sizeof (xine_stream_t)) ;
+ stream = (xine_stream_t *) calloc (1, sizeof (xine_stream_t)) ;
stream->current_extra_info = malloc( sizeof( extra_info_t ) );
stream->audio_decoder_extra_info = malloc( sizeof( extra_info_t ) );
stream->video_decoder_extra_info = malloc( sizeof( extra_info_t ) );
@@ -735,7 +735,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
}
void _x_mrl_unescape(char *mrl) {
- int i, len = strlen(mrl);
+ size_t i, len = strlen(mrl);
for (i = 0; i < len; i++) {
if ((mrl[i]=='%') && (i<(len-2))) {
@@ -795,7 +795,7 @@ static inline int _x_path_looks_like_mrl (const char *path)
return path[0] == ':' && path[1] == '/';
}
-/*static*/ int open_internal (xine_stream_t *stream, const char *mrl) {
+static int open_internal (xine_stream_t *stream, const char *mrl) {
const char *stream_setup = NULL;
const char *mrl_proto = NULL;
@@ -1437,7 +1437,7 @@ int xine_eject (xine_stream_t *stream) {
return status;
}
-void xine_dispose_internal (xine_stream_t *stream) {
+static void xine_dispose_internal (xine_stream_t *stream) {
xine_list_iterator_t *ite;
@@ -1545,7 +1545,7 @@ xine_t *xine_new (void) {
int i_err;
#endif
- this = xine_xmalloc (sizeof (xine_t));
+ this = calloc(1, sizeof (xine_t));
if (!this)
_x_abort();
@@ -1634,8 +1634,7 @@ static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) {
xine_t *this = (xine_t *)this_gen;
char *homedir_trail_slash;
- homedir_trail_slash = (char *)malloc(strlen(xine_get_homedir()) + 2);
- sprintf(homedir_trail_slash, "%s/", xine_get_homedir());
+ asprintf(&homedir_trail_slash, "%s/", xine_get_homedir());
if (entry->str_value[0] &&
(entry->str_value[0] != '/' || strstr(entry->str_value, "/.") ||
strcmp(entry->str_value, xine_get_homedir()) == 0 ||
@@ -1934,53 +1933,60 @@ int xine_get_pos_length (xine_stream_t *stream, int *pos_stream,
return 1;
}
-static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *height,
- int *ratio_code, int *format,
- uint8_t **img, int *size, int alloc_img) {
+static int _x_get_current_frame_data (xine_stream_t *stream,
+ xine_current_frame_data_t *data,
+ int flags, int img_size_unknown) {
vo_frame_t *frame;
- int required_size;
+ size_t required_size;
stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0);
frame = stream->video_out->get_last_frame (stream->video_out);
stream->xine->port_ticket->release(stream->xine->port_ticket, 0);
- if (!frame)
+ if (!frame) {
+ data->img_size = 0;
return 0;
+ }
- *width = frame->width;
- *height = frame->height;
+ data->width = frame->width;
+ data->height = frame->height;
+ data->crop_left = frame->crop_left;
+ data->crop_right = frame->crop_right;
+ data->crop_top = frame->crop_top;
+ data->crop_bottom = frame->crop_bottom;
- *ratio_code = 10000.0 * frame->ratio;
+ data->ratio_code = 10000.0 * frame->ratio;
/* make ratio_code backward compatible */
#define RATIO_LIKE(a, b) ((b) - 1 <= (a) && (a) <= 1 + (b))
- if (RATIO_LIKE(*ratio_code, 10000))
- *ratio_code = XINE_VO_ASPECT_SQUARE;
- else if (RATIO_LIKE(*ratio_code, 13333))
- *ratio_code = XINE_VO_ASPECT_4_3;
- else if (RATIO_LIKE(*ratio_code, 17778))
- *ratio_code = XINE_VO_ASPECT_ANAMORPHIC;
- else if (RATIO_LIKE(*ratio_code, 21100))
- *ratio_code = XINE_VO_ASPECT_DVB;
+ if (RATIO_LIKE(data->ratio_code, 10000))
+ data->ratio_code = XINE_VO_ASPECT_SQUARE;
+ else if (RATIO_LIKE(data->ratio_code, 13333))
+ data->ratio_code = XINE_VO_ASPECT_4_3;
+ else if (RATIO_LIKE(data->ratio_code, 17778))
+ data->ratio_code = XINE_VO_ASPECT_ANAMORPHIC;
+ else if (RATIO_LIKE(data->ratio_code, 21100))
+ data->ratio_code = XINE_VO_ASPECT_DVB;
- *format = frame->format;
+ data->format = frame->format;
+ data->interlaced = frame->progressive_frame ? 0 : (2 - frame->top_field_first);
- switch (*format) {
+ switch (frame->format) {
case XINE_IMGFMT_YV12:
- required_size = *width * *height
- + ((*width + 1) / 2) * ((*height + 1) / 2)
- + ((*width + 1) / 2) * ((*height + 1) / 2);
+ required_size = frame->width * frame->height
+ + ((frame->width + 1) / 2) * ((frame->height + 1) / 2)
+ + ((frame->width + 1) / 2) * ((frame->height + 1) / 2);
break;
case XINE_IMGFMT_YUY2:
- required_size = *width * *height
- + ((*width + 1) / 2) * *height
- + ((*width + 1) / 2) * *height;
+ required_size = frame->width * frame->height
+ + ((frame->width + 1) / 2) * frame->height
+ + ((frame->width + 1) / 2) * frame->height;
break;
default:
- if (*img || alloc_img) {
+ if (data->img || (flags & XINE_FRAME_DATA_ALLOCATE_IMG)) {
xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
"xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
_x_abort ();
@@ -1989,38 +1995,36 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he
required_size = 0;
}
- if (alloc_img) {
- /* return size if requested */
- if (size)
- *size = required_size;
+ if (flags & XINE_FRAME_DATA_ALLOCATE_IMG) {
+ /* return allocated buffer size */
+ data->img_size = required_size;
/* allocate img or fail */
- if (!(*img = xine_xmalloc (required_size)))
+ if (!(data->img = calloc(1, required_size)))
return 0;
} else {
/* fail if supplied buffer is to small */
- if (*img && size && *size < required_size) {
- *size = required_size;
+ if (data->img && !img_size_unknown && data->img_size < required_size) {
+ data->img_size = required_size;
return 0;
}
- /* return size if requested */
- if (size)
- *size = required_size;
+ /* return used buffer size */
+ data->img_size = required_size;
}
- if (*img) {
+ if (data->img) {
switch (frame->format) {
case XINE_IMGFMT_YV12:
yv12_to_yv12(
/* Y */
frame->base[0], frame->pitches[0],
- *img, frame->width,
+ data->img, frame->width,
/* U */
frame->base[1], frame->pitches[1],
- *img+frame->width*frame->height, frame->width/2,
+ data->img+frame->width*frame->height, frame->width/2,
/* V */
frame->base[2], frame->pitches[2],
- *img+frame->width*frame->height+frame->width*frame->height/4, frame->width/2,
+ data->img+frame->width*frame->height+frame->width*frame->height/4, frame->width/2,
/* width x height */
frame->width, frame->height);
break;
@@ -2030,7 +2034,7 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he
/* src */
frame->base[0], frame->pitches[0],
/* dst */
- *img, frame->width*2,
+ data->img, frame->width*2,
/* width x height */
frame->width, frame->height);
break;
@@ -2044,23 +2048,67 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he
return 1;
}
+int xine_get_current_frame_data (xine_stream_t *stream,
+ xine_current_frame_data_t *data,
+ int flags) {
+
+ return _x_get_current_frame_data(stream, data, flags, 0);
+}
+
int xine_get_current_frame_alloc (xine_stream_t *stream, int *width, int *height,
int *ratio_code, int *format,
- uint8_t **img, int *size) {
- uint8_t *no_img = NULL;
- return _x_get_current_frame_impl(stream, width, height, ratio_code, format, img ? img : &no_img, size, img != NULL);
+ uint8_t **img, int *img_size) {
+
+ int result;
+ xine_current_frame_data_t data;
+
+ memset(&data, 0, sizeof (data));
+
+ result = _x_get_current_frame_data(stream, &data, img ? XINE_FRAME_DATA_ALLOCATE_IMG : 0, 0);
+ if (width) *width = data.width;
+ if (height) *height = data.height;
+ if (ratio_code) *ratio_code = data.ratio_code;
+ if (format) *format = data.format;
+ if (img_size) *img_size = data.img_size;
+ if (img) *img = data.img;
+ return result;
}
int xine_get_current_frame_s (xine_stream_t *stream, int *width, int *height,
int *ratio_code, int *format,
- uint8_t *img, int *size) {
- return (!img || size) && _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, size, 0);
+ uint8_t *img, int *img_size) {
+ int result;
+ xine_current_frame_data_t data;
+
+ memset(&data, 0, sizeof (data));
+ data.img = img;
+ if (img_size)
+ data.img_size = *img_size;
+
+ result = _x_get_current_frame_data(stream, &data, 0, 0);
+ if (width) *width = data.width;
+ if (height) *height = data.height;
+ if (ratio_code) *ratio_code = data.ratio_code;
+ if (format) *format = data.format;
+ if (img_size) *img_size = data.img_size;
+ return result;
}
int xine_get_current_frame (xine_stream_t *stream, int *width, int *height,
int *ratio_code, int *format,
uint8_t *img) {
- return _x_get_current_frame_impl(stream, width, height, ratio_code, format, &img, NULL, 0);
+ int result;
+ xine_current_frame_data_t data;
+
+ memset(&data, 0, sizeof (data));
+ data.img = img;
+
+ result = _x_get_current_frame_data(stream, &data, 0, 1);
+ if (width) *width = data.width;
+ if (height) *height = data.height;
+ if (ratio_code) *ratio_code = data.ratio_code;
+ if (format) *format = data.format;
+ return result;
}
int xine_get_video_frame (xine_stream_t *stream,
@@ -2181,7 +2229,10 @@ void xine_log (xine_t *this, int buf, const char *format, ...) {
vsnprintf(buffer, SCRATCH_LINE_LEN_MAX, format, argp);
printf("%s", buffer);
va_end (argp);
- }
+ }
+
+ if (this->log_cb)
+ this->log_cb (this->log_cb_user_data, buf);
}
void xine_vlog(xine_t *this, int buf, const char *format,
@@ -2190,6 +2241,9 @@ void xine_vlog(xine_t *this, int buf, const char *format,
check_log_alloc (this, buf);
this->log_buffers[buf]->scratch_printf(this->log_buffers[buf], format, args);
+
+ if (this->log_cb)
+ this->log_cb (this->log_cb_user_data, buf);
}
char *const *xine_get_log (xine_t *this, int buf) {
@@ -2204,12 +2258,10 @@ char *const *xine_get_log (xine_t *this, int buf) {
}
void xine_register_log_cb (xine_t *this, xine_log_cb_t cb, void *user_data) {
-
- printf ("xine: xine_register_log_cb: not implemented yet.\n");
- _x_abort();
+ this->log_cb = cb;
+ this->log_cb_user_data = user_data;
}
-
int xine_get_error (xine_stream_t *stream) {
return stream->err;
}
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index 50d8796e8..415ceec56 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -945,7 +945,7 @@ int _x_message(xine_stream_t *stream, int type, ...) {
xine_ui_message_data_t *data;
xine_event_t event;
const char *explanation;
- int size;
+ size_t size;
int n;
va_list ap;
char *s, *params;
@@ -990,7 +990,7 @@ int _x_message(xine_stream_t *stream, int type, ...) {
args[n] = NULL;
size += sizeof(xine_ui_message_data_t) + 1;
- data = xine_xmalloc( size );
+ data = calloc(1, size );
strcpy(data->compatibility.str, "Upgrade your frontend to see the error messages");
data->type = type;
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
index 8fb4723a5..f97ca0b24 100644
--- a/src/xine-engine/xine_internal.h
+++ b/src/xine-engine/xine_internal.h
@@ -117,6 +117,9 @@ struct xine_s {
#ifdef XINE_ENGINE_INTERNAL
xine_ticket_t *port_ticket;
pthread_mutex_t log_lock;
+
+ xine_log_cb_t log_cb;
+ void *log_cb_user_data;
#endif
};
@@ -389,8 +392,8 @@ input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) XI
demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED;
demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) XINE_PROTECTED;
demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) XINE_PROTECTED;
-input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_PROTECTED;
-input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_PROTECTED;
+input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_MALLOC XINE_PROTECTED;
+input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_MALLOC XINE_PROTECTED;
void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED;
void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XINE_PROTECTED;
diff --git a/src/xine-utils/Makefile.am b/src/xine-utils/Makefile.am
index a23ebe579..6af0d29bd 100644
--- a/src/xine-utils/Makefile.am
+++ b/src/xine-utils/Makefile.am
@@ -46,5 +46,5 @@ xineinclude_HEADERS = \
ring_buffer.h
-noinst_HEADERS = ppcasm_string.h xine_check.h mangle.h
+noinst_HEADERS = ppcasm_string.h mangle.h
diff --git a/src/xine-utils/array.h b/src/xine-utils/array.h
index ae2093823..44f3c7632 100644
--- a/src/xine-utils/array.h
+++ b/src/xine-utils/array.h
@@ -27,7 +27,7 @@
typedef struct xine_array_s xine_array_t;
/* Constructor */
-xine_array_t *xine_array_new(size_t initial_size) XINE_PROTECTED;
+xine_array_t *xine_array_new(size_t initial_size) XINE_MALLOC XINE_PROTECTED;
/* Destructor */
void xine_array_delete(xine_array_t *array) XINE_PROTECTED;
diff --git a/src/xine-utils/attributes.h b/src/xine-utils/attributes.h
index 2085be571..3819818d5 100644
--- a/src/xine-utils/attributes.h
+++ b/src/xine-utils/attributes.h
@@ -32,20 +32,29 @@
#define ATTR_ALIGN(align)
#endif
-/* disable GNU __attribute__ extension, when not compiling with GNU C */
-#if defined(__GNUC__) || defined (__ICC)
-#ifndef ATTRIBUTE_PACKED
-#define ATTRIBUTE_PACKED 1
-#endif
-#else
-#undef ATTRIBUTE_PACKED
-#ifndef __attribute__
-#define __attribute__(x) /**/
-#endif /* __attribute __*/
-#endif
-
#ifdef XINE_COMPILE
# include "configure.h"
+#else
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95 )
+# define SUPPORT_ATTRIBUTE_PACKED 1
+# endif
+
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3 )
+# define SUPPORT_ATTRIBUTE_DEPRECATED 1
+# define SUPPORT_ATTRIBUTE_FORMAT 1
+# define SUPPORT_ATTRIBUTE_FORMAT_ARG 1
+# define SUPPORT_ATTRIBUTE_MALLOC 1
+# define SUPPORT_ATTRIBUTE_UNUSED 1
+# define SUPPORT_ATTRIBUTE_CONST 1
+# endif
+
+# if __GNUC__ >= 4
+# define SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT 1
+# if __ELF__
+# define SUPPORT_ATTRIBUTE_VISIBILITY_PROTECTED 1
+# endif
+# define SUPPORT_ATTRIBUTE_SENTINEL 1
+# endif
#endif
/* Export protected only for libxine functions */
@@ -89,4 +98,22 @@
# define XINE_FORMAT_PRINTF_ARG(fmt)
#endif
+#ifdef SUPPORT_ATTRIBUTE_MALLOC
+# define XINE_MALLOC __attribute__((__malloc__))
+#else
+# define XINE_MALLOC
+#endif
+
+#ifdef SUPPORT_ATTRIBUTE_PACKED
+# define XINE_PACKED __attribute__((__packed__))
+#else
+# define XINE_PACKED
+#endif
+
+#ifdef SUPPORT_ATTRIBUTE_CONST
+# define XINE_CONST __attribute__((__const__))
+#else
+# define XINE_CONST
+#endif
+
#endif /* ATTRIBUTE_H_ */
diff --git a/src/xine-utils/list.c b/src/xine-utils/list.c
index 65bdaec26..eb654a3e3 100644
--- a/src/xine-utils/list.c
+++ b/src/xine-utils/list.c
@@ -67,9 +67,9 @@ struct xine_list_s {
/* Allocates a new chunk of n elements
* One malloc call is used to allocate the struct and the elements.
*/
-static xine_list_chunk_t *xine_list_alloc_chunk(size_t size) {
+static xine_list_chunk_t *XINE_MALLOC xine_list_alloc_chunk(size_t size) {
xine_list_chunk_t *new_chunk;
- size_t chunk_mem_size;;
+ size_t chunk_mem_size;
chunk_mem_size = sizeof(xine_list_chunk_t);
chunk_mem_size += sizeof(xine_list_elem_t) * size;
diff --git a/src/xine-utils/list.h b/src/xine-utils/list.h
index e00e30d6c..f05ed2b0e 100644
--- a/src/xine-utils/list.h
+++ b/src/xine-utils/list.h
@@ -48,7 +48,7 @@ typedef struct xine_list_s xine_list_t;
typedef void* xine_list_iterator_t;
/* Constructor */
-xine_list_t *xine_list_new(void) XINE_PROTECTED;
+xine_list_t *xine_list_new(void) XINE_MALLOC XINE_PROTECTED;
/* Destructor */
void xine_list_delete(xine_list_t *list) XINE_PROTECTED;
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c
index fb323055c..301d6c22f 100644
--- a/src/xine-utils/monitor.c
+++ b/src/xine-utils/monitor.c
@@ -39,12 +39,10 @@ static const char *profiler_label[MAX_ID] ;
void xine_profiler_init () {
int i;
- for (i=0; i<MAX_ID; i++) {
- profiler_times[i] = 0;
- profiler_start[i] = 0;
- profiler_calls[i] = 0;
- profiler_label[i] = NULL;
- }
+ memset(profiler_times, 0, sizeof(profiler_times));
+ memset(profiler_start, 0, sizeof(profiler_start));
+ memset(profiler_calls, 0, sizeof(profiler_calls));
+ memset(profiler_label, 0, sizeof(profiler_label));
}
int xine_profiler_allocate_slot (const char *label) {
diff --git a/src/xine-utils/pool.c b/src/xine-utils/pool.c
index a1fddadd9..1b7fd63f3 100644
--- a/src/xine-utils/pool.c
+++ b/src/xine-utils/pool.c
@@ -55,7 +55,7 @@ struct xine_pool_s {
/* Allocates a new chunk of n elements
* One malloc call is used to allocate the struct and the elements.
*/
-static xine_pool_chunk_t *xine_pool_alloc_chunk(size_t object_size, size_t object_count) {
+static xine_pool_chunk_t *XINE_MALLOC xine_pool_alloc_chunk(size_t object_size, size_t object_count) {
xine_pool_chunk_t *new_chunk;
size_t chunk_mem_size;;
diff --git a/src/xine-utils/pool.h b/src/xine-utils/pool.h
index 918da82a2..2667b7fdc 100644
--- a/src/xine-utils/pool.h
+++ b/src/xine-utils/pool.h
@@ -36,7 +36,7 @@ xine_pool_t *xine_pool_new(size_t object_size,
void (create_object)(void *object),
void (prepare_object)(void *object),
void (return_object)(void *object),
- void (delete_object)(void *object)) XINE_PROTECTED;
+ void (delete_object)(void *object)) XINE_MALLOC XINE_PROTECTED;
/* Deletes a pool */
void xine_pool_delete(xine_pool_t *pool) XINE_PROTECTED;
diff --git a/src/xine-utils/ring_buffer.h b/src/xine-utils/ring_buffer.h
index efcffd3b7..5f104dc77 100644
--- a/src/xine-utils/ring_buffer.h
+++ b/src/xine-utils/ring_buffer.h
@@ -22,7 +22,7 @@
typedef struct xine_ring_buffer_s xine_ring_buffer_t;
/* Creates a new ring buffer */
-xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_PROTECTED;
+xine_ring_buffer_t *xine_ring_buffer_new(size_t size) XINE_MALLOC XINE_PROTECTED;
/* Deletes a ring buffer */
void xine_ring_buffer_delete(xine_ring_buffer_t *ring_buffer) XINE_PROTECTED;
diff --git a/src/xine-utils/sorted_array.h b/src/xine-utils/sorted_array.h
index a1894eca3..c6fdd1c25 100644
--- a/src/xine-utils/sorted_array.h
+++ b/src/xine-utils/sorted_array.h
@@ -63,7 +63,7 @@ typedef struct xine_sarray_s xine_sarray_t;
typedef int (*xine_sarray_comparator_t)(void*, void*);
/* Constructor */
-xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_PROTECTED;
+xine_sarray_t *xine_sarray_new(size_t initial_size, xine_sarray_comparator_t comparator) XINE_MALLOC XINE_PROTECTED;
/* Destructor */
void xine_sarray_delete(xine_sarray_t *sarray) XINE_PROTECTED;
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 768b41da4..f533d69e5 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -236,7 +236,25 @@ static const lang_locale_t lang_locales[] = {
{ NULL, NULL, NULL, NULL }
};
-
+/**
+ * @brief Allocate and clean memory size_t 'size', then return the
+ * pointer to the allocated memory.
+ * @param size Size of the memory area to allocate.
+ *
+ * @return A pointer to the allocated memory area, or NULL in case of
+ * error.
+ *
+ * The behaviour of this function differs from standard malloc() as
+ * xine_xmalloc(0) will not return a NULL pointer, but rather a
+ * pointer to a memory area of size 1 byte.
+ *
+ * The NULL value is only ever returned in case of an error in
+ * malloc(), and is reported to stderr stream.
+ *
+ * @deprecated This function has been deprecated, as the behaviour of
+ * allocating a 1 byte memory area on zero size is almost
+ * never desired, and the function is thus mostly misused.
+ */
void *xine_xmalloc(size_t size) {
void *ptr;
@@ -257,7 +275,7 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) {
char *ptr;
- *base = ptr = xine_xmalloc (size+alignment);
+ *base = ptr = calloc(1, size+alignment);
while ((size_t) ptr % alignment)
ptr++;
@@ -507,7 +525,7 @@ void xine_hexdump (const char *buf, int length) {
static const lang_locale_t *_get_first_lang_locale(const char *lcal) {
const lang_locale_t *llocale;
- int lang_len;
+ size_t lang_len;
char *mod;
if(lcal && *lcal) {
@@ -674,3 +692,11 @@ int xine_monotonic_clock(struct timeval *tv, struct timezone *tz)
#endif
}
+
+char *xine_strcat_realloc (char **dest, char *append)
+{
+ char *newstr = realloc (*dest, (*dest ? strlen (*dest) : 0) + strlen (append) + 1);
+ if (newstr)
+ strcat (*dest = newstr, append);
+ return newstr;
+}
diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c
index 190ab5197..097ca0f1f 100644
--- a/src/xine-utils/xine_buffer.c
+++ b/src/xine-utils/xine_buffer.c
@@ -117,7 +117,7 @@ typedef struct {
*/
void *xine_buffer_init(int chunk_size) {
- uint8_t *data=xine_xmalloc(chunk_size+XINE_BUFFER_HEADER_SIZE);
+ uint8_t *data=calloc(1, chunk_size+XINE_BUFFER_HEADER_SIZE);
xine_buffer_header_t *header=(xine_buffer_header_t*)data;
header->size=chunk_size;
@@ -162,7 +162,7 @@ void *xine_buffer_dup(const void *buf) {
CHECK_MAGIC(buf);
#endif
-new=xine_xmalloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE);
+ new = malloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE);
xine_fast_memcpy(new, ((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE,
GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE);
diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c
index f00a23832..b8465f3f8 100644
--- a/src/xine-utils/xine_check.c
+++ b/src/xine-utils/xine_check.c
@@ -44,7 +44,6 @@
#include <fcntl.h>
#include <unistd.h>
-#include "xine_check.h"
#include "xineutils.h"
#if defined(__linux__)
@@ -102,38 +101,7 @@ set_hc_result(xine_health_check_t* hc, int state, const char *format, ...)
#if defined(__linux__)
-xine_health_check_t* xine_health_check (xine_health_check_t* hc, int check_num) {
-
- switch(check_num) {
- case CHECK_KERNEL:
- hc = _x_health_check_kernel (hc);
- break;
- case CHECK_MTRR:
- hc = _x_health_check_mtrr (hc);
- break;
- case CHECK_CDROM:
- hc = _x_health_check_cdrom (hc);
- break;
- case CHECK_DVDROM:
- hc = _x_health_check_dvdrom (hc);
- break;
- case CHECK_DMA:
- hc = _x_health_check_dma (hc);
- break;
- case CHECK_X:
- hc = _x_health_check_x (hc);
- break;
- case CHECK_XV:
- hc = _x_health_check_xv (hc);
- break;
- default:
- hc->status = XINE_HEALTH_CHECK_NO_SUCH_CHECK;
- }
-
- return hc;
-}
-
-xine_health_check_t* _x_health_check_kernel (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_kernel (xine_health_check_t* hc) {
struct utsname kernel;
hc->title = "Check for kernel version";
@@ -153,7 +121,7 @@ xine_health_check_t* _x_health_check_kernel (xine_health_check_t* hc) {
}
#if defined(ARCH_X86) || defined(ARCH_X86_64)
-xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
FILE *fd;
hc->title = "Check for MTRR support";
@@ -170,7 +138,7 @@ xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
return hc;
}
#else
-xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
hc->title = "Check for MTRR support";
hc->explanation = "Don't worry about this one";
@@ -181,7 +149,7 @@ xine_health_check_t* _x_health_check_mtrr (xine_health_check_t* hc) {
}
#endif
-xine_health_check_t* _x_health_check_cdrom (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_cdrom (xine_health_check_t* hc) {
struct stat cdrom_st;
int fd;
@@ -217,7 +185,7 @@ xine_health_check_t* _x_health_check_cdrom (xine_health_check_t* hc) {
return hc;
}
-xine_health_check_t* _x_health_check_dvdrom(xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_dvdrom(xine_health_check_t* hc) {
struct stat dvdrom_st;
int fd;
@@ -253,7 +221,7 @@ xine_health_check_t* _x_health_check_dvdrom(xine_health_check_t* hc) {
return hc;
}
-xine_health_check_t* _x_health_check_dma (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_dma (xine_health_check_t* hc) {
int is_scsi_dev = 0;
int fd = 0;
@@ -307,7 +275,7 @@ xine_health_check_t* _x_health_check_dma (xine_health_check_t* hc) {
}
-xine_health_check_t* _x_health_check_x (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_x (xine_health_check_t* hc) {
char* env_display = getenv("DISPLAY");
hc->title = "Check for X11 environment";
@@ -323,7 +291,7 @@ xine_health_check_t* _x_health_check_x (xine_health_check_t* hc) {
return hc;
}
-xine_health_check_t* _x_health_check_xv (xine_health_check_t* hc) {
+static xine_health_check_t* _x_health_check_xv (xine_health_check_t* hc) {
#ifdef HAVE_X11
#ifdef HAVE_XV
@@ -497,6 +465,37 @@ xine_health_check_t* _x_health_check_xv (xine_health_check_t* hc) {
#endif /* ! HAVE_X11 */
}
+xine_health_check_t* xine_health_check (xine_health_check_t* hc, int check_num) {
+
+ switch(check_num) {
+ case CHECK_KERNEL:
+ hc = _x_health_check_kernel (hc);
+ break;
+ case CHECK_MTRR:
+ hc = _x_health_check_mtrr (hc);
+ break;
+ case CHECK_CDROM:
+ hc = _x_health_check_cdrom (hc);
+ break;
+ case CHECK_DVDROM:
+ hc = _x_health_check_dvdrom (hc);
+ break;
+ case CHECK_DMA:
+ hc = _x_health_check_dma (hc);
+ break;
+ case CHECK_X:
+ hc = _x_health_check_x (hc);
+ break;
+ case CHECK_XV:
+ hc = _x_health_check_xv (hc);
+ break;
+ default:
+ hc->status = XINE_HEALTH_CHECK_NO_SUCH_CHECK;
+ }
+
+ return hc;
+}
+
#else /* !__linux__ */
xine_health_check_t* xine_health_check (xine_health_check_t* hc, int check_num) {
hc->title = "xine health check not supported on this platform";
diff --git a/src/xine-utils/xine_check.h b/src/xine-utils/xine_check.h
deleted file mode 100644
index 4b21bf74e..000000000
--- a/src/xine-utils/xine_check.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef XINE_CHECK_H
-#define XINE_CHECK_H
-#include <stdio.h>
-
-#ifdef XINE_COMPILE
-# include "xine.h"
-#else
-# include <xine.h>
-#endif
-
-/*
- * Start checking xine setup here
- *
- * cdrom_dev = Name of the device link for the cdrom drive (e.g. /dev/cdrom)
- * dvd_dev = Name of the device link for the dvd drive (e.g. /dev/dvd)
- */
-
-/* Get Kernel information */
-xine_health_check_t* _x_health_check_kernel(xine_health_check_t*);
-
-/* health_check MTRR */
-xine_health_check_t* _x_health_check_mtrr(xine_health_check_t*);
-
-/* health_check CDROM */
-xine_health_check_t* _x_health_check_cdrom(xine_health_check_t*);
-
-/* health_check DVDROM */
-xine_health_check_t* _x_health_check_dvdrom(xine_health_check_t*);
-
-/* health_check DMA settings of DVD drive*/
-xine_health_check_t* _x_health_check_dma(xine_health_check_t*);
-
-/* health_check X */
-xine_health_check_t* _x_health_check_x(xine_health_check_t*);
-
-/* health_check Xv extension */
-xine_health_check_t* _x_health_check_xv(xine_health_check_t*);
-
-#endif
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 01afc1631..2d6425b00 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -125,7 +125,7 @@ extern "C" {
#define MM_SSE MM_ACCEL_X86_SSE
#define MM_SSE2 MM_ACCEL_X86_SSE2
-uint32_t xine_mm_accel (void) XINE_PROTECTED;
+uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED;
#if defined(ARCH_X86) || defined(ARCH_X86_64)
@@ -621,11 +621,7 @@ void xine_profiler_print_results (void) XINE_PROTECTED;
* Allocate and clean memory size_t 'size', then return the pointer
* to the allocated memory.
*/
-#if !defined(__GNUC__) || __GNUC__ < 3
-void *xine_xmalloc(size_t size) XINE_PROTECTED;
-#else
-void *xine_xmalloc(size_t size) __attribute__ ((__malloc__)) XINE_PROTECTED;
-#endif
+void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED;
/*
* Same as above, but memory is aligned to 'alignement'.
@@ -960,7 +956,7 @@ void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...);
/**
* get encoding of current locale
*/
-char *xine_get_system_encoding(void) XINE_PROTECTED;
+char *xine_get_system_encoding(void) XINE_MALLOC XINE_PROTECTED;
/*
* guess default encoding for the subtitles
@@ -973,6 +969,13 @@ const char *xine_guess_spu_encoding(void) XINE_PROTECTED;
*/
int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED;
+/**
+ * append to a string, reallocating
+ * normally, updates & returns *dest
+ * on error, *dest is unchanged & NULL is returned.
+ */
+char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED;
+
/* don't harm following code */
#ifdef extern
# undef extern
diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c
index 09e5a5e24..7da4cc59b 100644
--- a/src/xine-utils/xmllexer.c
+++ b/src/xine-utils/xmllexer.c
@@ -29,7 +29,6 @@
#include "xineutils.h"
#else
#define lprintf(...)
-#define xine_xmalloc malloc
#endif
#include "xmllexer.h"
#include <stdio.h>
@@ -534,7 +533,7 @@ static struct {
char *lexer_decode_entities (const char *tok)
{
- char *buf = xine_xmalloc (strlen (tok) + 1);
+ char *buf = calloc (strlen (tok) + 1, sizeof(char));
char *bp = buf;
char c;
diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c
index 14ce35c54..a4917429b 100644
--- a/src/xine-utils/xmlparser.c
+++ b/src/xine-utils/xmlparser.c
@@ -36,7 +36,7 @@
#include "xineutils.h"
#else
#define lprintf(...)
-#define xine_xmalloc malloc
+#define XINE_MALLOC
#endif
#include "xmllexer.h"
#include "xmlparser.h"
@@ -79,7 +79,7 @@ static void free_xml_node(xml_node_t * node) {
free(node);
}
-static xml_property_t * new_xml_property(void) {
+static xml_property_t *XINE_MALLOC new_xml_property(void) {
xml_property_t * new_property;
new_property = (xml_property_t*) malloc(sizeof(xml_property_t));
@@ -476,9 +476,9 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r
int token_buffer_size = TOKEN_SIZE;
int pname_buffer_size = TOKEN_SIZE;
int nname_buffer_size = TOKEN_SIZE;
- char *token_buffer = xine_xmalloc (token_buffer_size);
- char *pname_buffer = xine_xmalloc (pname_buffer_size);
- char *nname_buffer = xine_xmalloc (nname_buffer_size);
+ char *token_buffer = calloc(1, token_buffer_size);
+ char *pname_buffer = calloc(1, pname_buffer_size);
+ char *nname_buffer = calloc(1, nname_buffer_size);
res = _xml_parser_get_node(&token_buffer, &token_buffer_size,
&pname_buffer, &pname_buffer_size,
@@ -590,7 +590,7 @@ static int xml_escape_string_internal (char *buf, const char *s,
char *xml_escape_string (const char *s, xml_escape_quote_t quote_type)
{
- char *buf = xine_xmalloc (xml_escape_string_internal (NULL, s, quote_type));
+ char *buf = calloc (1, xml_escape_string_internal (NULL, s, quote_type));
return buf ? (xml_escape_string_internal (buf, s, quote_type), buf) : NULL;
}
@@ -598,11 +598,10 @@ static void xml_parser_dump_node (const xml_node_t *node, int indent) {
xml_property_t *p;
xml_node_t *n;
- int l;
printf ("%*s<%s ", indent, "", node->name);
- l = strlen (node->name);
+ size_t l = strlen (node->name);
p = node->props;
while (p) {