curs_threads 3x

curs_threads(3x)                                       curs_threads(3x)


       curs_threads - curses thread support
       get_escdelay, set_escdelay, set_tabsize, use_screen, 
       use_window - curses マルチスレッド支援機能


       #include <curses.h>

       typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *);
       typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *);
       int get_escdelay(void);
       int set_escdelay(int size);
       int set_tabsize(int size);
       int  use_screen(SCREEN  *scr, NCURSES_SCREEN_CB func, void
       int use_window(WINDOW *win, NCURSES_WINDOW_CB  func,  void


       This  implementation can be configured to provide rudimen-
       tary support for multi-threaded applications.  This  makes
       a  different set of libraries, e.g., libncursest since the
       binary interfaces are different.
       異なるライブラリ群、例えば libncursest などを作ります。

       Rather than modify the interfaces to pass a thread  speci-
       fier  to  each function, it adds a few functions which can
       be used in any configuration which hide the mutex's needed
       to  prevent  concurrent  use  of the global variables when
       configured for threading.

       In addition to forcing access to  members  of  the  WINDOW
       structure  to  be  via functions (see curs_opaque(3x)), it
       makes functions of the common global variables, e.g., COL-
       newscr and ttytype.  Those  variables  are  maintained  as
       read-only values, stored in the SCREEN structure.
        WINDOW 構造体のメンバへのアクセスを強制的に関数経由にする
       ことに加え( curs_opaque(3x) を参照 )、この構成は一般的な
       広域変数用の関数、例えば COLORS, COLOR_PAIRS, COLS, ESCDELAY, 
       LINES, TABSIZE, curscr, newscr, ttytype を作ります。
       SCREEN 構造体の中に格納します。

       Even  this is not enough to make a thread-safe application
       using curses.  A multi-threaded application would  be  ex-
       pected  to  have threads updating separate windows (within
       the same device), or updating on separate screens (on dif-
       ferent  devices).  Also, a few of the global variables are
       considered writable by some applications.   The  functions
       described here address these special situations.
        しかしこれは、 curses を使った安全なマルチスレッド・

       The  ESCDELAY and TABSIZE global variables are modified by
       some applications.  To modify them in  any  configuration,
       use  the  set_escdelay  or  set_tabsize  functions.  Other
       global variables are not modifiable.
        広域変数 ESCDELAY と TABSIZE の値を変更する
       set_escdelay または set_tabsize 関数を使ってください。

       The get_escdelay function returns the value for ESCDELAY.
        get_escdelay 関数は ESCDELAY の値を返します。

       The use_window and  use_screen  functions  provide  coarse
       granularity mutexes for their respective WINDOW and SCREEN
       parameters, and call a user-supplied function, passing  it
       a  data  parameter, and returning the value from the user-
       supplied function to the application.
        use_windowuse_screen 関数は、それぞれ WINDOW 型と 
       SCREEN 型の引数に対する粒度の粗いミューテックスを与え、
       与えられた関数を呼び出して引数 data を渡し、
       (訳注: 書式では引数は WINDOW * 型か SCREEN * 型)


       All of the ncurses library functions assume that  the  lo-
       cale  is  not altered during operation.  In addition, they
       use data which is maintained within a hierarchy of scopes.
        ncurses ライブラリ関数はすべて、操作の間はロケールが

          o   global data, e.g., used in the  low-level  terminfo
              or termcap interfaces.
              広域データ。例えば、低レベルの terminfo または 
              termcap インターフェイスで使われるもの。

          o   terminal  data,  e.g.,  associated  with  a call to
              set_curterm.  The  terminal  data  are  initialized
              when screens are created.
              端末ごとのデータ。例えば、 set_curterm の呼び出しに

          o   screen  data,  e.g.,  associated  with  a  call  to
              newterm or initscr.
              画面ごとのデータ。例えば、 newterm または initscr の

          o   window data, e.g., associated with a call to newwin
              or  subwin.   Windows  are associated with screens.
              Pads are not necessarily associated with a particu-
              lar screen.
              ウインドウごとのデータ。例えば、 newwin または 
              subwin の呼び出しに伴うもの。

              Most  curses  applications  operate  on one or more
              windows within a single screen.
              多くの curses アプリケーションは1つの画面内の

          o   reentrant, i.e., it uses only the  data  passed  as

       This table lists the scope of data used for each symbol in
       the ncurses library  when  it  is  configured  to  support
       ncurses ライブラリの各識別子が扱うデータのスコープの一覧です。

      Symbol                  Scope
      識別子                  スコープ
      BC                      global
      COLORS                  screen (readonly 読み込み専用)
      COLOR_PAIR              reentrant
      COLOR_PAIRS             screen (readonly 読み込み専用)
      COLS                    screen (readonly 読み込み専用)
      ESCDELAY                screen (readonly 読み込み専用, see set_escdelay を参照)
      LINES                   screen (readonly 読み込み専用)
      PAIR_NUMBER             reentrant
      PC                      global
      SP                      global
      TABSIZE                 screen (readonly 読み込み専用)
      UP                      global
      acs_map                 screen (readonly 読み込み専用)
      add_wch                 window (stdscr)
      add_wchnstr             window (stdscr)
      add_wchstr              window (stdscr)
      addch                   window (stdscr)
      addchnstr               window (stdscr)
      addchstr                window (stdscr)
      addnstr                 window (stdscr)
      addnwstr                window (stdscr)
      addstr                  window (stdscr)
      addwstr                 window (stdscr)
      assume_default_colors   screen
      attr_get                window (stdscr)
      attr_off                window (stdscr)
      attr_on                 window (stdscr)
      attr_set                window (stdscr)
      attroff                 window (stdscr)
      attron                  window (stdscr)
      attrset                 window (stdscr)
      baudrate                screen
      beep                    screen
      bkgd                    window (stdscr)
      bkgdset                 window (stdscr)
      bkgrnd                  window (stdscr)
      bkgrndset               window (stdscr)
      boolcodes               global (readonly 読み込み専用)
      boolfnames              global (readonly 読み込み専用)
      boolnames               global (readonly 読み込み専用)
      border                  window (stdscr)

      border_set              window (stdscr)
      box                     window (stdscr)
      box_set                 window (stdscr)
      can_change_color        terminal
      cbreak                  screen
      chgat                   window (stdscr)
      clear                   window (stdscr)
      clearok                 window
      clrtobot                window (stdscr)
      clrtoeol                window (stdscr)
      color_content           screen
      color_set               window (stdscr)
      copywin                 window locks(source, target コピー元, コピー先)をロック
      cur_term                terminal
      curs_set                screen
      curscr                  screen (readonly 読み込み専用)
      curses_version          global (readonly 読み込み専用)
      def_prog_mode           terminal
      def_shell_mode          terminal
      define_key              screen
      del_curterm             screen
      delay_output            screen
      delch                   window (stdscr)
      deleteln                window (stdscr)
      delscreen               global locks(screenlist, screen 画面リスト, 画面)をロック
      delwin                  global locks(windowlist ウインドウリスト)をロック
      derwin                  screen
      doupdate                screen
      dupwin                  screen locks(window ウインドウ)をロック
      echo                    screen
      echo_wchar              window (stdscr)
      echochar                window (stdscr)
      endwin                  screen
      erase                   window (stdscr)
      erasechar               window (stdscr)
      erasewchar              window (stdscr)
      filter                  global
      flash                   terminal
      flushinp                screen
      get_wch                 screen (input-operation 入力動作)
      get_wstr                screen (input-operation 入力動作)
      getattrs                window
      getbegx                 window
      getbegy                 window
      getbkgd                 window
      getbkgrnd               window
      getcchar                reentrant
      getch                   screen (input-operation 入力動作)
      getcurx                 window
      getcury                 window
      getmaxx                 window
      getmaxy                 window
      getmouse                screen (input-operation 入力動作)
      getn_wstr               screen (input-operation 入力動作)
      getnstr                 screen (input-operation 入力動作)
      getparx                 window
      getpary                 window
      getstr                  screen (input-operation 入力動作)
      getwin                  screen (input-operation 入力動作)
      halfdelay               screen
      has_colors              terminal
      has_ic                  terminal
      has_il                  terminal
      has_key                 screen
      hline                   window (stdscr)
      hline_set               window (stdscr)

      idcok                   window
      idlok                   window
      immedok                 window
      in_wch                  window (stdscr)
      in_wchnstr              window (stdscr)
      in_wchstr               window (stdscr)
      inch                    window (stdscr)
      inchnstr                window (stdscr)
      inchstr                 window (stdscr)
      init_color              screen
      init_pair               screen
      initscr                 global locks(screenlist 画面リスト)をロック
      innstr                  window (stdscr)
      innwstr                 window (stdscr)
      ins_nwstr               window (stdscr)
      ins_wch                 window (stdscr)
      ins_wstr                window (stdscr)
      insch                   window (stdscr)
      insdelln                window (stdscr)
      insertln                window (stdscr)
      insnstr                 window (stdscr)
      insstr                  window (stdscr)
      instr                   window (stdscr)
      intrflush               terminal
      inwstr                  window (stdscr)
      is_cleared              window
      is_idcok                window
      is_idlok                window
      is_immedok              window
      is_keypad               window
      is_leaveok              window
      is_linetouched          window
      is_nodelay              window
      is_notimeout            window
      is_scrollok             window
      is_syncok               window
      is_term_resized         terminal
      is_wintouched           window
      isendwin                screen
      key_defined             screen
      key_name                global (static data 静的データ)
      keybound                screen
      keyname                 global (static data 静的データ)
      keyok                   screen
      keypad                  window
      killchar                terminal
      killwchar               terminal
      leaveok                 window
      longname                screen
      mcprint                 terminal
      meta                    screen
      mouse_trafo             window (stdscr)
      mouseinterval           screen
      mousemask               screen
      move                    window (stdscr)
      mvadd_wch               window (stdscr)
      mvadd_wchnstr           window (stdscr)
      mvadd_wchstr            window (stdscr)
      mvaddch                 window (stdscr)
      mvaddchnstr             window (stdscr)
      mvaddchstr              window (stdscr)
      mvaddnstr               window (stdscr)
      mvaddnwstr              window (stdscr)
      mvaddstr                window (stdscr)
      mvaddwstr               window (stdscr)
      mvchgat                 window (stdscr)

      mvcur                   screen
      mvdelch                 window (stdscr)
      mvderwin                window (stdscr)
      mvget_wch               screen (input-operation 入力動作)
      mvget_wstr              screen (input-operation 入力動作)
      mvgetch                 screen (input-operation 入力動作)
      mvgetn_wstr             screen (input-operation 入力動作)
      mvgetnstr               screen (input-operation 入力動作)
      mvgetstr                screen (input-operation 入力動作)
      mvhline                 window (stdscr)
      mvhline_set             window (stdscr)
      mvin_wch                window (stdscr)
      mvin_wchnstr            window (stdscr)
      mvin_wchstr             window (stdscr)
      mvinch                  window (stdscr)
      mvinchnstr              window (stdscr)
      mvinchstr               window (stdscr)
      mvinnstr                window (stdscr)
      mvinnwstr               window (stdscr)
      mvins_nwstr             window (stdscr)
      mvins_wch               window (stdscr)
      mvins_wstr              window (stdscr)
      mvinsch                 window (stdscr)
      mvinsnstr               window (stdscr)
      mvinsstr                window (stdscr)
      mvinstr                 window (stdscr)
      mvinwstr                window (stdscr)
      mvprintw                window (stdscr)
      mvscanw                 screen
      mvvline                 window (stdscr)
      mvvline_set             window (stdscr)
      mvwadd_wch              window
      mvwadd_wchnstr          window
      mvwadd_wchstr           window
      mvwaddch                window
      mvwaddchnstr            window
      mvwaddchstr             window
      mvwaddnstr              window
      mvwaddnwstr             window
      mvwaddstr               window
      mvwaddwstr              window
      mvwchgat                window
      mvwdelch                window
      mvwget_wch              screen (input-operation 入力動作)
      mvwget_wstr             screen (input-operation 入力動作)
      mvwgetch                screen (input-operation 入力動作)
      mvwgetn_wstr            screen (input-operation 入力動作)
      mvwgetnstr              screen (input-operation 入力動作)
      mvwgetstr               screen (input-operation 入力動作)
      mvwhline                window
      mvwhline_set            window
      mvwin                   window
      mvwin_wch               window
      mvwin_wchnstr           window
      mvwin_wchstr            window
      mvwinch                 window
      mvwinchnstr             window
      mvwinchstr              window
      mvwinnstr               window
      mvwinnwstr              window
      mvwins_nwstr            window
      mvwins_wch              window
      mvwins_wstr             window
      mvwinsch                window
      mvwinsnstr              window
      mvwinsstr               window

      mvwinstr                window
      mvwinwstr               window
      mvwprintw               window
      mvwscanw                screen
      mvwvline                window
      mvwvline_set            window
      napms                   reentrant
      newpad                  global locks(windowlist ウインドウリスト)をロック
      newscr                  screen (readonly 読み込み専用)
      newterm                 global locks(screenlist 画面リスト)をロック
      newwin                  global locks(windowlist ウインドウリスト)をロック
      nl                      screen
      nocbreak                screen
      nodelay                 window
      noecho                  screen
      nofilter                global
      nonl                    screen
      noqiflush               terminal
      noraw                   screen
      notimeout               window
      numcodes                global (readonly 読み込み専用)
      numfnames               global (readonly 読み込み専用)
      numnames                global (readonly 読み込み専用)
      ospeed                  global
      overlay                 window locks(source, target コピー元, コピー先)をロック
      overwrite               window locks(source, target コピー元, コピー先)をロック
      pair_content            screen
      pecho_wchar             screen
      pechochar               screen
      pnoutrefresh            screen
      prefresh                screen
      printw                  window
      putp                    global
      putwin                  window
      qiflush                 terminal
      raw                     screen
      redrawwin               window
      refresh                 screen
      reset_prog_mode         screen
      reset_shell_mode        screen
      resetty                 terminal
      resize_term             screen locks(windowlist ウインドウリスト)をロック
      resizeterm              screen
      restartterm             screen
      ripoffline              global (static data 静的データ)
      savetty                 terminal
      scanw                   screen
      scr_dump                screen
      scr_init                screen
      scr_restore             screen
      scr_set                 screen
      scrl                    window (stdscr)
      scroll                  window
      scrollok                window
      set_curterm             screen
      set_escdelay            screen
      set_tabsize             screen
      set_term                global locks(screenlist, screen 画面リスト, 画面)をロック
      setcchar                reentrant
      setscrreg               window (stdscr)
      setupterm               global
      slk_attr                screen
      slk_attr_off            screen
      slk_attr_on             screen
      slk_attr_set            screen
      slk_attroff             screen

      slk_attron              screen
      slk_attrset             screen
      slk_clear               screen
      slk_color               screen
      slk_init                screen
      slk_label               screen
      slk_noutrefresh         screen
      slk_refresh             screen
      slk_restore             screen
      slk_set                 screen
      slk_touch               screen
      slk_wset                screen
      standend                window
      standout                window
      start_color             screen
      stdscr                  screen (readonly 読み込み専用)
      strcodes                global (readonly 読み込み専用)
      strfnames               global (readonly 読み込み専用)
      strnames                global (readonly 読み込み専用)
      subpad                  window
      subwin                  window
      syncok                  window
      term_attrs              screen
      termattrs               screen
      termname                terminal
      tgetent                 global
      tgetflag                global
      tgetnum                 global
      tgetstr                 global
      tgoto                   global
      tigetflag               terminal
      tigetnum                terminal
      tigetstr                terminal
      timeout                 window (stdscr)
      touchline               window
      touchwin                window
      tparm                   global (static data 静的データ)
      tputs                   screen
      trace                   global (static data 静的データ)
      ttytype                 screen (readonly 読み込み専用)
      typeahead               screen
      unctrl                  screen
      unget_wch               screen (input-operation 入力動作)
      ungetch                 screen (input-operation 入力動作)
      ungetmouse              screen (input-operation 入力動作)
      untouchwin              window
      use_default_colors      screen
      use_env                 global (static data 静的データ)
      use_extended_names      global (static data 静的データ)
      use_legacy_coding       screen
      use_screen              global locks(screenlist, screen 画面リスト, 画面)をロック
      use_window              global locks(windowlist, window ウインドウリスト, ウインドウ)をロック
      vid_attr                screen
      vid_puts                screen
      vidattr                 screen
      vidputs                 screen
      vline                   window (stdscr)
      vline_set               window (stdscr)
      vw_printw               window
      vw_scanw                screen
      vwprintw                window
      vwscanw                 screen
      wadd_wch                window
      wadd_wchnstr            window
      wadd_wchstr             window
      waddch                  window

      waddchnstr              window
      waddchstr               window
      waddnstr                window
      waddnwstr               window
      waddstr                 window
      waddwstr                window
      wattr_get               window
      wattr_off               window
      wattr_on                window
      wattr_set               window
      wattroff                window
      wattron                 window
      wattrset                window
      wbkgd                   window
      wbkgdset                window
      wbkgrnd                 window
      wbkgrndset              window
      wborder                 window
      wborder_set             window
      wchgat                  window
      wclear                  window
      wclrtobot               window
      wclrtoeol               window
      wcolor_set              window
      wcursyncup              screen (affects window plus parents ウインドウとその親に影響)
      wdelch                  window
      wdeleteln               window
      wecho_wchar             window
      wechochar               window
      wenclose                window
      werase                  window
      wget_wch                screen (input-operation 入力動作)
      wget_wstr               screen (input-operation 入力動作)
      wgetbkgrnd              window
      wgetch                  screen (input-operation 入力動作)
      wgetdelay               window
      wgetn_wstr              screen (input-operation 入力動作)
      wgetnstr                screen (input-operation 入力動作)
      wgetparent              window
      wgetscrreg              window
      wgetstr                 screen (input-operation 入力動作)
      whline                  window
      whline_set              window
      win_wch                 window
      win_wchnstr             window
      win_wchstr              window
      winch                   window
      winchnstr               window
      winchstr                window
      winnstr                 window
      winnwstr                window
      wins_nwstr              window
      wins_wch                window
      wins_wstr               window
      winsch                  window
      winsdelln               window
      winsertln               window
      winsnstr                window
      winsstr                 window
      winstr                  window
      winwstr                 window
      wmouse_trafo            window
      wmove                   window
      wnoutrefresh            screen
      wprintw                 window
      wredrawln               window

      wrefresh                screen
      wresize                 window locks(windowlist ウインドウリスト)をロック
      wscanw                  screen
      wscrl                   window
      wsetscrreg              window
      wstandend               window
      wstandout               window
      wsyncdown               screen (affects window plus parents ウインドウとその親に影響)
      wsyncup                 screen (affects window plus parents ウインドウとその親に影響)
      wtimeout                window
      wtouchln                window
      wunctrl                 global (static data 静的データ)
      wvline                  window
      wvline_set              window


       These functions all return TRUE or FALSE, except as noted.
        特記がない場合、これらの関数はすべて TRUEFALSE を
        (訳注: set_escdelay, set_tabsize の戻り値の意味については


       Both a macro and a function are provided for each name.


       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 ex-
       tensions be conditioned using NCURSES_VERSION.
        これらのルーチンは ncurses に固有です。
        Version 7, BSD, System V の実装ではサポートされていません。
        ncurses の拡張機能に依存するコードは、
       必ず NCURSES_VERSION で条件付けておくことを推奨します。


       curses(3x), curs_opaque(3x), curs_variables(3x).