logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

curs_sp_funcs - curses screen-pointer extension

Description

       This  implementation  can be configured to provide a set of functions which improve the ability to manage
       multiple screens.  This feature can be added to any of the configurations supported by ncurses;  it  adds
       new symbols without changing the meaning of any of the existing ones.

   ImprovedFunctions
       Most  of  the functions are new versions of existing functions.  A parameter is added at the front of the
       parameter list.  It is a SCREEN pointer.

       The existing functions all use the current screen, which is a static variable.   The  extended  functions
       use  the  specified  screen,  thereby  reducing  the number of variables which must be modified to update
       multiple screens.

   NewFunctions
       Here are the new functions:

       ceiling_panel
            this returns a pointer to the topmost panel in the given screen.

       ground_panel
            this returns a pointer to the lowest panel in the given screen.

       new_prescr
            when creating a new screen, the library uses static variables  which  have  been  preset,  e.g.,  by
            use_env(3NCURSES),  filter(3NCURSES),  etc.  With the screen-pointer extension, there are situations
            where it must create a current screen before the unextended library does.  The  new_prescr  function
            is  used  internally  to handle these cases.  It is also provided to allow applications to customize
            library initialization.

Name

curs_sp_funcs - curses screen-pointer extension

Notes

       This extension introduces some new names:

       NCURSES_SP_FUNCS
            This is set to the library patch-level number.  In the unextended library, this is zero (0), to make
            it useful for checking if the extension is provided.

       NCURSES_SP_NAME
            The new functions are named using the macro NCURSES_SP_NAME, which hides the actual  implementation.
            Currently this adds a “_sp” suffix to the name of the unextended function.  This manual page indexes
            the  extensions  showing the full name.  However the proper usage of these functions uses the macro,
            to  provide  for  the  possibility  of  changing  the  naming  convention   for   specific   library
            configurations.

       NCURSES_SP_OUTC
            This  is a new function-pointer type to use in the screen-pointer functions where an NCURSES_OUTC is
            used in the unextended library.

       NCURSES_OUTC
            This is a function-pointer type used for the cases where a function passes characters to the  output
            stream, e.g., vidputs(3NCURSES).

Portability

       These  routines  are  specific  to  ncurses.   They  were  not  supported  on  Version 7, BSD or System V
       implementations.  It is recommended that any code depending on ncurses extensions  be  conditioned  using
       NCURSES_SP_FUNCS.

See Also

ncurses(3NCURSES), opaque(3NCURSES), threads(3NCURSES)

ncurses 6.5                                        2025-02-01                                 sp_funcs(3NCURSES)

Synopsis

