mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
cf2c17a13d
Original commit message from CVS: * po/POTFILES.in: * tools/Makefile.am: * tools/tools.h: add tools.h for common stuff of all our tools. Currently does what's necessary for the --version command line switch. * tools/gst-compprep.c: (main): * tools/gst-inspect.c: (main): * tools/gst-launch.1.in: * tools/gst-launch.c: (main): * tools/gst-md5sum.1.in: * tools/gst-md5sum.c: (main): * tools/gst-register.1.in: * tools/gst-register.c: (main): * tools/gst-typefind.1.in: * tools/gst-typefind.c: (main): * tools/gst-xmlinspect.1.in: * tools/gst-xmlinspect.c: (main): * tools/gst-xmllaunch.1.in: add and document --version switch to all tools.
62 lines
1.9 KiB
C
62 lines
1.9 KiB
C
/* GStreamer
|
|
* Copyright (C) 2005 Benjamin Otte <otte@gnome.org>
|
|
*
|
|
* tools.h: header for common stuff of all GStreamer tools
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library 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
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
|
|
#ifndef __GST_TOOLS_H__
|
|
#define __GST_TOOLS_H__
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
# include "config.h"
|
|
#endif
|
|
|
|
#include <stdlib.h>
|
|
#include <gst/gst.h>
|
|
#include "gst/gst-i18n-app.h"
|
|
|
|
/*
|
|
* This is a kind of hacky way to make all the tools use the same version code.
|
|
* If anyone knows a less hacky way to get this done, feel free to implement it.
|
|
*
|
|
* It also includes all the files that all the tools require.
|
|
*/
|
|
|
|
static gboolean __gst_tools_version = FALSE;
|
|
|
|
#define GST_TOOLS_POPT_VERSION {"version", '\0', POPT_ARG_NONE, \
|
|
&__gst_tools_version, 0, N_("print version information and exit"), NULL}
|
|
|
|
void
|
|
gst_tools_print_version (const char *program)
|
|
{
|
|
if (__gst_tools_version) {
|
|
gint major, minor, micro;
|
|
|
|
gst_version (&major, &minor, µ);
|
|
g_print ("GStreamer (%s) %s %s\n\n", program, GST_PACKAGE, GST_VERSION);
|
|
g_print ("provided by %s\n", GST_ORIGIN);
|
|
g_print ("release %s\n", GST_VERSION_RELEASE);
|
|
g_print ("using GStreamer Core Library version %d.%d.%d\n", major, minor, micro);
|
|
exit (0);
|
|
}
|
|
g_set_prgname (program);
|
|
}
|
|
|
|
#endif /* __GST_TOOLS_H__ */
|