~ubuntu-branches/ubuntu/utopic/gdmap/utopic

« back to all changes in this revision

Viewing changes to .pc/format-strings.patch/src/main.c

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2013-06-22 20:32:35 UTC
  • mfrom: (2.1.5 sid)
  • Revision ID: package-import@ubuntu.com-20130622203235-fh62mnmly6xwoox6
Tags: 0.8.1-3
* Import math-underlink.patch from Ubuntu, to link libm explicitly
  (Closes: #713618). Thanks to Daniel T Chen!
* Switch to my Debian address.
* Use canonical VCS URIs.
* Add format-strings.patch to fix format string vulnerabilites
  identified with hardening options enabled.
* Add gtk-set-locale.patch to drop deprecated gtk_set_locale().
* Switch to debhelper compat level 9 to enable automatic hardening.
* Use the final 1.0 copyright-format URL.
* Standards-Version 3.9.4, no further change required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2005-2006 sgop@users.sourceforge.net
 
2
 * This is free software distributed under the terms of the
 
3
 * GNU Public License.  See the file COPYING for details.
 
4
 */
 
5
/* $Revision: 1.8 $
 
6
 * $Date: 2008/05/23 14:54:28 $
 
7
 * $Author: sgop $
 
8
 */
 
9
 
 
10
#ifdef HAVE_CONFIG_H
 
11
#  include <config.h>
 
12
#endif
 
13
 
 
14
#include <gtk/gtk.h>
 
15
 
 
16
#include "l_i18n.h"
 
17
#include "gui_main.h"
 
18
#include "colors.h"
 
19
#include "preferences.h"
 
20
 
 
21
#define NL "\n"
 
22
 
 
23
static const char* GtkResource =
 
24
  "style \"event\" {"NL
 
25
  "  fg[NORMAL] = { 0, 0.5, 1.0 }"NL
 
26
  "  fg[PRELIGHT] = { 0.8, 0.6, 0.4 }"NL
 
27
  "}"NL
 
28
  ""NL
 
29
  "widget \"*EventLabel*\" style \"event\""NL;
 
30
 
 
31
static const char* Folder = NULL;
 
32
 
 
33
static GOptionEntry Options[] = {
 
34
  { "folder", 'f', 0, G_OPTION_ARG_STRING, &Folder, "Inspect folder", "dir" },
 
35
/*   { "mount", 'm', 0, G_OPTION_ARG_NONE, &AllowLeaveDevice, "Descend directories on other filesystems", NULL }, */
 
36
/*   { "reportedsize", 'r', 0, G_OPTION_ARG_NONE, &ReportedSize, "Don't show disk size of files but reported size", NULL }, */
 
37
  { NULL, 0, 0, 0, NULL, NULL, NULL }
 
38
};
 
39
 
 
40
static gboolean on_load() {
 
41
  if (Folder) gui_tree_load_and_display(Folder);
 
42
  return FALSE;
 
43
}
 
44
 
 
45
int main (int argc, char *argv[]) {
 
46
  GOptionContext* context = g_option_context_new("- Graphical Disk Map");
 
47
  GError* error = NULL;
 
48
 
 
49
        bindtextdomain(GETTEXT_PACKAGE, GDMAP_LOCALE_DIR);
 
50
        bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
 
51
        textdomain(GETTEXT_PACKAGE);
 
52
 
 
53
  g_option_context_set_ignore_unknown_options(context, FALSE);
 
54
  g_option_context_set_help_enabled(context, TRUE);
 
55
  g_option_context_add_main_entries(context, Options, NULL);
 
56
  if (!g_option_context_parse(context, &argc, &argv, &error)) {
 
57
    g_warning(error->message);
 
58
    g_option_context_free(context);
 
59
    return 0;
 
60
  }
 
61
  g_option_context_free(context);
 
62
  
 
63
  gtk_set_locale();
 
64
  gtk_init(&argc, &argv);
 
65
  
 
66
  gtk_rc_parse_string(GtkResource);
 
67
  
 
68
  gui_create_main_win();
 
69
 
 
70
  colors_init();
 
71
  pref_init();
 
72
 
 
73
  g_idle_add((GSourceFunc)on_load, NULL);
 
74
  
 
75
  gtk_main();
 
76
 
 
77
  return 0;
 
78
}
 
79