Skip to content

Commit

Permalink
Move demangling-related code from common.h to demangle.h
Browse files Browse the repository at this point in the history
Adjust users accordingly.
  • Loading branch information
Petr Machata committed Mar 8, 2013
1 parent fdfcf7b commit 3ac8db6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
10 changes: 0 additions & 10 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
#include "proc.h"
#include "forward.h"

#if defined HAVE_LIBSUPC__ || defined HAVE_LIBSTDC__
# define USE_CXA_DEMANGLE
#endif
#if defined HAVE_LIBIBERTY || defined USE_CXA_DEMANGLE
# define USE_DEMANGLE
#endif

extern char * command;

extern int exiting; /* =1 if we have to exit ASAP */
Expand All @@ -69,9 +62,6 @@ struct opt_c_struct {

#include "options.h"
#include "output.h"
#ifdef USE_DEMANGLE
#include "demangle.h"
#endif

extern struct dict *dict_opt_c;

Expand Down
4 changes: 3 additions & 1 deletion demangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
#include <stdlib.h>
#include <stdio.h>

#include "common.h"
#include "demangle.h"
#include "dict.h"
#include "debug.h"

#ifdef USE_DEMANGLE

Expand Down
8 changes: 8 additions & 0 deletions demangle.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* This file is part of ltrace.
* Copyright (C) 2012 Petr Machata, Red Hat Inc.
* Copyright (C) 2006 Ian Wienand
*
* This program is free software; you can redistribute it and/or
Expand All @@ -20,6 +21,13 @@

#include "config.h"

#if defined HAVE_LIBSUPC__ || defined HAVE_LIBSTDC__
# define USE_CXA_DEMANGLE
#endif
#if defined HAVE_LIBIBERTY || defined USE_CXA_DEMANGLE
# define USE_DEMANGLE
#endif

extern char *cplus_demangle(const char *mangled, int options);

const char *my_demangle(const char *function_name);
Expand Down
1 change: 1 addition & 0 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "common.h"
#include "filter.h"
#include "glob.h"
#include "demangle.h"

#ifndef SYSCONFDIR
#define SYSCONFDIR "/etc"
Expand Down
1 change: 1 addition & 0 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "common.h"
#include "proc.h"
#include "demangle.h"
#include "library.h"
#include "type.h"
#include "value.h"
Expand Down

0 comments on commit 3ac8db6

Please sign in to comment.