Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

prefixed all c functions to avoid Cabal bug #944

  • Loading branch information...
commit 54d35d6ade4a1a43bd922f7b9644770d489ca01a 1 parent 68b3372
@toothbrush toothbrush authored
View
2  cbits/gwinsz.c
@@ -1,6 +1,6 @@
#include <sys/ioctl.h>
-unsigned long c_get_window_size(void) {
+unsigned long vty_c_get_window_size(void) {
struct winsize w;
if (ioctl (0, TIOCGWINSZ, &w) >= 0)
return (w.ws_row << 16) + w.ws_col;
View
2  cbits/gwinsz.h
@@ -1 +1 @@
-unsigned long c_get_window_size(void);
+unsigned long vty_c_get_window_size(void);
View
20 cbits/mk_wcwidth.c
@@ -67,7 +67,7 @@ struct interval {
};
/* auxiliary function for binary search in interval table */
-static int bisearch(wchar_t ucs, const struct interval *table, int max) {
+static int vty_bisearch(wchar_t ucs, const struct interval *table, int max) {
int min = 0;
int mid;
@@ -119,7 +119,7 @@ static int bisearch(wchar_t ucs, const struct interval *table, int max) {
* in ISO 10646.
*/
-int mk_wcwidth(wchar_t ucs)
+int vty_mk_wcwidth(wchar_t ucs)
{
/* sorted list of non-overlapping intervals of non-spacing characters */
/* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */
@@ -181,7 +181,7 @@ int mk_wcwidth(wchar_t ucs)
return -1;
/* binary search in table of non-spacing characters */
- if (bisearch(ucs, combining,
+ if (vty_bisearch(ucs, combining,
sizeof(combining) / sizeof(struct interval) - 1))
return 0;
@@ -204,12 +204,12 @@ int mk_wcwidth(wchar_t ucs)
}
-int mk_wcswidth(const wchar_t *pwcs, size_t n)
+int vty_mk_wcswidth(const wchar_t *pwcs, size_t n)
{
int w, width = 0;
for (;n-- > 0; pwcs++)
- if ((w = mk_wcwidth(*pwcs)) < 0)
+ if ((w = vty_mk_wcwidth(*pwcs)) < 0)
return -1;
else
width += w;
@@ -227,7 +227,7 @@ int mk_wcswidth(const wchar_t *pwcs, size_t n)
* the traditional terminal character-width behaviour. It is not
* otherwise recommended for general use.
*/
-int mk_wcwidth_cjk(wchar_t ucs)
+int vty_mk_wcwidth_cjk(wchar_t ucs)
{
/* sorted list of non-overlapping intervals of East Asian Ambiguous
* characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
@@ -287,20 +287,20 @@ int mk_wcwidth_cjk(wchar_t ucs)
};
/* binary search in table of non-spacing characters */
- if (bisearch(ucs, ambiguous,
+ if (vty_bisearch(ucs, ambiguous,
sizeof(ambiguous) / sizeof(struct interval) - 1))
return 2;
- return mk_wcwidth(ucs);
+ return vty_mk_wcwidth(ucs);
}
-int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
+int vty_mk_wcswidth_cjk(const wchar_t *pwcs, size_t n)
{
int w, width = 0;
for (;n-- > 0; pwcs++)
- if ((w = mk_wcwidth_cjk(*pwcs)) < 0)
+ if ((w = vty_mk_wcwidth_cjk(*pwcs)) < 0)
return -1;
else
width += w;
View
2  cbits/set_term_timing.c
@@ -3,7 +3,7 @@
#include <unistd.h>
#include <stdlib.h>
-void set_term_timing(void)
+void vty_set_term_timing(void)
{
struct termios trm;
tcgetattr(STDIN_FILENO, &trm);
View
4 src/Codec/Binary/UTF8/Width.hs
@@ -25,7 +25,7 @@ wcwidth c = unsafePerformIO (withCWString [c] $! \ws -> do
)
{-# NOINLINE wcwidth #-}
-foreign import ccall unsafe "mk_wcwidth" wcwidth' :: CWchar -> CInt
+foreign import ccall unsafe "vty_mk_wcwidth" wcwidth' :: CWchar -> CInt
wcswidth :: String -> Int
wcswidth str = unsafePerformIO (withCWStringLen str $! \(ws, ws_len) -> do
@@ -36,4 +36,4 @@ wcswidth str = unsafePerformIO (withCWStringLen str $! \(ws, ws_len) -> do
)
{-# NOINLINE wcswidth #-}
-foreign import ccall unsafe "mk_wcswidth" wcswidth' :: Ptr CWchar -> CSize -> CInt
+foreign import ccall unsafe "vty_mk_wcswidth" wcswidth' :: Ptr CWchar -> CSize -> CInt
View
2  src/Graphics/Vty/LLInput.hs
@@ -236,4 +236,4 @@ utf8Length c
| c < 0xF0 = 3
| otherwise = 4
-foreign import ccall "set_term_timing" set_term_timing :: IO ()
+foreign import ccall "vty_set_term_timing" set_term_timing :: IO ()
View
2  src/Graphics/Vty/Terminal/TerminfoBased.hs
@@ -181,7 +181,7 @@ instance Terminal Term where
output_handle t = return (term_handle t)
-foreign import ccall "gwinsz.h c_get_window_size" c_get_window_size
+foreign import ccall "gwinsz.h vty_c_get_window_size" c_get_window_size
:: IO CLong
get_window_size :: IO (Int,Int)
View
2  vty.cabal
@@ -1,5 +1,5 @@
Name: vty
-Version: 4.7.0.10
+Version: 4.7.0.11
License: BSD3
License-file: LICENSE
Author: Stefan O'Rear, Corey O'Connor
Please sign in to comment.
Something went wrong with that request. Please try again.