~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/unicodeOperations.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
97
97
 
98
98
Unicode Unicode_Format(const char *fmt, ...);
99
99
 
 
100
UnicodeIndex Unicode_LengthInCodePoints(ConstUnicode str);
100
101
 
101
102
/*
102
103
 * Simple in-line functions that may be used below.
108
109
 *
109
110
 * Unicode_IsIndexAtCodePointBoundary --
110
111
 *
111
 
 *      Check a string index for code point boundary.
 
112
 *      Check a string index (in bytes) for code point boundary.
112
113
 *
113
114
 *      The index must be valid (>= 0 and <= string length).
114
115
 *      The end of the string is considered a valid boundary.
123
124
 */
124
125
 
125
126
static INLINE Bool
126
 
Unicode_IsIndexAtCodePointBoundary(ConstUnicode str,    // IN
127
 
                                   UnicodeIndex index)  // IN
 
127
Unicode_IsIndexAtCodePointBoundary(ConstUnicode str,    // IN:
 
128
                                   UnicodeIndex index)  // IN:
128
129
{
129
130
   ASSERT(index >= 0 && index <= Unicode_LengthInCodeUnits(str));
130
131
 
189
190
 */
190
191
 
191
192
static INLINE Unicode
192
 
Unicode_AppendRange(ConstUnicode destination,  // IN
193
 
                    ConstUnicode source,       // IN
194
 
                    UnicodeIndex sourceStart,  // IN
195
 
                    UnicodeIndex sourceLength) // IN
 
193
Unicode_AppendRange(ConstUnicode dest,       // IN:
 
194
                    ConstUnicode src,        // IN:
 
195
                    UnicodeIndex srcStart,   // IN:
 
196
                    UnicodeIndex srcLength)  // IN:
196
197
{
197
 
   return Unicode_ReplaceRange(destination,
198
 
                               Unicode_LengthInCodeUnits(destination),
 
198
   return Unicode_ReplaceRange(dest,
 
199
                               Unicode_LengthInCodePoints(dest),
199
200
                               0,
200
 
                               source,
201
 
                               sourceStart,
202
 
                               sourceLength);
 
201
                               src,
 
202
                               srcStart,
 
203
                               srcLength);
203
204
}
204
205
 
205
206
 
292
293
 */
293
294
 
294
295
static INLINE Bool
295
 
UnicodeEndsWith(ConstUnicode str,    // IN
296
 
                ConstUnicode suffix, // IN
297
 
                Bool ignoreCase)     // IN
 
296
UnicodeEndsWith(ConstUnicode str,     // IN:
 
297
                ConstUnicode suffix,  // IN:
 
298
                Bool ignoreCase)      // IN:
298
299
{
299
 
   UnicodeIndex strLength = Unicode_LengthInCodeUnits(str);
300
 
   UnicodeIndex suffixLength = Unicode_LengthInCodeUnits(suffix);
 
300
   UnicodeIndex strLength = Unicode_LengthInCodePoints(str);
 
301
   UnicodeIndex suffixLength = Unicode_LengthInCodePoints(suffix);
301
302
   UnicodeIndex offset = strLength - suffixLength;
302
303
 
303
304
   if (suffixLength > strLength) {
304
305
      return FALSE;
305
306
   }
306
 
   if (!Unicode_IsIndexAtCodePointBoundary(str, offset)) {
307
 
      return FALSE;
308
 
   }
309
307
 
310
308
   return Unicode_CompareRange(str,
311
309
                               offset,
710
708
 */
711
709
 
712
710
static INLINE Bool
713
 
UnicodeStartsWith(ConstUnicode str,    // IN
714
 
                  ConstUnicode prefix, // IN
715
 
                  Bool ignoreCase)     // IN
 
711
UnicodeStartsWith(ConstUnicode str,     // IN:
 
712
                  ConstUnicode prefix,  // IN:
 
713
                  Bool ignoreCase)      // IN:
716
714
{
717
 
   UnicodeIndex strLength = Unicode_LengthInCodeUnits(str);
718
 
   UnicodeIndex prefixLength = Unicode_LengthInCodeUnits(prefix);
 
715
   UnicodeIndex strLength = Unicode_LengthInCodePoints(str);
 
716
   UnicodeIndex prefixLength = Unicode_LengthInCodePoints(prefix);
719
717
 
720
718
   if (prefixLength > strLength) {
721
719
      return FALSE;
722
720
   }
723
 
   if (!Unicode_IsIndexAtCodePointBoundary(str, prefixLength)) {
724
 
      return FALSE;
725
 
   }
726
721
 
727
722
   return Unicode_CompareRange(str,
728
723
                               0,