grim/guifications3
Clone
Summary
Browse
Changes
Graph
moved gflib-gtk to the new cmake module
cmake
2010-12-15, Gary Kramlich
b6418db658c1
moved gflib-gtk to the new cmake module
/*
* Guifications - The end-all, be-all notification framework
* Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#
include
<config.h>
#endif
/* HAVE_CONFIG_H */
#include
<stdio.h>
#include
<stdlib.h>
#include
<glib.h>
static
const
gchar
*
gpl
=
"/*
\n
"
" * %s
\n
"
" * %s
\n
"
" *
\n
"
" * Guifications - The end-all, be-all notification framework
\n
"
" * Copyright (C) 2003-2009 Gary Kramlich <grim@reaperworld.com>
\n
"
" *
\n
"
" * This program is free software: you can redistribute it and/or modify
\n
"
" * it under the terms of the GNU General Public License as published by
\n
"
" * the Free Software Foundation, either version 3 of the License, or
\n
"
" * (at your option) any later version.
\n
"
" *
\n
"
" * This program is distributed in the hope that it will be useful,
\n
"
" * but WITHOUT ANY WARRANTY; without even the implied warranty of
\n
"
" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\n
"
" * GNU General Public License for more details.
\n
"
" *
\n
"
" * You should have received a copy of the GNU General Public License
\n
"
" * along with this program. If not, see <http://www.gnu.org/licenses/>.
\n
"
" */
\n
"
;
/* static globals for GOption */
static
gchar
*
copyright
=
"Copyright (C) 2003-2009 Gary Kramich <grim@reaperworldcom>"
;
static
gchar
*
directory
=
NULL
;
static
gchar
*
symbol
=
"GF__H"
;
static
gchar
*
tagline
=
"Guifications - The end-all, be-all notification framework"
;
static
gchar
*
license
=
"gpl"
;
static
GOptionEntry
entries
[]
=
{
{
"copyright"
,
'c'
,
0
,
G_OPTION_ARG_STRING
,
&
copyright
,
"The copyright for the generated file."
,
"copyright"
,
},
{
"directory"
,
'd'
,
0
,
G_OPTION_ARG_STRING
,
&
directory
,
"The directory to use in the #include."
,
"directory"
,
},
{
"license"
,
'l'
,
0
,
G_OPTION_ARG_STRING
,
&
license
,
"The license to use."
,
"license"
,
},
{
"symbol"
,
's'
,
0
,
G_OPTION_ARG_STRING
,
&
symbol
,
"The symbol to
\"
protect
\"
the header file."
,
"symbol"
,
},
{
"tagline"
,
't'
,
0
,
G_OPTION_ARG_STRING
,
&
tagline
,
"The tagline to use."
,
"tagline"
,
},
{
NULL
},
};
gint
main
(
gint
argc
,
gchar
**
argv
)
{
GError
*
error
=
NULL
;
GOptionContext
*
ctx
=
NULL
;
gchar
*
slash
=
NULL
;
gint
i
;
ctx
=
g_option_context_new
(
"FILES"
);
g_option_context_add_main_entries
(
ctx
,
entries
,
GETTEXT_PACKAGE
);
g_option_context_parse
(
ctx
,
&
argc
,
&
argv
,
&
error
);
if
(
error
)
{
fprintf
(
stderr
,
"%s"
,
error
->
message
);
g_error_free
(
error
);
return
1
;
}
printf
(
gpl
,
tagline
,
copyright
);
printf
(
"#ifndef %s
\n
#define %s
\n\n
"
,
symbol
,
symbol
);
if
(
!
directory
)
directory
=
slash
=
""
;
else
slash
=
"/"
;
for
(
i
=
1
;
argv
[
i
];
i
++
)
printf
(
"#include <%s%s%s>
\n
"
,
directory
,
slash
,
argv
[
i
]);
printf
(
"
\n
#endif /* %s */
\n
"
,
symbol
);
return
0
;
}