~ubuntu-branches/ubuntu/trusty/grub2/trusty-updates

« back to all changes in this revision

Viewing changes to include/grub/unicode.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-09-13 18:02:04 UTC
  • mfrom: (1.17.15 upstream)
  • mto: (17.6.27 experimental)
  • mto: This revision was merged to the branch mainline in revision 145.
  • Revision ID: package-import@ubuntu.com-20120913180204-mojnmocbimlom4im
Tags: upstream-2.00
ImportĀ upstreamĀ versionĀ 2.00

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
struct grub_unicode_compact_range
33
33
{
34
 
  grub_uint32_t start:21;
35
 
  grub_uint32_t end:21;
36
 
  grub_uint8_t bidi_type:5;
37
 
  grub_uint8_t comb_type;
38
 
  grub_uint8_t bidi_mirror:1;
39
 
  grub_uint8_t join_type:3;
 
34
  unsigned start:21;
 
35
  unsigned len:9;
 
36
  unsigned bidi_type:5;
 
37
  unsigned comb_type:8;
 
38
  unsigned bidi_mirror:1;
 
39
  unsigned join_type:3;
40
40
} __attribute__ ((packed));
41
41
 
42
42
/* Old-style Arabic shaping. Used for "visual UTF-8" and
167
167
 
168
168
enum
169
169
  {
 
170
    GRUB_UNICODE_DOTLESS_LOWERCASE_I       = 0x0131,
 
171
    GRUB_UNICODE_DOTLESS_LOWERCASE_J       = 0x0237,
170
172
    GRUB_UNICODE_COMBINING_GRAPHEME_JOINER = 0x034f,
171
173
    GRUB_UNICODE_HEBREW_WAW                = 0x05d5,
172
174
    GRUB_UNICODE_ARABIC_START              = 0x0600,
206
208
    GRUB_UNICODE_BLACK_LEFT_TRIANGLE       = 0x25c4,
207
209
    GRUB_UNICODE_VARIATION_SELECTOR_1      = 0xfe00,
208
210
    GRUB_UNICODE_VARIATION_SELECTOR_16     = 0xfe0f,
 
211
    GRUB_UNICODE_TAG_START                 = 0xe0000,
 
212
    GRUB_UNICODE_TAG_END                   = 0xe007f,
209
213
    GRUB_UNICODE_VARIATION_SELECTOR_17     = 0xe0100,
210
 
    GRUB_UNICODE_VARIATION_SELECTOR_256    = 0xe01ef
 
214
    GRUB_UNICODE_VARIATION_SELECTOR_256    = 0xe01ef,
 
215
    GRUB_UNICODE_LAST_VALID                = 0x10ffff
211
216
  };
212
217
 
213
218
extern struct grub_unicode_compact_range grub_unicode_compact[];
240
245
  grub_memcpy (out, in, sizeof (*in));
241
246
  if (in->combining)
242
247
    {
243
 
      out->combining = grub_malloc (in->ncomb * sizeof (*in));
 
248
      out->combining = grub_malloc (in->ncomb * sizeof (out->combining[0]));
244
249
      if (!out->combining)
245
250
        {
246
251
          grub_free (out);
247
252
          return NULL;
248
253
        }
249
 
      grub_memcpy (out->combining, in->combining, in->ncomb * sizeof (*in));
 
254
      grub_memcpy (out->combining, in->combining,
 
255
                   in->ncomb * sizeof (out->combining[0]));
250
256
    }
251
257
  return out;
252
258
}