X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=menu%2Fmf_common.h;h=cff6563fba4a8fbcb300207ddb3f28e7d6ed44c0;hp=5b02eb4ce46fed9994f3b239c6586409da331412;hb=4204d0154d2ee2d272807a0023d38ed9035ea555;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8 diff --git a/menu/mf_common.h b/menu/mf_common.h index 5b02eb4c..cff6563f 100644 --- a/menu/mf_common.h +++ b/menu/mf_common.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2004,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,7 +30,7 @@ * Author: Juergen Pfeifer, 1995,1997 * ****************************************************************************/ -/* $Id: mf_common.h,v 0.21 2004/12/11 22:40:40 tom Exp $ */ +/* $Id: mf_common.h,v 0.24 2012/06/10 00:06:54 tom Exp $ */ /* Common internal header for menu and form library */ @@ -63,10 +63,9 @@ extern int errno; #if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else -#define MODULE_ID(id) /*nothing*/ +#define MODULE_ID(id) /*nothing */ #endif - /* Maximum regular 8-bit character code */ #define MAX_REGULAR_CHARACTER (0xff) @@ -80,25 +79,19 @@ extern int errno; #endif /* The few common values in the status fields for menus and forms */ -#define _POSTED (0x01U) /* menu or form is posted */ -#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */ +#define _POSTED (0x01U) /* menu or form is posted */ +#define _IN_DRIVER (0x02U) /* menu or form is processing hook routine */ + +#define SetStatus(target,mask) (target)->status |= (unsigned short) (mask) +#define ClrStatus(target,mask) (target)->status = (unsigned short) (target->status & (~mask)) /* Call object hook */ #define Call_Hook( object, handler ) \ if ( (object) != 0 && ((object)->handler) != (void *) 0 )\ {\ - (object)->status |= _IN_DRIVER;\ + SetStatus(object, _IN_DRIVER);\ (object)->handler(object);\ - (object)->status &= ~_IN_DRIVER;\ + ClrStatus(object, _IN_DRIVER);\ } -#define INLINE - -#ifndef TRACE -# if CC_HAS_INLINE_FUNCS -# undef INLINE -# define INLINE inline -# endif -#endif - #endif /* MF_COMMON_H_incl */