#include<curses.h>intalloc_pair_sp(SCREEN*sp,intfg,intbg);intassume_default_colors_sp(SCREEN*sp,intfg,intbg);intbaudrate_sp(SCREEN*sp);intbeep_sp(SCREEN*sp);boolcan_change_color_sp(SCREEN*sp);intcbreak_sp(SCREEN*sp);intcolor_content_sp(SCREEN*sp,shortcolor,short*r,short*g,short*b);intcurs_set_sp(SCREEN*sp,intvisibility);intdef_prog_mode_sp(SCREEN*sp);intdef_shell_mode_sp(SCREEN*sp);intdefine_key_sp(SCREEN*sp,constchar*definition,intkeycode);intdelay_output_sp(SCREEN*sp,intms);intdoupdate_sp(SCREEN*sp);intecho_sp(SCREEN*sp);intendwin_sp(SCREEN*sp);charerasechar_sp(SCREEN*sp);interasewchar_sp(SCREEN*sp,wchar_t*wc);intextended_color_content_sp(SCREEN*sp,intcolor,int*r,int*g,int*b);intextended_pair_content_sp(SCREEN*sp,intpair,int*fg,int*bg);intextended_slk_color_sp(SCREEN*sp,intpair);voidfilter_sp(SCREEN*sp);intfind_pair_sp(SCREEN*sp,intfg,intbg);intflash_sp(SCREEN*sp);intflushinp_sp(SCREEN*sp);intfree_pair_sp(SCREEN*sp,intpair);intget_escdelay_sp(SCREEN*sp);intgetmouse_sp(SCREEN*sp,MEVENT*event);WINDOW*getwin_sp(SCREEN*sp,FILE*filep);inthalfdelay_sp(SCREEN*sp,inttenths);boolhas_colors_sp(SCREEN*sp);boolhas_ic_sp(SCREEN*sp);boolhas_il_sp(SCREEN*sp);inthas_key_sp(SCREEN*sp,intc);boolhas_mouse_sp(SCREEN*sp);intinit_color_sp(SCREEN*sp,shortcolor,shortr,shortg,shortb);intinit_extended_color_sp(SCREEN*sp,intcolor,intr,intg,intb);intinit_extended_pair_sp(SCREEN*sp,intpair,intfg,intbg);intinit_pair_sp(SCREEN*sp,shortpair,shortfg,shortbg);intintrflush_sp(SCREEN*sp,WINDOW*win,boolbf);intis_cbreak_sp(SCREEN*sp);intis_echo_sp(SCREEN*sp);intis_nl_sp(SCREEN*sp);intis_raw_sp(SCREEN*sp);boolis_term_resized_sp(SCREEN*sp,intlines,intcolumns);boolisendwin_sp(SCREEN*sp);intkey_defined_sp(SCREEN*sp,constchar*definition);char*keybound_sp(SCREEN*sp,intkeycode,intcount);NCURSES_CONSTchar*keyname_sp(SCREEN*sp,intc);intkeyok_sp(SCREEN*sp,intkeycode,boolenable);charkillchar_sp(SCREEN*sp);intkillwchar_sp(SCREEN*sp,wchar_t*wc);char*longname_sp(SCREEN*sp);intmcprint_sp(SCREEN*sp,char*data,intlen);intmouseinterval_sp(SCREEN*sp,interval);mmask_tmousemask_sp(SCREEN*sp,mmask_tnewmask,mmask_t*oldmask);intmvcur_sp(SCREEN*sp,intoldrow,intoldcol,intnewrow,intnewcol);intnapms_sp(SCREEN*sp,intms);WINDOW*newpad_sp(SCREEN*sp,intnrows,intncols);SCREEN*new_prescr(void);SCREEN*newterm_sp(SCREEN*sp,constchar*type,FILE*outf,FILE*inf);WINDOW*newwin_sp(SCREEN*sp,intnlines,intncols,intbegin_y,intbegin_x);intnl_sp(SCREEN*sp);intnocbreak_sp(SCREEN*sp);intnoecho_sp(SCREEN*sp);voidnofilter_sp(SCREEN*sp);intnonl_sp(SCREEN*sp);voidnoqiflush_sp(SCREEN*sp);intnoraw_sp(SCREEN*sp);intpair_content_sp(SCREEN*sp,shortpair,short*fg,short*bg);voidqiflush_sp(SCREEN*sp);intraw_sp(SCREEN*sp);voidreset_color_pairs_sp(SCREEN*sp);intreset_prog_mode_sp(SCREEN*sp);intreset_shell_mode_sp(SCREEN*sp);intresetty_sp(SCREEN*sp);intresize_term_sp(SCREEN*sp,intlines,intcolumns);intresizeterm_sp(SCREEN*sp,intlines,intcolumns);intripoffline_sp(SCREEN*sp,intline,int(*init)(WINDOW*win,intfmt));intsavetty_sp(SCREEN*sp);intscr_init_sp(SCREEN*sp,constchar*filename);intscr_restore_sp(SCREEN*sp,constchar*filename);intscr_set_sp(SCREEN*sp,constchar*filename);intset_escdelay_sp(SCREEN*sp,intms);intset_tabsize_sp(SCREEN*sp,intcols);intslk_attrset_sp(SCREEN*sp,constchtypea);intslk_attr_set_sp(SCREEN*sp,constattr_tattrs,shortpair,void*opts);intslk_attroff_sp(SCREEN*sp,constchtypea);intslk_attron_sp(SCREEN*sp,constchtypea);attr_tslk_attr_sp(SCREEN*sp);intslk_clear_sp(SCREEN*sp);intslk_color_sp(SCREEN*sp,shortpair);intslk_init_sp(SCREEN*sp,intfmt);char*slk_label_sp(SCREEN*sp,intlabnum);intslk_noutrefresh_sp(SCREEN*sp);intslk_refresh_sp(SCREEN*sp);intslk_restore_sp(SCREEN*sp);intslk_set_sp(SCREEN*sp,intlabnum,constchar*label,intfmt);intslk_touch_sp(SCREEN*sp);intstart_color_sp(SCREEN*sp);attr_tterm_attrs_sp(SCREEN*sp);chtypetermattrs_sp(SCREEN*sp);char*termname_sp(SCREEN*sp);inttypeahead_sp(SCREEN*sp,intfd);intunget_wch_sp(SCREEN*sp,constwchar_twc);intungetch_sp(SCREEN*sp,intc);intungetmouse_sp(SCREEN*sp,MEVENT*event);intuse_default_colors_sp(SCREEN*sp);voiduse_env_sp(SCREEN*sp,boolbf);intuse_legacy_coding_sp(SCREEN*sp,intlevel);voiduse_tioctl_sp(SCREEN*sp,boolbf);intvid_attr_sp(SCREEN*sp,attr_tattrs,shortpair,void*opts);intvid_puts_sp(SCREEN*sp,attr_tattrs,shortpair,void*opts,NCURSES_SP_OUTCputc);intvidattr_sp(SCREEN*sp,chtypeattrs);intvidputs_sp(SCREEN*sp,chtypeattrs,NCURSES_SP_OUTCputc);wchar_t*wunctrl_sp(SCREEN*sp,cchar_t*wch);#include<form.h>FORM*new_form_sp(SCREEN*sp,FIELD**fields);#include<menu.h>MENU*new_menu_sp(SCREEN*sp,ITEM**items);#include<panel.h>PANEL*ceiling_panel(SCREEN*sp);PANEL*ground_panel(SCREEN*sp);voidupdate_panels_sp(SCREEN*sp);#include<term.h>intdel_curterm_sp(SCREEN*sp,TERMINAL*oterm);intputp_sp(SCREEN*sp,constchar*str);intrestartterm_sp(SCREEN*sp,NCURSES_CONSTchar*term,intfiledes,int*errret);TERMINAL*set_curterm_sp(SCREEN*sp,TERMINAL*nterm);inttgetent_sp(SCREEN*sp,char*bp,constchar*name);inttgetflag_sp(SCREEN*sp,constchar*capname);inttgetnum_sp(SCREEN*sp,constchar*capname);char*tgetstr_sp(SCREEN*sp,constchar*capname,char**area);char*tgoto_sp(SCREEN*sp,constchar*capname,intcol,introw);inttigetflag_sp(SCREEN*sp,constchar*capname);inttigetnum_sp(SCREEN*sp,constchar*capname);char*tigetstr_sp(SCREEN*sp,constchar*capname);/*tparm_spmayuse9longparametersratherthanbeingvariadic*/char*tparm_sp(SCREEN*sp,constchar*str,...);inttputs_sp(SCREEN*sp,constchar*str,intaffcnt,NCURSES_SP_OUTCputc);#include<unctrl.h>NCURSES_CONSTchar*unctrl_sp(SCREEN*sp,chtypech);

See Also