[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sig2str and str2sig use in C++
From: |
Paul Eggert |
Subject: |
Re: sig2str and str2sig use in C++ |
Date: |
Mon, 10 Jun 2013 15:47:20 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 |
On 06/05/13 09:57, Daniel J Sebald wrote:
>
>
> Well, taking this all into consideration, perhaps the easiest thing to do is
> construct a table at runtime on the heap:
I'd rather avoid the runtime overhead.
How about something like this?
enum { HUP_OFFSET = 0 };
#define HUP_STRING "string for SIGHUP"
enum { INT_OFFSET = HUP_OFFSET + sizeof HUP_STRING };
#define INT_STRING "string for SIGINT"
enum { QUIT_OFFSET = INT_OFFSET + sizeof INT_STRING };
#define QUIT_STRING "string for SIGQUIT"
A bit awkward, but no repeated strings; and I've seen worse.
- sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/01
- Re: sig2str and str2sig use in C++, Paul Eggert, 2013/06/02
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/03
- Re: sig2str and str2sig use in C++, Paul Eggert, 2013/06/03
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/03
- Re: sig2str and str2sig use in C++, Thien-Thi Nguyen, 2013/06/04
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/04
- Re: sig2str and str2sig use in C++, Thien-Thi Nguyen, 2013/06/05
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/05
- Re: sig2str and str2sig use in C++,
Paul Eggert <=
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/10
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/10
- Re: sig2str and str2sig use in C++, Paul Eggert, 2013/06/11
- Re: sig2str and str2sig use in C++, Bruce Korb, 2013/06/13
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/13
- Re: sig2str and str2sig use in C++, Bruce Korb, 2013/06/13
- Re: sig2str and str2sig use in C++, Daniel J Sebald, 2013/06/05