summaryrefslogtreecommitdiffstats
path: root/runtime/tools
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-19 18:42:29 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-19 18:42:29 +0100
commit3848e00e0177abdb31bc600234967863ec487233 (patch)
tree24e98aae0cf331b430e63f4dfb712dc161d2190d /runtime/tools
parentbfb96c047b79b2aab5fd57a2472871508819f3ef (diff)
patch 7.4.1604v7.4.1604
Problem: Although emoji characters are ambiguous width, best is to treat them as full width. Solution: Update the Unicode character tables. Add the 'emoji' options. (Yasuhiro Matsumoto)
Diffstat (limited to 'runtime/tools')
-rw-r--r--runtime/tools/unicode.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim
index d733fe867e..dfe9cef417 100644
--- a/runtime/tools/unicode.vim
+++ b/runtime/tools/unicode.vim
@@ -251,6 +251,27 @@ func! BuildWidthTable(pattern, tableName)
wincmd p
endfunc
+" Build the amoji width table in a new buffer.
+func! BuildEmojiTable(pattern, tableName)
+ let ranges = []
+ for line in map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 'v:val=~a:pattern'), 'matchstr(v:val,"^\\S\\+")')
+ let token = split(line, '\.\.')
+ if len(token) == 1
+ call add(token, token[0])
+ endif
+ call add(ranges, printf("\t{0x%04x, 0x%04x},", "0x".token[0], "0x".token[1]))
+ endfor
+
+ " New buffer to put the result in.
+ new
+ exe "file " . a:tableName
+ call setline(1, " static struct interval " . a:tableName . "[] =")
+ call setline(2, " {")
+ call append('$', ranges)
+ call setline('$', getline('$')[:-2]) " remove last comma
+ call setline(line('$') + 1, " };")
+ wincmd p
+endfunc
" Try to avoid hitting E36
set equalalways
@@ -290,3 +311,9 @@ call BuildWidthTable('[WF]', 'doublewidth')
" Build the ambiguous width table.
call BuildWidthTable('A', 'ambiguous')
+
+" Edit the emoji text file. Requires the netrw plugin.
+edit http://www.unicode.org/Public/emoji/3.0/emoji-data.txt
+
+" Build the emoji table. Ver. 1.0 - 6.0
+call BuildEmojiTable('; Emoji\s\+# [1-6]\.[0-9]', 'emoji')
bb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later

.. _ca_fopen:

====================
Digital TV CA open()
====================

Name
----

Digital TV CA open()


Synopsis
--------

.. c:function:: int open(const char *name, int flags)
    :name: dvb-ca-open


Arguments
---------

``name``
  Name of specific Digital TV CA device.

``flags``
  A bit-wise OR of the following flags:

.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|

.. flat-table::
    :header-rows:  0
    :stub-columns: 0
    :widths: 1 16

    -  - ``O_RDONLY``
       - read-only access

    -  - ``O_RDWR``
       - read/write access

    -  - ``O_NONBLOCK``
       - open in non-blocking mode
         (blocking mode is the default)


Description
-----------

This system call opens a named ca device (e.g. ``/dev/dvb/adapter?/ca?``)
for subsequent use.

When an ``open()`` call has succeeded, the device will be ready for use. The
significance of blocking or non-blocking mode is described in the
documentation for functions where there is a difference. It does not
affect the semantics of the ``open()`` call itself. A device opened in
blocking mode can later be put into non-blocking mode (and vice versa)
using the ``F_SETFL`` command of the ``fcntl`` system call. This is a
standard system call, documented in the Linux manual page for fcntl.
Only one user can open the CA Device in ``O_RDWR`` mode. All other
attempts to open the device in this mode will fail, and an error code
will be returned.


Return Value
------------


On success 0 is returned.

On error -1 is returned, and the ``errno`` variable is set
appropriately.

Generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.