17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 55b024a5bSbatschul * Common Development and Distribution License (the "License"). 65b024a5bSbatschul * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*e8f766d8Sbatschul * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 235b024a5bSbatschul * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _SYS_FS_PC_DIR_H 277c478bd9Sstevel@tonic-gate #define _SYS_FS_PC_DIR_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #include <sys/dirent.h> 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #ifdef __cplusplus 347c478bd9Sstevel@tonic-gate extern "C" { 357c478bd9Sstevel@tonic-gate #endif 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate #define PCFNAMESIZE 8 387c478bd9Sstevel@tonic-gate #define PCFEXTSIZE 3 397c478bd9Sstevel@tonic-gate #define PCMAXNAMLEN 255 404a37d755Sksn #define PCMAXNAM_UTF16 (256 * sizeof (uint16_t)) /* for UTF-16 */ 417c478bd9Sstevel@tonic-gate #define PCLFNCHUNKSIZE 13 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate struct pctime { 447c478bd9Sstevel@tonic-gate ushort_t pct_time; /* hh:mm:ss (little endian) */ 457c478bd9Sstevel@tonic-gate ushort_t pct_date; /* yy:mm:dd (little endian) */ 467c478bd9Sstevel@tonic-gate }; 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate /* 497c478bd9Sstevel@tonic-gate * Shifts and masks for time and date fields, in host byte order. 507c478bd9Sstevel@tonic-gate */ 517c478bd9Sstevel@tonic-gate #define SECSHIFT 0 527c478bd9Sstevel@tonic-gate #define SECMASK 0x1F 537c478bd9Sstevel@tonic-gate #define MINSHIFT 5 547c478bd9Sstevel@tonic-gate #define MINMASK 0x3F 557c478bd9Sstevel@tonic-gate #define HOURSHIFT 11 567c478bd9Sstevel@tonic-gate #define HOURMASK 0x1F 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate #define DAYSHIFT 0 597c478bd9Sstevel@tonic-gate #define DAYMASK 0x1F 607c478bd9Sstevel@tonic-gate #define MONSHIFT 5 617c478bd9Sstevel@tonic-gate #define MONMASK 0x0F 627c478bd9Sstevel@tonic-gate #define YEARSHIFT 9 637c478bd9Sstevel@tonic-gate #define YEARMASK 0x7F 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate struct pcdir { 667c478bd9Sstevel@tonic-gate char pcd_filename[PCFNAMESIZE]; /* file name */ 677c478bd9Sstevel@tonic-gate char pcd_ext[PCFEXTSIZE]; /* file extension */ 687c478bd9Sstevel@tonic-gate uchar_t pcd_attr; /* file attributes */ 697c478bd9Sstevel@tonic-gate uchar_t pcd_ntattr; /* reserved for NT attributes */ 707c478bd9Sstevel@tonic-gate uchar_t pcd_crtime_msec; /* milliseconds after the minute */ 717c478bd9Sstevel@tonic-gate struct pctime pcd_crtime; /* creation time/date */ 727c478bd9Sstevel@tonic-gate ushort_t pcd_ladate; /* last-access date */ 737c478bd9Sstevel@tonic-gate union { 747c478bd9Sstevel@tonic-gate uint16_t pcd_eattr; /* OS/2 extended attribute */ 757c478bd9Sstevel@tonic-gate pc_cluster16_t pcd_scluster_hi; 767c478bd9Sstevel@tonic-gate } un; 777c478bd9Sstevel@tonic-gate struct pctime pcd_mtime; /* last modified time/date */ 787c478bd9Sstevel@tonic-gate pc_cluster16_t pcd_scluster_lo; /* starting cluster (little endian) */ 797c478bd9Sstevel@tonic-gate uint_t pcd_size; /* file size (little endian) */ 807c478bd9Sstevel@tonic-gate }; 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate #ifdef __cplusplus 837c478bd9Sstevel@tonic-gate } 847c478bd9Sstevel@tonic-gate #endif 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate #include <sys/fs/pc_node.h> 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate #ifdef __cplusplus 897c478bd9Sstevel@tonic-gate extern "C" { 907c478bd9Sstevel@tonic-gate #endif 917c478bd9Sstevel@tonic-gate 927c478bd9Sstevel@tonic-gate /* 937c478bd9Sstevel@tonic-gate * Long filename support (introduced by Windows 95) is an interesting 947c478bd9Sstevel@tonic-gate * exercise in compatibility. Basically, it is now no longer the case 957c478bd9Sstevel@tonic-gate * that an entry in a directory (as described by the 'pcdir' structure above) 967c478bd9Sstevel@tonic-gate * contains the entire name of a file. Now, a directory entry can consist of 977c478bd9Sstevel@tonic-gate * a long filename component (a series of 'pcdir'-like structures) followed 987c478bd9Sstevel@tonic-gate * by a short filename (the old form). Each long filename component is 997c478bd9Sstevel@tonic-gate * identified by having it's Read-Only, Hidden, System, and Volume Label 1007c478bd9Sstevel@tonic-gate * attributes set. Each can store 13 Unicode characters (16-bits, of 1017c478bd9Sstevel@tonic-gate * which we only look at the lower 8 for now), broken into (gak) three 1027c478bd9Sstevel@tonic-gate * sections of the entry (since that's the way the available bits fall out). 1037c478bd9Sstevel@tonic-gate * In addition, each long filename entry has a sequence number (starting 1047c478bd9Sstevel@tonic-gate * from 1). The first entry has bit 7 (0x40) set in the sequence number, and 1057c478bd9Sstevel@tonic-gate * has the maximum value in the sequence. This may seem a bit backwards, and 1067c478bd9Sstevel@tonic-gate * it gets worse: the first entry stores the last component of 1077c478bd9Sstevel@tonic-gate * the name. So the directory entry for a file named 1087c478bd9Sstevel@tonic-gate * "This is a very long filename indeed" might look like this: 1097c478bd9Sstevel@tonic-gate * 1107c478bd9Sstevel@tonic-gate * Offset Sequence Component Attributes Cluster Size 1117c478bd9Sstevel@tonic-gate * 0 0x43 "me indeed" RSHV 0 0 1127c478bd9Sstevel@tonic-gate * 32 0x02 "y long filena" RSHV 0 0 1137c478bd9Sstevel@tonic-gate * 64 0x01 "This is a ver" RSHV 0 0 1147c478bd9Sstevel@tonic-gate * 96 ---- "THISIS~1.TXT" <whatever> 2122 110 1157c478bd9Sstevel@tonic-gate * 1167c478bd9Sstevel@tonic-gate * The last entry is for the short filename, which stores actual information 1177c478bd9Sstevel@tonic-gate * about the file (like type, permissions, cluster, and size). The short name 1187c478bd9Sstevel@tonic-gate * is also used by non-long-filename aware applications (like Windows 3.X and 1197c478bd9Sstevel@tonic-gate * DOS). This name is generated by Windows 95 (and now Solaris) from the 1207c478bd9Sstevel@tonic-gate * long name, and must (of course) be unique within the directory. 1217c478bd9Sstevel@tonic-gate * Solaris continues to this entry to actually identify the file and its 1227c478bd9Sstevel@tonic-gate * attributes (filenames only really matter when names are used, like at 1237c478bd9Sstevel@tonic-gate * lookup/readdir/remove/create/rename time - for general access to the file 1247c478bd9Sstevel@tonic-gate * they aren't used). 1257c478bd9Sstevel@tonic-gate * 1267c478bd9Sstevel@tonic-gate * Long filenames can also be broken by applications that don't 1277c478bd9Sstevel@tonic-gate * understand them (for example, a Solaris 2.5.1 user could rename 1287c478bd9Sstevel@tonic-gate * "THISIS~1.TXT" to "test.exe"). This can be detected because each long 1297c478bd9Sstevel@tonic-gate * filename component has a checksum which is based on the short filename. 1307c478bd9Sstevel@tonic-gate * After reading the long filename entry, if the checksum doesn't match the 1317c478bd9Sstevel@tonic-gate * short name that follows, we simply ignore it and use the short name. 1327c478bd9Sstevel@tonic-gate * 1337c478bd9Sstevel@tonic-gate * One subtle thing - though long file names are case-sensitive, 1347c478bd9Sstevel@tonic-gate * searches for them are not. 1357c478bd9Sstevel@tonic-gate * 1367c478bd9Sstevel@tonic-gate * Another _very_ subtle thing. The number of characters in the 1377c478bd9Sstevel@tonic-gate * last long filename chunk (the first entry, with the 0x40 bit set) is 1387c478bd9Sstevel@tonic-gate * either all the characters (if there is no null, '\0'), or all the 1397c478bd9Sstevel@tonic-gate * characters up to the null. _However_, if the remaining characters are 1407c478bd9Sstevel@tonic-gate * null, Norton Disk Doctor and Microsoft ScanDisk will claim 1417c478bd9Sstevel@tonic-gate * that the filename entry is damaged. The remaining bytes must actually 1427c478bd9Sstevel@tonic-gate * contain 0xff (discovered with Disk Doctor). 1437c478bd9Sstevel@tonic-gate * 1447c478bd9Sstevel@tonic-gate * Some information about long filename support can be found in the 1457c478bd9Sstevel@tonic-gate * book "Inside Windows 95" by Adrian King. 1467c478bd9Sstevel@tonic-gate */ 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gate /* 1497c478bd9Sstevel@tonic-gate * The number of bytes in each section of the name in a long filename 1507c478bd9Sstevel@tonic-gate * entry. This is _bytes_, not characters: each character is actually 1517c478bd9Sstevel@tonic-gate * 16 bits. 1527c478bd9Sstevel@tonic-gate */ 1537c478bd9Sstevel@tonic-gate #define PCLF_FIRSTNAMESIZE 10 1547c478bd9Sstevel@tonic-gate #define PCLF_SECONDNAMESIZE 12 1557c478bd9Sstevel@tonic-gate #define PCLF_THIRDNAMESIZE 4 1567c478bd9Sstevel@tonic-gate 1577c478bd9Sstevel@tonic-gate /* 1587c478bd9Sstevel@tonic-gate * A long filename entry. It must match the 'pcdir' structure in size, 1597c478bd9Sstevel@tonic-gate * and pcdl_attr must overlap pcd_attr. 1607c478bd9Sstevel@tonic-gate */ 1617c478bd9Sstevel@tonic-gate struct pcdir_lfn { 1627c478bd9Sstevel@tonic-gate uchar_t pcdl_ordinal; /* lfn order. First is 01, next 02, */ 1637c478bd9Sstevel@tonic-gate /* last has bit 7 (0x40) set */ 1647c478bd9Sstevel@tonic-gate uchar_t pcdl_firstfilename[PCLF_FIRSTNAMESIZE]; 1657c478bd9Sstevel@tonic-gate uchar_t pcdl_attr; 1667c478bd9Sstevel@tonic-gate uchar_t pcdl_type; /* type - always contains 0 for an LFN entry */ 1677c478bd9Sstevel@tonic-gate uchar_t pcdl_checksum; /* checksum to validate the LFN entry - */ 1687c478bd9Sstevel@tonic-gate /* based on the short name */ 1697c478bd9Sstevel@tonic-gate uchar_t pcdl_secondfilename[PCLF_SECONDNAMESIZE]; 1707c478bd9Sstevel@tonic-gate pc_cluster16_t pcd_scluster; /* (not used, always 0) */ 1717c478bd9Sstevel@tonic-gate uchar_t pcdl_thirdfilename[PCLF_THIRDNAMESIZE]; 1727c478bd9Sstevel@tonic-gate }; 1737c478bd9Sstevel@tonic-gate 174f127cb91Sfrankho /* 175f127cb91Sfrankho * FAT LFN entries are consecutively numbered downwards, and the last 176f127cb91Sfrankho * entry of a LFN chain will have the 0x40 'termination' marker logically 177f127cb91Sfrankho * or'ed in. The entry immediately preceeding the short name has number 1, 178f127cb91Sfrankho * consecutively increasing. Since the filename length limit on FAT is 179f127cb91Sfrankho * 255 unicode characters and every LFN entry contributes 13 characters, 180f127cb91Sfrankho * the maximum sequence number is 255/13 + 1 == 20. 181f127cb91Sfrankho */ 1827c478bd9Sstevel@tonic-gate #define PCDL_IS_LAST_LFN(x) ((x->pcdl_ordinal) & 0x40) 1837c478bd9Sstevel@tonic-gate #define PCDL_LFN_BITS (PCA_RDONLY | PCA_HIDDEN | PCA_SYSTEM | PCA_LABEL) 184f127cb91Sfrankho #define PCDL_LFN_MASK (PCDL_LFN_BITS | PCA_DIR | PCA_ARCH) 185f127cb91Sfrankho #define PCDL_LFN_VALID_ORD(x) \ 186f127cb91Sfrankho (((((struct pcdir_lfn *)(x))->pcdl_ordinal & ~0x40) > 0) && \ 187f127cb91Sfrankho ((((struct pcdir_lfn *)(x))->pcdl_ordinal & ~0x40) <= 20)) 188f127cb91Sfrankho #define PCDL_IS_LFN(x) \ 189f127cb91Sfrankho (enable_long_filenames && \ 190f127cb91Sfrankho (((x)->pcd_attr & PCDL_LFN_MASK) == PCDL_LFN_BITS) && \ 191f127cb91Sfrankho PCDL_LFN_VALID_ORD((x))) 1927c478bd9Sstevel@tonic-gate 1937c478bd9Sstevel@tonic-gate /* 1947c478bd9Sstevel@tonic-gate * The first char of the file name has special meaning as follows: 1957c478bd9Sstevel@tonic-gate */ 1967c478bd9Sstevel@tonic-gate #define PCD_UNUSED ((char)0x00) /* entry has never been used */ 1977c478bd9Sstevel@tonic-gate #define PCD_ERASED ((char)0xE5) /* entry was erased */ 1987c478bd9Sstevel@tonic-gate 1997c478bd9Sstevel@tonic-gate /* 2007c478bd9Sstevel@tonic-gate * File attributes. 2017c478bd9Sstevel@tonic-gate */ 2027c478bd9Sstevel@tonic-gate #define PCA_RDONLY 0x01 /* file is read only */ 2037c478bd9Sstevel@tonic-gate #define PCA_HIDDEN 0x02 /* file is hidden */ 2047c478bd9Sstevel@tonic-gate #define PCA_SYSTEM 0x04 /* system file */ 2057c478bd9Sstevel@tonic-gate #define PCA_LABEL 0x08 /* entry contains the volume label */ 2067c478bd9Sstevel@tonic-gate #define PCA_DIR 0x10 /* subdirectory */ 2077c478bd9Sstevel@tonic-gate #define PCA_ARCH 0x20 /* file has been modified since last backup */ 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate /* 2107c478bd9Sstevel@tonic-gate * Avoid hidden files unless the private variable is set. 2117c478bd9Sstevel@tonic-gate * Always avoid the label. 2127c478bd9Sstevel@tonic-gate */ 2137c478bd9Sstevel@tonic-gate #define PCA_IS_HIDDEN(fsp, attr) \ 2147c478bd9Sstevel@tonic-gate ((((attr) & PCA_LABEL) == PCA_LABEL) || \ 2157c478bd9Sstevel@tonic-gate ((((fsp)->pcfs_flags & PCFS_HIDDEN) == 0) && \ 2167c478bd9Sstevel@tonic-gate ((attr) & (PCA_HIDDEN | PCA_SYSTEM)))) 2177c478bd9Sstevel@tonic-gate 2187c478bd9Sstevel@tonic-gate #define PC_NAME_IS_DOT(namep) \ 2197c478bd9Sstevel@tonic-gate (((namep)[0] == '.') && ((namep)[1] == '\0')) 2207c478bd9Sstevel@tonic-gate #define PC_NAME_IS_DOTDOT(namep) \ 2217c478bd9Sstevel@tonic-gate (((namep)[0] == '.') && ((namep)[1] == '.') && ((namep)[2] == '\0')) 2227c478bd9Sstevel@tonic-gate #define PC_SHORTNAME_IS_DOT(namep) \ 2237c478bd9Sstevel@tonic-gate (((namep)[0] == '.') && ((namep)[1] == ' ')) 2247c478bd9Sstevel@tonic-gate #define PC_SHORTNAME_IS_DOTDOT(namep) \ 2257c478bd9Sstevel@tonic-gate (((namep)[0] == '.') && ((namep)[1] == '.') && ((namep)[2] == ' ')) 2267c478bd9Sstevel@tonic-gate /* 2277c478bd9Sstevel@tonic-gate * slot structure is used by the directory search routine to return 2287c478bd9Sstevel@tonic-gate * the results of the search. If the search is successful sl_blkno and 2297c478bd9Sstevel@tonic-gate * sl_offset reflect the disk address of the entry and sl_ep points to 2307c478bd9Sstevel@tonic-gate * the actual entry data in buffer sl_bp. sl_flags is set to whether the 2317c478bd9Sstevel@tonic-gate * entry is dot or dotdot. If the search is unsuccessful sl_blkno and 2327c478bd9Sstevel@tonic-gate * sl_offset points to an empty directory slot if there are any. Otherwise 2337c478bd9Sstevel@tonic-gate * it is set to -1. 2347c478bd9Sstevel@tonic-gate */ 2355b024a5bSbatschul struct pcslot { 2367c478bd9Sstevel@tonic-gate enum {SL_NONE, SL_FOUND, SL_EXTEND} sl_status; /* slot status */ 2377c478bd9Sstevel@tonic-gate daddr_t sl_blkno; /* disk block number which has entry */ 2387c478bd9Sstevel@tonic-gate int sl_offset; /* offset of entry within block */ 2397c478bd9Sstevel@tonic-gate struct buf *sl_bp; /* buffer containing entry data */ 2407c478bd9Sstevel@tonic-gate struct pcdir *sl_ep; /* pointer to entry data */ 2417c478bd9Sstevel@tonic-gate int sl_flags; /* flags (see below) */ 2427c478bd9Sstevel@tonic-gate }; 2437c478bd9Sstevel@tonic-gate #define SL_DOT 1 /* entry point to self */ 2447c478bd9Sstevel@tonic-gate #define SL_DOTDOT 2 /* entry points to parent */ 2457c478bd9Sstevel@tonic-gate 2467c478bd9Sstevel@tonic-gate /* 2477c478bd9Sstevel@tonic-gate * A pcfs directory entry. Directory entries are actually variable 2487c478bd9Sstevel@tonic-gate * length, but this is the maximum size. 2497c478bd9Sstevel@tonic-gate * 2507c478bd9Sstevel@tonic-gate * This _must_ match a dirent64 structure in format. 2514a37d755Sksn * d_name is 512 bytes long to accomodate 256 UTF-16 characters. 2527c478bd9Sstevel@tonic-gate */ 2537c478bd9Sstevel@tonic-gate struct pc_dirent { 2547c478bd9Sstevel@tonic-gate ino64_t d_ino; /* "inode number" of entry */ 2557c478bd9Sstevel@tonic-gate off64_t d_off; /* offset of disk directory entry */ 2567c478bd9Sstevel@tonic-gate unsigned short d_reclen; /* length of this record */ 2574a37d755Sksn char d_name[PCMAXNAM_UTF16]; 2587c478bd9Sstevel@tonic-gate }; 2597c478bd9Sstevel@tonic-gate 260264a6e74Sfrankho /* 261264a6e74Sfrankho * Check FAT 8.3 filename characters for validity. 262264a6e74Sfrankho * Lacking a kernel iconv, codepage support for short filenames 263264a6e74Sfrankho * is not provided. 264264a6e74Sfrankho * Short names must be uppercase ASCII (no support for MSDOS 265264a6e74Sfrankho * codepages right now, sorry) and may not contain any of 266264a6e74Sfrankho * *+=|\[];:",<>.?/ which are explicitly forbidden by the 267264a6e74Sfrankho * FAT specifications. 268264a6e74Sfrankho */ 2699bd42341Sfrankho #define pc_invalchar(c) \ 2709bd42341Sfrankho (((c) >= 'a' && (c) <= 'z') || \ 2719bd42341Sfrankho (c) == '"' || (c) == '*' || (c) == '+' || (c) == ',' || \ 2729bd42341Sfrankho (c) == '.' || (c) == '/' || (c) == ':' || (c) == ';' || \ 2739bd42341Sfrankho (c) == '<' || (c) == '=' || (c) == '>' || (c) == '?' || \ 2749bd42341Sfrankho (c) == '[' || (c) == '|' || (c) == ']' || (c) == '\\') 2759bd42341Sfrankho 2769bd42341Sfrankho #define pc_validchar(c) (((c) >= ' ' && !((c) & ~0177)) && !pc_invalchar(c)) 277264a6e74Sfrankho 278264a6e74Sfrankho 2797c478bd9Sstevel@tonic-gate #ifdef _KERNEL 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate /* 282264a6e74Sfrankho * macros for converting ASCII to/from upper or lower case. 2837c478bd9Sstevel@tonic-gate * users may give and get names in lower case, but they are stored on the 284264a6e74Sfrankho * disk in upper case to be PCDOS compatible. 285264a6e74Sfrankho * These would better come from some shared source in <sys/...> but 286264a6e74Sfrankho * there is no such place yet. 2877c478bd9Sstevel@tonic-gate */ 2887c478bd9Sstevel@tonic-gate #define toupper(C) (((C) >= 'a' && (C) <= 'z') ? (C) - 'a' + 'A' : (C)) 2897c478bd9Sstevel@tonic-gate #define tolower(C) (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C)) 2907c478bd9Sstevel@tonic-gate 291264a6e74Sfrankho extern int pc_tvtopct(timestruc_t *, struct pctime *); /* timeval to pctime */ 292264a6e74Sfrankho extern void pc_pcttotv(struct pctime *, int64_t *); /* pctime to timeval */ 2937c478bd9Sstevel@tonic-gate extern int pc_valid_lfn_char(char); /* valid long filename ch */ 2947c478bd9Sstevel@tonic-gate 2957c478bd9Sstevel@tonic-gate extern int pc_read_long_fn(struct vnode *, struct uio *, 2967c478bd9Sstevel@tonic-gate struct pc_dirent *, struct pcdir **, offset_t *, struct buf **); 2977c478bd9Sstevel@tonic-gate extern int pc_read_short_fn(struct vnode *, struct uio *, 2987c478bd9Sstevel@tonic-gate struct pc_dirent *, struct pcdir **, offset_t *, struct buf **); 2997c478bd9Sstevel@tonic-gate extern int pc_match_long_fn(struct pcnode *, char *, struct pcdir **, 3005b024a5bSbatschul struct pcslot *, offset_t *); 3017c478bd9Sstevel@tonic-gate extern int pc_match_short_fn(struct pcnode *, char *, 3025b024a5bSbatschul struct pcdir **, struct pcslot *, offset_t *); 3037c478bd9Sstevel@tonic-gate extern uchar_t pc_checksum_long_fn(char *, char *); 3047c478bd9Sstevel@tonic-gate extern void set_long_fn_chunk(struct pcdir_lfn *, char *, int); 3054a37d755Sksn extern int pc_valid_long_fn(char *, int); 3067c478bd9Sstevel@tonic-gate extern int pc_extract_long_fn(struct pcnode *, char *, 3077c478bd9Sstevel@tonic-gate struct pcdir **, offset_t *offset, struct buf **); 3087c478bd9Sstevel@tonic-gate extern int pc_fname_ext_to_name(char *, char *, char *, int); 3097c478bd9Sstevel@tonic-gate 3107c478bd9Sstevel@tonic-gate extern pc_cluster32_t pc_getstartcluster(struct pcfs *, struct pcdir *); 3117c478bd9Sstevel@tonic-gate extern void pc_setstartcluster(struct pcfs *, struct pcdir *, pc_cluster32_t); 3127c478bd9Sstevel@tonic-gate 3137c478bd9Sstevel@tonic-gate /* 3147c478bd9Sstevel@tonic-gate * Private tunables 3157c478bd9Sstevel@tonic-gate */ 3167c478bd9Sstevel@tonic-gate 3177c478bd9Sstevel@tonic-gate /* 3187c478bd9Sstevel@tonic-gate * Use long filenames (Windows 95). Disabling this causes pcfs 3197c478bd9Sstevel@tonic-gate * to not recognize long filenames at all, which may cause it to 3207c478bd9Sstevel@tonic-gate * break associations between the short and long names. This is likely 3217c478bd9Sstevel@tonic-gate * to leave unused long filename entries in directories (which may make 3227c478bd9Sstevel@tonic-gate * apparently empty directories unremovable), and would require a fsck_pcfs 3237c478bd9Sstevel@tonic-gate * to find and fix (or a Windows utility like Norton Disk Doctor or 3247c478bd9Sstevel@tonic-gate * Microsoft ScanDisk). 3257c478bd9Sstevel@tonic-gate */ 3267c478bd9Sstevel@tonic-gate extern int enable_long_filenames; /* default: on */ 3277c478bd9Sstevel@tonic-gate 3287c478bd9Sstevel@tonic-gate #endif 3297c478bd9Sstevel@tonic-gate 3307c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3317c478bd9Sstevel@tonic-gate } 3327c478bd9Sstevel@tonic-gate #endif 3337c478bd9Sstevel@tonic-gate 3347c478bd9Sstevel@tonic-gate #endif /* _SYS_FS_PC_DIR_H */ 335