~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/mbchar.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-11-28 03:03:42 UTC
  • mfrom: (8.3.4 sid)
  • Revision ID: package-import@ubuntu.com-20121128030342-21zanj8354gas5gr
Tags: 8.20-3ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Make 'uname -i -p' return the real processor/hardware, instead of
    unknown.
  - Build-depend on gettext:any instead of on gettext, so that apt-get can
    properly resolve build-dependencies on the tool when cross-building.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Multibyte character data type.
2
 
   Copyright (C) 2001, 2005-2007, 2009-2011 Free Software Foundation, Inc.
 
2
   Copyright (C) 2001, 2005-2007, 2009-2012 Free Software Foundation, Inc.
3
3
 
4
4
   This program is free software: you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
156
156
#include <wchar.h>
157
157
#include <wctype.h>
158
158
 
 
159
_GL_INLINE_HEADER_BEGIN
 
160
#ifndef MBCHAR_INLINE
 
161
# define MBCHAR_INLINE _GL_INLINE
 
162
#endif
 
163
 
159
164
#define MBCHAR_BUF_SIZE 24
160
165
 
161
166
struct mbchar
235
240
/* Unprintable characters appear as a small box of width 1.  */
236
241
#define MB_UNPRINTABLE_WIDTH 1
237
242
 
238
 
static inline int
 
243
MBCHAR_INLINE int
239
244
mb_width_aux (wint_t wc)
240
245
{
241
246
  int w = wcwidth (wc);
256
261
   (mbc)->wc = (mbc)->buf[0] = (sc))
257
262
 
258
263
/* Copying a character.  */
259
 
static inline void
 
264
MBCHAR_INLINE void
260
265
mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc)
261
266
{
262
267
  if (old_mbc->ptr == &old_mbc->buf[0])
304
309
 
305
310
extern const unsigned int is_basic_table[];
306
311
 
307
 
static inline bool
 
312
MBCHAR_INLINE bool
308
313
is_basic (char c)
309
314
{
310
315
  return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
313
318
 
314
319
#else
315
320
 
316
 
static inline bool
 
321
MBCHAR_INLINE bool
317
322
is_basic (char c)
318
323
{
319
324
  switch (c)
347
352
 
348
353
#endif
349
354
 
 
355
_GL_INLINE_HEADER_END
 
356
 
350
357
#endif /* _MBCHAR_H */