Move wcwidth.c and utf8.{h,c} to core.

This move makes sense since these files contain rather fundamental functions
(fundamental here means that we shouldn't have had to implement them)
which are required by other functions located in core/special-vars.c.
This commit is contained in:
Xavier G 2016-04-23 00:51:55 +02:00
commit e720a48ee9
7 changed files with 8 additions and 8 deletions

View file

@ -44,6 +44,8 @@ libcore_a_SOURCES = \
settings.c \ settings.c \
signals.c \ signals.c \
special-vars.c \ special-vars.c \
utf8.c \
wcwidth.c \
write-buffer.c write-buffer.c
structure_headers = \ structure_headers = \

View file

@ -8,12 +8,14 @@
#define is_big5_hi(hi) (0x81 <= (hi) && (hi) <= 0xFE) #define is_big5_hi(hi) (0x81 <= (hi) && (hi) <= 0xFE)
#define is_big5(hi,lo) (is_big5_hi(hi) && is_big5_lo(lo)) #define is_big5(hi,lo) (is_big5_hi(hi) && is_big5_lo(lo))
typedef guint32 unichar;
/* Returns width for character (0-2). */ /* Returns width for character (0-2). */
int mk_wcwidth(unichar c); int mk_wcwidth(unichar c);
/* Return the number of columns occupied by a given string. */ /* Return the number of columns occupied by a given string. */
int get_utf8_char_width(const gchar *); int get_utf8_char_width(const gchar *);
int get_utf8_string_width(const gchar *); int get_utf8_string_width(const gchar *, int);
int get_utf8_chars_for_width(const gchar *, unsigned int, int, unsigned int *); int get_utf8_chars_for_width(const gchar *, unsigned int, int, unsigned int *);
#define unichar_isprint(c) (((c) & ~0x80) >= 32) #define unichar_isprint(c) (((c) & ~0x80) >= 32)

View file

@ -60,6 +60,7 @@
*/ */
#include "module.h" #include "module.h"
#include "utf8.h"
struct interval { struct interval {
int first; int first;

View file

@ -24,8 +24,6 @@ libfe_common_core_a_SOURCES = \
fe-queries.c \ fe-queries.c \
fe-server.c \ fe-server.c \
fe-settings.c \ fe-settings.c \
utf8.c \
wcwidth.c \
formats.c \ formats.c \
hilight-text.c \ hilight-text.c \
keyboard.c \ keyboard.c \
@ -62,6 +60,3 @@ pkginc_fe_common_core_HEADERS = \
window-items.h \ window-items.h \
windows-layout.h \ windows-layout.h \
fe-windows.h fe-windows.h
noinst_HEADERS = \
utf8.h

View file

@ -2,7 +2,7 @@
#define MODULE_NAME "fe-common/core" #define MODULE_NAME "fe-common/core"
typedef guint32 unichar; #include "utf8.h"
typedef struct { typedef struct {
time_t time; time_t time;
char *nick; char *nick;

View file

@ -27,7 +27,7 @@ typedef struct _TERM_WINDOW TERM_WINDOW;
#define TERM_TYPE_UTF8 1 #define TERM_TYPE_UTF8 1
#define TERM_TYPE_BIG5 2 #define TERM_TYPE_BIG5 2
typedef guint32 unichar; #include "utf8.h"
extern TERM_WINDOW *root_window; extern TERM_WINDOW *root_window;
extern int term_width, term_height; extern int term_width, term_height;