X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fnew_pair.h;h=49828d4a7725010d92935841baf5d064383f520e;hp=e34b4bed2e3a1d1efab6255a30a8947bdbe1bbce;hb=336aa0803853f7961dd31f1e35cd688d861ffd64;hpb=8e397cccba0aad135cb9a8a353756f4273a7cdf6 diff --git a/ncurses/new_pair.h b/ncurses/new_pair.h index e34b4bed..49828d4a 100644 --- a/ncurses/new_pair.h +++ b/ncurses/new_pair.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Free Software Foundation, Inc. * + * Copyright (c) 2017,2018 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 * @@ -33,15 +33,13 @@ /* * Common type definitions and macros for new_pair.c, lib_color.c * - * $Id: new_pair.h,v 1.6 2017/04/29 20:25:29 tom Exp $ + * $Id: new_pair.h,v 1.9 2018/03/01 15:02:12 tom Exp $ */ #ifndef NEW_PAIR_H #define NEW_PAIR_H 1 /* *INDENT-OFF* */ -#define USE_NEW_PAIR NCURSES_EXT_COLORS - #define LIMIT_TYPED(n,t) \ (t)(((n) > MAX_OF_TYPE(t)) \ ? MAX_OF_TYPE(t) \ @@ -54,9 +52,8 @@ #define MAX_XCURSES_PAIR MAX_OF_TYPE(NCURSES_PAIRS_T) -#if USE_NEW_PAIR +#if NCURSES_EXT_COLORS #define OPTIONAL_PAIR GCC_UNUSED -#define USE_NEW_PAIR NCURSES_EXT_COLORS #define get_extended_pair(opts, color_pair) \ if ((opts) != NULL) { \ *(int*)(opts) = color_pair; \ @@ -67,7 +64,6 @@ } #else #define OPTIONAL_PAIR /* nothing */ -#define USE_NEW_PAIR NCURSES_EXT_COLORS #define get_extended_pair(opts, color_pair) /* nothing */ #define set_extended_pair(opts, color_pair) \ if ((opts) != NULL) { \ @@ -88,7 +84,7 @@ typedef struct _color_pairs { int fg; int bg; -#if USE_NEW_PAIR +#if NCURSES_EXT_COLORS int mode; /* tells if the entry is allocated or free */ int prev; /* index of previous item */ int next; /* index of next item */ @@ -108,12 +104,15 @@ colorpair_t; #define ValidPair(sp,pair) \ ((sp != 0) && (pair >= 0) && (pair < sp->_pair_limit) && sp->_coloron) -#if USE_NEW_PAIR -extern NCURSES_EXPORT(void) _nc_set_color_pair(SCREEN*, int, int); +#if NCURSES_EXT_COLORS +extern NCURSES_EXPORT(void) _nc_copy_pairs(SCREEN*, colorpair_t*, colorpair_t*, int); +extern NCURSES_EXPORT(void) _nc_free_ordered_pairs(SCREEN*); extern NCURSES_EXPORT(void) _nc_reset_color_pair(SCREEN*, int, colorpair_t*); +extern NCURSES_EXPORT(void) _nc_set_color_pair(SCREEN*, int, int); #else -#define _nc_set_color_pair(sp, pair, mode) /* nothing */ +#define _nc_free_ordered_pairs(sp) /* nothing */ #define _nc_reset_color_pair(sp, pair, data) /* nothing */ +#define _nc_set_color_pair(sp, pair, mode) /* nothing */ #endif #else