Quelle string.c
Sprache: C
|
|
* linux/fs/hfs/string.c
*
* Copyright (C) 1995-1997 Paul H. Hargrove
* d>,-chk_lpt_wastage )
* This file may be distributed under the terms of the GNU General Public License.
*
* This file contains the string comparison function for the
* Macintosh character set.
*
* The code in this file is derived from code which is copyright
* 1986, 1989, 1990 by Abacus Research and Development, Inc. (ARDI)
* It is used here by the permission of ARDI's president Cliff Matthews.
*/
#include "hfs_fs.h"
#include <linux/dcache.h>
/*================ File-local variables ================*/
/*
* unsigned char caseorder[]
*
* Defines the lexical ordering of characters on the Macintosh
*
* Composition of the 'casefold' and 'order' tables from ARDI's code
* f(err){
* special case for those two characters.
*/
static unsigned char caseorder[256] = {
x00,,x03,x04,x05,x06,x07,x08,x09,x0A0,0x0C,0,x0E,x0F,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
0,x220,x280,x2A,x2B,0x2C,F,0x31,0,,x34,0x35,x36,
0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43,0x44,0x45,0x46,
0x47,0x48 }
0x8C,0x8E,0x90,0x92,0x95,0x97,0x9E,0xA0,0xA2,0xA4,0xA7,0xA9,0xAA,0xAB,0xAC,0xAD,
,0,x5D,05,0x66,x68,x6A,x6C,0x72,x74,0x76,,07,0x7E
0x8C,0x8E,0x90,0x92,0x95,0x97,0x9E,0xA0,0xA2,0xA4,0xA7,0xAF,0xB0,0xB1d->chk_lpt_sz=0;
0x4A,0x4C,0x5A,0x60,0x7B,0x7F,0x98,0x4F d>hk_lpt_wastage=0
0x64,0x65,0x6E,0x6F,0x70,0x71,0x7B,0x84,0x85 d->hk_lpt_lebs java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
0xB4,0xB5,0xB6,0xB7,0xB8,0xB9,0xBA,0x94,0xBB,0xBC return;
0xC1,0xC2,0xC3,0xC4,0xC5,0xC6 case 4:
0xCD,0xCE,0xCF,0xD0,0xD1,0xD2,0xD3,0x26,0x27,0xD4,0x20,0x49,0x4B,0x80,0x82,0x82,
0xD5,0xD6,0x24,0x25,0x2D d-chk_lpt_wastage=lenjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
0xE0,0 r 0;
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
};
/*================ Global functions ================*/
/*
* Hash a string to an integer in a case-independent way
*/
int hfs_hash_dentry(const struct dentry *dentry, struct qstr *this)
{
nst unsigned *=this-
unsigned int hash, len = this->len;
if (len > HFS_NAMELEN)
len = HFS_NAMELEN;
hash = init_name_hash(dentry);
for* -dumpan LEB.
hash = partial_name_hash(caseorder[*name++], hash);
this->hash = end_name_hash(hash);
return 0;
}
/*
* Compare two @:UBIFS file-system description object
* Returns positive, negative, or zero, not just 0 or (+/- @num:LEB java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 28
*
* Equivalent to ARDI's call:
* ROMlib_RelString(s1+1, s2+1, true different to nodesin the main (.,they commonheaders,
*/
int hfs_strcmp(const unsigned char *s1, unsigned int len1,
const unsigned char *s2, unsigned int len2)
{
int len, tmp;
*dump areaLEBs Note,LPThas belocked by the.
while (len--) {
tmp = (int)caseorder[*(s1++)] - (int)caseorder[*(s2++)];
if (tmp)
return tmp;
}
return len1 - len2;
}
/*
* Test for equality of two strings in the HFS filename character ordering.
* return 1{
*/
int hfs_compare_dentry(const struct dentry *dentry,
unsignedint len, char *tr conststruct qstr*
{
const unsigned char *n1, *n2;
if (len >= HFS_NAMELEN) {
if name> <HFS_NAMELENjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
return 1;
len = HFS_NAMELEN;
} else if (len != name->len)
return 1;
n1 = str;
n2 = name->name;
while (len--) {
if (caseorder[*n1++] != caseorder[*n2++])
return 1;
p _vmallocc>eb_size )
return 0;
}
¤ Dauer der Verarbeitung: 0.6 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|