diff --git a/doc/unw_strerror.man b/doc/unw_strerror.man index 467c44d2..e69de29b 100644 --- a/doc/unw_strerror.man +++ b/doc/unw_strerror.man @@ -1,63 +0,0 @@ -'\" t -.\" Manual page created with latex2man on Wed Aug 18 16:51:29 CEST 2004 -.\" NOTE: This file is generated, DO NOT EDIT. -.de Vb -.ft CW -.nf -.. -.de Ve -.ft R - -.fi -.. -.TH "UNW\\_STRERROR" "3" "18 August 2004" "Programming Library " "Programming Library " -.SH NAME -unw_strerror -\-\- get text corresponding to error code -.PP -.SH SYNOPSIS - -.PP -#include -.br -.PP -const char * -unw_strerror(int -err_code); -.br -.PP -.SH DESCRIPTION - -.PP -The unw_strerror() -routine maps the (negative) err_code -to a corresponding text message and returns it. -.PP -.SH RETURN VALUE - -.PP -The message that corresponds to err_code -or, if the -err_code -has no corresponding message, the text "invalid error -code". -.PP -.SH THREAD AND SIGNAL SAFETY - -.PP -unw_strerror() -is thread\-safe as well as safe to use -from a signal handler. -.PP -.SH AUTHOR - -.PP -Thomas Hallgren -.br -BEA Systems -.br -Stockholm, Sweden -.br -Email: \fBthallgre@bea.com\fP -.br -.\" NOTE: This file is generated, DO NOT EDIT. diff --git a/doc/unw_strerror.tex b/doc/unw_strerror.tex index 7cad0117..e69de29b 100644 --- a/doc/unw_strerror.tex +++ b/doc/unw_strerror.tex @@ -1,42 +0,0 @@ -\documentclass{article} -\usepackage[fancyhdr,pdf]{latex2man} - -\input{common.tex} - -\begin{document} - -\begin{Name}{3}{unw\_strerror}{Thomas Hallgren}{Programming Library}{unw\_strerror}unw\_strerror -- get text corresponding to error code -\end{Name} - -\section{Synopsis} - -\File{\#include $<$libunwind.h$>$}\\ - -\Type{const char *} \Func{unw\_strerror}(\Type{int} \Var{err\_code});\\ - -\section{Description} - -The \Func{unw\_strerror}() routine maps the (negative) \Var{err\_code} -to a corresponding text message and returns it. - -\section{Return Value} - -The message that corresponds to \Var{err\_code} or, if the -\Var{err\_code} has no corresponding message, the text "invalid error -code". - -\section{Thread and Signal Safety} - -\Func{unw\_strerror}() is thread-safe as well as safe to use -from a signal handler. - -\section{Author} - -\noindent -Thomas Hallgren\\ -BEA Systems\\ -Stockholm, Sweden\\ -Email: \Email{thallgre@bea.com}\\ -\LatexManEnd - -\end{document} diff --git a/src/mi/strerror.c b/src/mi/strerror.c index f1512a19..e69de29b 100644 --- a/src/mi/strerror.c +++ b/src/mi/strerror.c @@ -1,51 +0,0 @@ -/* libunwind - a platform-independent unwind library - Copyright (C) 2004 BEA Systems - Contributed by Thomas Hallgren - -This file is part of libunwind. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "internal.h" - -/* Returns the text corresponding to the given err_code or the - text "invalid error code" if the err_code is invalid. */ -const char * -unw_strerror (int err_code) -{ - const char *cp; - unw_error_t error = (unw_error_t)-err_code; - switch (error) - { - case UNW_ESUCCESS: cp = "no error"; break; - case UNW_EUNSPEC: cp = "unspecified (general) error"; break; - case UNW_ENOMEM: cp = "out of memory"; break; - case UNW_EBADREG: cp = "bad register number"; break; - case UNW_EREADONLYREG: cp = "attempt to write read-only register"; break; - case UNW_ESTOPUNWIND: cp = "stop unwinding"; break; - case UNW_EINVALIDIP: cp = "invalid IP"; break; - case UNW_EBADFRAME: cp = "bad frame"; break; - case UNW_EINVAL: cp = "unsupported operation or bad value"; break; - case UNW_EBADVERSION: cp = "unwind info has unsupported version"; break; - case UNW_ENOINFO: cp = "no unwind info found"; break; - default: cp = "invalid error code"; - } - return cp; -} diff --git a/tests/test-strerror.c b/tests/test-strerror.c index 582d3225..e69de29b 100644 --- a/tests/test-strerror.c +++ b/tests/test-strerror.c @@ -1,17 +0,0 @@ -#include -#include - -int -main (int argc, char **argv) -{ - int i, verbose = argc > 1; - const char *msg; - - for (i = 0; i < 16; ++i) - { - msg = unw_strerror (-i); - if (verbose) - printf ("%6d -> %s\n", -i, msg); - } - return 0; -}