#define unhex(x) (isdigit(x) ? (x) - '0' : toupper(x) + 10 - 'A')
static void convert_passwd(char *buf, char *newpwd, const int keyfd)
{
- u_int8_t key[HEXPASSWDLEN];
+ uint8_t key[HEXPASSWDLEN];
Key_schedule schedule;
unsigned int i, j;
#include <netdb.h>
#include <inttypes.h>
#include <sys/types.h>
-
#include <sys/param.h>
-#include <sys/cdefs.h>
#include <atalk/fce_api.h>
#include <atalk/util.h>
static charset_t ch_mac;
char* mac_charset;
static int usedots = 0;
-static u_int16_t conv_flags = 0;
+static uint16_t conv_flags = 0;
static int dry_run = 0;
static int verbose=0;
char *cnid_type;
size_t outlen = 0;
unsigned char *p,*q;
int require_conversion = 0;
- u_int16_t flags = conv_flags;
+ uint16_t flags = conv_flags;
cnid_t id;
p = (unsigned char *)name;
#endif
struct ace_rights_map {
- u_int32_t from;
- u_int32_t to;
+ uint32_t from;
+ uint32_t to;
};
#ifdef HAVE_SOLARIS_ACLS
};
struct nfsv4_to_darwin_flags_map {
- u_int16_t from;
- u_int32_t to;
+ uint16_t from;
+ uint32_t to;
};
struct nfsv4_to_darwin_flags_map nfsv4_to_darwin_flags[] = {
};
struct darwin_to_nfsv4_flags_map {
- u_int32_t from;
- u_int16_t to;
+ uint32_t from;
+ uint16_t to;
};
struct darwin_to_nfsv4_flags_map darwin_to_nfsv4_flags[] = {
EC_INIT;
int mapped_aces = 0;
int dirflag;
- uint32_t *darwin_ace_count = (u_int32_t *)rbuf;
+ uint32_t *darwin_ace_count = (uint32_t *)rbuf;
#ifdef HAVE_SOLARIS_ACLS
int ace_count = 0;
ace_t *aces = NULL;
{
DSI *dsi = (DSI *) obj->handle;
int rc_idx;
- u_int32_t err, cmd;
- u_int8_t function;
+ uint32_t err, cmd;
+ uint8_t function;
struct sigaction action;
AFPobj = obj;
int afs_getvolspace( vol, bfree, btotal, bsize )
struct vol *vol;
VolSpace *bfree, *btotal;
-u_int32_t *bsize;
+uint32_t *bsize;
{
struct ViceIoctl vi;
struct VolumeStatus *vs;
struct vol *vol;
struct dir *dir;
struct path *path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
ibuf += 2;
memcpy( &vid, ibuf, sizeof( vid ));
struct dir *dir;
char *iend;
struct path *path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
iend = ibuf + ibuflen;
char realm[ MAXKTCREALMLEN ];
char oldpw[ 9 ], newpw[ 9 ];
int len, rc;
- u_int16_t clen;
+ uint16_t clen;
struct ktc_encryptionKey oldkey, newkey;
struct ktc_token adtok;
struct ubik_client *conn;
{
int cc;
char *p;
- u_int16_t len;
- u_char appltag[ 4 ];
+ uint16_t len;
+ unsigned char appltag[ 4 ];
char buf[ MAXPATHLEN ];
while (( cc = read( sfd, buf, sizeof(appltag) + sizeof( u_short ))) > 0 ) {
struct vol *vol;
struct dir *dir;
int tfd, cc;
- u_int32_t did;
- u_int16_t vid, mplen;
+ uint32_t did;
+ uint16_t vid, mplen;
struct path *path;
char *dtf, *p, *mp;
- u_char creator[ 4 ];
- u_char appltag[ 4 ];
+ unsigned char creator[ 4 ];
+ unsigned char appltag[ 4 ];
char *mpath, *tempfile;
*rbuflen = 0;
struct vol *vol;
struct dir *dir;
int tfd, cc;
- u_int32_t did;
- u_int16_t vid, mplen;
+ uint32_t did;
+ uint16_t vid, mplen;
struct path *path;
char *dtf, *mp;
- u_char creator[ 4 ];
+ unsigned char creator[ 4 ];
char *tempfile, *mpath;
*rbuflen = 0;
char *p, *q;
int cc;
size_t buflen;
- u_int16_t vid, aindex, bitmap, len;
- u_char creator[ 4 ];
- u_char appltag[ 4 ];
+ uint16_t vid, aindex, bitmap, len;
+ unsigned char creator[ 4 ];
+ unsigned char appltag[ 4 ];
char *buf, *cbuf;
struct path *path;
void status_versions( char *data, const DSI *dsi)
{
char *start = data;
- u_int16_t status;
+ uint16_t status;
int len, num, i, count = 0;
memcpy(&status, start + AFPSTATUS_VERSOFF, sizeof(status));
void status_uams(char *data, const char *authlist)
{
char *start = data;
- u_int16_t status;
+ uint16_t status;
struct uam_obj *uams;
int len, num = 0;
char *ibuf, size_t ibuflen,
char *rbuf, size_t *rbuflen)
{
- u_int16_t type;
- u_int32_t idlen = 0;
- u_int32_t boottime;
- u_int32_t tklen, tp;
+ uint16_t type;
+ uint32_t idlen = 0;
+ uint32_t boottime;
+ uint32_t tklen, tp;
char *token;
char *p;
int afp_disconnect(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
DSI *dsi = (DSI *)obj->handle;
- u_int16_t type;
- u_int32_t tklen;
+ uint16_t type;
+ uint32_t tklen;
pid_t token;
int i;
size_t len;
int i;
char type;
- u_int16_t len16;
+ uint16_t len16;
char *username;
*rbuflen = 0;
/* FPGetUserInfo */
int afp_getuserinfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
- u_int8_t thisuser;
- u_int32_t id;
- u_int16_t bitmap;
+ uint8_t thisuser;
+ uint32_t id;
+ uint16_t bitmap;
char *bitmapp;
LOG(log_debug, logtype_afpd, "begin afp_getuserinfo:");
struct finderinfo {
- u_int32_t f_type;
- u_int32_t creator;
- u_int16_t attrs; /* File attributes (high 8 bits)*/
- u_int16_t label; /* Label (low 8 bits )*/
+ uint32_t f_type;
+ uint32_t creator;
+ uint16_t attrs; /* File attributes (high 8 bits)*/
+ uint16_t label; /* Label (low 8 bits )*/
char reserved[22]; /* Unknown (at least for now...) */
};
/* This is our search-criteria structure. */
struct scrit {
- u_int32_t rbitmap; /* Request bitmap - which values should we check ? */
- u_int16_t fbitmap, dbitmap; /* file & directory bitmap - which values should we return ? */
- u_int16_t attr; /* File attributes */
+ uint32_t rbitmap; /* Request bitmap - which values should we check ? */
+ uint16_t fbitmap, dbitmap; /* file & directory bitmap - which values should we return ? */
+ uint16_t attr; /* File attributes */
time_t cdate; /* Creation date */
time_t mdate; /* Last modification date */
time_t bdate; /* Last backup date */
- u_int32_t pdid; /* Parent DID */
- u_int16_t offcnt; /* Offspring count */
+ uint32_t pdid; /* Parent DID */
+ uint16_t offcnt; /* Offspring count */
struct finderinfo finfo; /* Finder info */
char lname[64]; /* Long name */
char utf8name[514]; /* UTF8 or UCS2 name */ /* for convert_charset dest_len parameter +2 */
*/
static int crit_check(struct vol *vol, struct path *path) {
int result = 0;
- u_int16_t attr, flags = CONV_PRECOMPOSE;
+ uint16_t attr, flags = CONV_PRECOMPOSE;
struct finderinfo *finfo = NULL, finderinfo;
struct adouble *adp = NULL;
time_t c_date, b_date;
- u_int32_t ac_date, ab_date;
+ uint32_t ac_date, ab_date;
static char convbuf[514]; /* for convert_charset dest_len parameter +2 */
size_t len;
int islnk;
char *p = *buf;
int ret;
size_t tbuf =0;
- u_int16_t resultsize;
+ uint16_t resultsize;
int isdir = S_ISDIR(path->st.st_mode);
/* Skip resultsize */
int *rsize,
int ext)
{
- static u_int32_t cur_pos; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */
+ static uint32_t cur_pos; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */
static DIR *dirpos; /* UNIX structure describing currently opened directory. */
struct dir *curdir; /* struct dir of current directory */
int cidx, r;
char *rbuf, size_t *rbuflen, int ext)
{
struct vol *vol;
- u_int16_t vid;
- u_int16_t spec_len;
- u_int32_t rmatches, reserved;
- u_int32_t catpos[4];
- u_int32_t pdid = 0;
+ uint16_t vid;
+ uint16_t spec_len;
+ uint32_t rmatches, reserved;
+ uint32_t catpos[4];
+ uint32_t pdid = 0;
int ret, rsize;
- u_int32_t nrecs = 0;
+ uint32_t nrecs = 0;
unsigned char *spec1, *spec2, *bspec1, *bspec2;
size_t len;
- u_int16_t namelen;
- u_int16_t flags;
+ uint16_t namelen;
+ uint16_t flags;
char tmppath[256];
char *uname;
int afp_opendt(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
struct vol *vol;
- u_int16_t vid;
+ uint16_t vid;
ibuf += 2;
u_char fcreator[ 4 ], imh[ 12 ], irh[ 12 ], *p;
int itype, cc = AFP_OK, iovcnt = 0;
size_t buflen;
- u_int32_t ftype, itag;
- u_int16_t bsize, rsize, vid;
+ uint32_t ftype, itag;
+ uint16_t bsize, rsize, vid;
buflen = *rbuflen;
*rbuflen = 0;
int afp_geticoninfo(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
struct vol *vol;
- u_char fcreator[ 4 ], ih[ 12 ];
- u_int16_t vid, iindex, bsize;
+ unsigned char fcreator[ 4 ], ih[ 12 ];
+ uint16_t vid, iindex, bsize;
*rbuflen = 0;
ibuf += 2;
off_t offset;
ssize_t rc, buflen;
u_char fcreator[ 4 ], ftype[ 4 ], itype, ih[ 12 ];
- u_int16_t vid, bsize, rsize;
+ uint16_t vid, bsize, rsize;
buflen = *rbuflen;
*rbuflen = 0;
char *m, *u;
size_t inplen;
size_t outlen;
- u_int16_t flags;
+ uint16_t flags;
if ( *mpath == '\0' ) {
strcpy(upath, ".");
{
static char mpath[ MAXPATHLEN + 2]; /* for convert_charset dest_len parameter +2 */
char *m, *u;
- u_int16_t flags;
+ uint16_t flags;
size_t outlen;
m = mpath;
struct vol *vol;
struct dir *dir;
struct path *path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
struct vol *vol;
struct dir *dir;
struct path *s_path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
struct vol *vol;
struct dir *dir;
struct path *s_path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
DIR *dp;
struct dirent *de;
int ret;
- static u_int32_t did = 0;
+ static uint32_t did = 0;
static char cname[MAXPATHLEN];
static char lname[MAXPATHLEN];
ucs2_t u2_path[MAXPATHLEN];
struct dir *cdir;
char *data, *p;
int len;
- u_int32_t hint;
- u_int16_t len16;
+ uint32_t hint;
+ uint16_t len16;
int size = 0;
int toUTF8 = 0;
}
/* --------------------- */
-void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count)
+void setdiroffcnt(struct dir *dir, struct stat *st, uint32_t count)
{
dir->d_offcnt = count;
dir->d_ctime = st->st_ctime;
*/
int getdirparams(const struct vol *vol,
- u_int16_t bitmap, struct path *s_path,
+ uint16_t bitmap, struct path *s_path,
struct dir *dir,
char *buf, size_t *buflen )
{
struct adouble ad;
char *data, *l_nameoff = NULL, *utf_nameoff = NULL;
int bit = 0, isad = 0;
- u_int32_t aint;
- u_int16_t ashort;
+ uint32_t aint;
+ uint16_t ashort;
int ret;
- u_int32_t utf8 = 0;
+ uint32_t utf8 = 0;
cnid_t pdid;
struct stat *st = &s_path->st;
char *upath = s_path->u_name;
if (dir->d_m_name) /* root of parent can have a null name */
l_nameoff = data;
else
- memset(data, 0, sizeof(u_int16_t));
- data += sizeof( u_int16_t );
+ memset(data, 0, sizeof(uint16_t));
+ data += sizeof( uint16_t );
break;
case DIRPBIT_SNAME :
- memset(data, 0, sizeof(u_int16_t));
- data += sizeof( u_int16_t );
+ memset(data, 0, sizeof(uint16_t));
+ data += sizeof( uint16_t );
break;
case DIRPBIT_DID :
if (dir->d_m_name) /* root of parent can have a null name */
utf_nameoff = data;
else
- memset(data, 0, sizeof(u_int16_t));
- data += sizeof( u_int16_t );
+ memset(data, 0, sizeof(uint16_t));
+ data += sizeof( uint16_t );
aint = 0;
memcpy(data, &aint, sizeof( aint ));
data += sizeof( aint );
struct vol *vol;
struct dir *dir;
struct path *path;
- u_int16_t vid, bitmap;
- u_int32_t did;
+ uint16_t vid, bitmap;
+ uint32_t did;
int rc;
*rbuflen = 0;
*
* assume path == '\0' eg. it's a directory in canonical form
*/
-int setdirparams(struct vol *vol, struct path *path, u_int16_t d_bitmap, char *buf )
+int setdirparams(struct vol *vol, struct path *path, uint16_t d_bitmap, char *buf )
{
struct maccess ma;
struct adouble ad;
int bit, isad = 1;
int cdate, bdate;
int owner, group;
- u_int16_t ashort, bshort, oshort;
+ uint16_t ashort, bshort, oshort;
int err = AFP_OK;
int change_mdate = 0;
int change_parent_mdate = 0;
int newdate = 0;
- u_int16_t bitmap = d_bitmap;
+ uint16_t bitmap = d_bitmap;
u_char finder_buf[32];
- u_int32_t upriv;
+ uint32_t upriv;
mode_t mpriv = 0;
- u_int16_t upriv_bit = 0;
+ uint16_t upriv_bit = 0;
bit = 0;
upath = path->u_name;
case DIRPBIT_FINFO :
if (isad) {
/* Fixes #2802236 */
- u_int16_t *fflags = (u_int16_t *)(finder_buf + FINDERINFO_FRFLAGOFF);
+ uint16_t *fflags = (uint16_t *)(finder_buf + FINDERINFO_FRFLAGOFF);
*fflags &= htons(~FINDERINFO_ISHARED);
/* #2802236 end */
if ( dir->d_did == DIRDID_ROOT ) {
int dfd;
struct vol *vol;
struct dir *dir;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
struct dir *dir;
char *upath;
struct path *s_path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
int err;
*rbuflen = 0;
ad_close_metadata( &ad);
createdir_done:
- memcpy( rbuf, &dir->d_did, sizeof( u_int32_t ));
- *rbuflen = sizeof( u_int32_t );
+ memcpy( rbuf, &dir->d_did, sizeof( uint32_t ));
+ *rbuflen = sizeof( uint32_t );
setvoltime(obj, vol );
return( AFP_OK );
}
struct dir *fdir, *pdir;
DIR *dp;
struct adouble ad;
- u_int16_t ashort;
+ uint16_t ashort;
int err;
if ((pdir = dirlookup(vol, curdir->d_pdid)) == NULL) {
struct passwd *pw;
struct group *gr;
char *name;
- u_int32_t id;
+ uint32_t id;
int len, sfunc;
int utf8 = 0;
len = strlen( name );
if (utf8) {
- u_int16_t tp = htons(len);
+ uint16_t tp = htons(len);
memcpy(rbuf, &tp, sizeof(tp));
rbuf += sizeof(tp);
*rbuflen += 2;
struct passwd *pw;
struct group *gr;
int len, sfunc;
- u_int32_t id;
- u_int16_t ulen;
+ uint32_t id;
+ uint16_t ulen;
ibuf++;
sfunc = (unsigned char) *ibuf++;
#if 0
struct vol *vol;
struct dir *dir;
- u_int16_t vid;
- u_int32_t did;
+ uint16_t vid;
+ uint32_t did;
#endif /* 0 */
*rbuflen = 0;
struct vol *vol;
struct dir *parentdir;
struct path *path;
- u_int32_t did;
- u_int16_t vid;
+ uint32_t did;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
extern int deletecurdir (struct vol *);
extern mode_t mtoumode (struct maccess *);
extern void utommode (struct stat *, struct maccess *);
-extern int getdirparams (const struct vol *, u_int16_t, struct path *,
+extern int getdirparams (const struct vol *, uint16_t, struct path *,
struct dir *, char *, size_t *);
-extern int setdirparams(struct vol *, struct path *, u_int16_t, char *);
+extern int setdirparams(struct vol *, struct path *, uint16_t, char *);
extern int renamedir(const struct vol *, int, char *, char *, struct dir *,
struct dir *, char *);
extern int path_error(struct path *, int error);
-extern void setdiroffcnt(struct dir *dir, struct stat *st, u_int32_t count);
+extern void setdiroffcnt(struct dir *dir, struct stat *st, uint32_t count);
extern int dirreenumerate(struct dir *dir, struct stat *st);
extern int for_each_dirent(const struct vol *, char *, dir_loop , void *);
extern int check_access(char *name , int mode);
*/
struct savedir {
u_short sd_vid;
- u_int32_t sd_did;
+ uint32_t sd_did;
int sd_buflen;
char *sd_buf;
char *sd_last;
int did, ret, len, first = 1;
size_t esz;
char *data, *start;
- u_int16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0;
- u_int16_t temp16;
- u_int32_t sindex, maxsz, sz = 0;
+ uint16_t vid, fbitmap, dbitmap, reqcnt, actcnt = 0;
+ uint16_t temp16;
+ uint32_t sindex, maxsz, sz = 0;
struct path *o_path;
struct path s_path;
int header;
LOG(log_debug, logtype_afpd, "enumerate(\"%s/%s\", f/d:%04x/%04x, rc:%u, i:%u, max:%u)",
getcwdpath(), o_path->u_name, fbitmap, dbitmap, reqcnt, sindex, maxsz);
- data = rbuf + 3 * sizeof( u_int16_t );
- sz = 3 * sizeof( u_int16_t ); /* fbitmap, dbitmap, reqcount */
+ data = rbuf + 3 * sizeof( uint16_t );
+ sz = 3 * sizeof( uint16_t ); /* fbitmap, dbitmap, reqcount */
/*
* Read the directory into a pre-malloced buffer, stored
memcpy(data, ufinderi, ADEDLEN_FINDERI);
chk_ext = 1;
if (vol_inv_dots(vol) && *upath == '.') { /* make it invisible */
- u_int16_t ashort;
+ uint16_t ashort;
ashort = htons(FINDERINFO_INVISIBLE);
memcpy((char *)data + FINDERINFO_FRFLAGOFF, &ashort, sizeof(ashort));
}
if (islink){
- u_int16_t linkflag;
+ uint16_t linkflag;
memcpy(&linkflag, (char *)data + FINDERINFO_FRFLAGOFF, 2);
linkflag |= htons(FINDERINFO_ISALIAS);
memcpy((char *)data + FINDERINFO_FRFLAGOFF, &linkflag, 2);
/* ---------------------
*/
-char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, u_int32_t utf8)
+char *set_name(const struct vol *vol, char *data, cnid_t pid, char *name, cnid_t id, uint32_t utf8)
{
- u_int32_t aint;
+ uint32_t aint;
char *tp = NULL;
char *src = name;
aint = strlen( name );
*data++ = aint;
}
else {
- u_int16_t temp;
+ uint16_t temp;
if (aint > UTF8FILELEN_EARLY) /* FIXME safeguard, anyway if no ascii char it's game over*/
aint = UTF8FILELEN_EARLY;
const int len)
{
static int first = 1; /* mark if this func is called the first time */
- u_int32_t adcnid;
- u_int32_t dbcnid = CNID_INVALID;
+ uint32_t adcnid;
+ uint32_t dbcnid = CNID_INVALID;
restart:
if (vol->v_cdb != NULL) {
/* -------------------------- */
int getmetadata(struct vol *vol,
- u_int16_t bitmap,
+ uint16_t bitmap,
struct path *path, struct dir *dir,
char *buf, size_t *buflen, struct adouble *adp)
{
char *data, *l_nameoff = NULL, *upath;
char *utf_nameoff = NULL;
int bit = 0;
- u_int32_t aint;
+ uint32_t aint;
cnid_t id = 0;
- u_int16_t ashort;
+ uint16_t ashort;
u_char achar, fdType[4];
- u_int32_t utf8 = 0;
+ uint32_t utf8 = 0;
struct stat *st;
struct maccess ma;
break;
case FILPBIT_PDID :
- memcpy(data, &dir->d_did, sizeof( u_int32_t ));
- data += sizeof( u_int32_t );
+ memcpy(data, &dir->d_did, sizeof( uint32_t ));
+ data += sizeof( uint32_t );
LOG(log_debug, logtype_afpd, "metadata('%s'): Parent DID: %u",
path->u_name, ntohl(dir->d_did));
break;
case FILPBIT_LNAME :
l_nameoff = data;
- data += sizeof( u_int16_t );
+ data += sizeof( uint16_t );
break;
case FILPBIT_SNAME :
- memset(data, 0, sizeof(u_int16_t));
- data += sizeof( u_int16_t );
+ memset(data, 0, sizeof(uint16_t));
+ data += sizeof( uint16_t );
break;
case FILPBIT_FNUM :
if (afp_version >= 30) { /* UTF8 name */
utf8 = kTextEncodingUTF8;
utf_nameoff = data;
- data += sizeof( u_int16_t );
+ data += sizeof( uint16_t );
aint = 0;
memcpy(data, &aint, sizeof( aint ));
data += sizeof( aint );
/* ----------------------- */
int getfilparams(struct vol *vol,
- u_int16_t bitmap,
+ uint16_t bitmap,
struct path *path, struct dir *dir,
char *buf, size_t *buflen )
{
struct ofork *of = NULL;
char *path, *upath;
int creatf, did, openf, retvalue = AFP_OK;
- u_int16_t vid;
+ uint16_t vid;
struct path *s_path;
*rbuflen = 0;
struct dir *dir;
struct path *s_path;
int did, rc;
- u_int16_t vid, bitmap;
+ uint16_t vid, bitmap;
*rbuflen = 0;
ibuf += 2;
extern struct path Cur_Path;
int setfilparams(struct vol *vol,
- struct path *path, u_int16_t f_bitmap, char *buf )
+ struct path *path, uint16_t f_bitmap, char *buf )
{
struct adouble ad, *adp;
struct extmap *em;
int bit, isad = 1, err = AFP_OK;
char *upath;
u_char achar, *fdType, xyy[4]; /* uninitialized, OK 310105 */
- u_int16_t ashort, bshort, oshort;
- u_int32_t aint;
- u_int32_t upriv;
- u_int16_t upriv_bit = 0;
+ uint16_t ashort, bshort, oshort;
+ uint32_t aint;
+ uint32_t upriv;
+ uint16_t upriv_bit = 0;
struct utimbuf ut;
struct timeval tv;
uid_t f_uid;
gid_t f_gid;
- u_int16_t bitmap = f_bitmap;
- u_int32_t cdate,bdate;
+ uint16_t bitmap = f_bitmap;
+ uint32_t cdate,bdate;
u_char finder_buf[32];
#ifdef DEBUG
{
char type = *ibuf;
size_t plen = 0;
-u_int16_t len16;
-u_int32_t hint;
+uint16_t len16;
+uint32_t hint;
if ( type != 2 && !(afp_version >= 30 && type == 3) ) {
return -1;
struct dir *dir;
char *newname, *p, *upath;
struct path *s_path;
- u_int32_t sdid, ddid;
+ uint32_t sdid, ddid;
int err, retvalue = AFP_OK;
- u_int16_t svid, dvid;
+ uint16_t svid, dvid;
struct adouble ad, *adp;
int denyreadset;
static int check_attrib(struct adouble *adp)
{
-u_int16_t bshort = 0;
+uint16_t bshort = 0;
ad_getattr(adp, &bshort);
/*
int err, retry=0;
size_t buflen;
cnid_t id, cnid;
- u_int16_t vid, bitmap;
+ uint16_t vid, bitmap;
static char buffer[12 + MAXPATHLEN + 1];
int len = 12 + MAXPATHLEN + 1;
int crossdev;
int slen, dlen;
- u_int32_t sid, did;
- u_int16_t vid;
+ uint32_t sid, did;
+ uint16_t vid;
uid_t uid;
gid_t gid;
kTextEncodingMacKeyboardGlyphs = 41,
} kTextEncoding_t;
-extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, u_int32_t );
+extern char *set_name (const struct vol *, char *, cnid_t, char *, cnid_t, uint32_t );
extern struct extmap *getextmap (const char *);
extern struct extmap *getdefextmap (void);
-extern int getfilparams (struct vol *, u_int16_t, struct path *,
- struct dir *, char *buf, size_t *);
+extern int getfilparams (struct vol *, uint16_t, struct path *,
+ struct dir *, char *buf, size_t *);
-extern int setfilparams (struct vol *, struct path *, u_int16_t, char *);
+extern int setfilparams (struct vol *, struct path *, uint16_t, char *);
extern int renamefile (const struct vol *, int, char *, char *, char *, struct adouble *);
extern int copyfile (const struct vol *, const struct vol *, int, char *, char *, char *, struct adouble *);
extern int deletefile (const struct vol *, int, char *, int);
-extern int getmetadata (struct vol *vol, u_int16_t bitmap, struct path *path,
+extern int getmetadata (struct vol *vol, uint16_t bitmap, struct path *path,
struct dir *dir, char *buf, size_t *buflen, struct adouble *adp);
extern void *get_finderinfo (const struct vol *, const char *, struct adouble *, void *, int);
struct stat *st;
struct vol *vol;
struct dir *dir;
- u_int32_t did;
+ uint32_t did;
int ret;
size_t buflen;
- u_int16_t fbitmap, dbitmap, vid;
+ uint16_t fbitmap, dbitmap, vid;
struct path *s_path;
*rbuflen = 0;
return AFPERR_NOOBJ;
ret = getdirparams(vol, dbitmap, s_path, dir,
- rbuf + 3 * sizeof( u_int16_t ), &buflen );
+ rbuf + 3 * sizeof( uint16_t ), &buflen );
if (ret != AFP_OK )
return( ret );
}
/* this is a directory */
- *(rbuf + 2 * sizeof( u_int16_t )) = (char) FILDIRBIT_ISDIR;
+ *(rbuf + 2 * sizeof( uint16_t )) = (char) FILDIRBIT_ISDIR;
} else {
if (fbitmap && AFP_OK != (ret = getfilparams(vol, fbitmap, s_path, curdir,
- rbuf + 3 * sizeof( u_int16_t ), &buflen )) ) {
+ rbuf + 3 * sizeof( uint16_t ), &buflen )) ) {
return( ret );
}
/* this is a file */
- *(rbuf + 2 * sizeof( u_int16_t )) = FILDIRBIT_ISFILE;
+ *(rbuf + 2 * sizeof( uint16_t )) = FILDIRBIT_ISFILE;
}
- *rbuflen = buflen + 3 * sizeof( u_int16_t );
+ *rbuflen = buflen + 3 * sizeof( uint16_t );
fbitmap = htons( fbitmap );
memcpy( rbuf, &fbitmap, sizeof( fbitmap ));
rbuf += sizeof( fbitmap );
struct vol *vol;
struct dir *dir;
struct path *path;
- u_int16_t vid, bitmap;
+ uint16_t vid, bitmap;
int did, rc;
*rbuflen = 0;
}
}
if (!ad_metadata(oldunixname, adflags, adp)) {
- u_int16_t bshort;
+ uint16_t bshort;
ad_getattr(adp, &bshort);
struct dir *sdir;
char *oldname, *newname;
struct path *path;
- u_int32_t did;
+ uint32_t did;
int plen;
- u_int16_t vid;
+ uint16_t vid;
int isdir = 0;
int rc;
struct path *s_path;
char *upath;
int did, rc;
- u_int16_t vid;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
int did;
int pdid;
int plen;
- u_int16_t vid;
+ uint16_t vid;
int rc;
int sdir_fd = -1;
struct ofork *writtenfork;
#endif
-static int getforkparams(struct ofork *ofork, u_int16_t bitmap, char *buf, size_t *buflen)
+static int getforkparams(struct ofork *ofork, uint16_t bitmap, char *buf, size_t *buflen)
{
struct path path;
struct stat *st;
static off_t get_off_t(char **ibuf, int is64)
{
- u_int32_t temp;
+ uint32_t temp;
off_t ret;
ret = 0;
static int set_off_t(off_t offset, char *rbuf, int is64)
{
- u_int32_t temp;
+ uint32_t temp;
int ret;
ret = 0;
goto openfork_err;
}
- *rbuflen = buflen + 2 * sizeof( u_int16_t );
+ *rbuflen = buflen + 2 * sizeof( uint16_t );
bitmap = htons( bitmap );
- memcpy(rbuf, &bitmap, sizeof( u_int16_t ));
- rbuf += sizeof( u_int16_t );
+ memcpy(rbuf, &bitmap, sizeof( uint16_t ));
+ rbuf += sizeof( uint16_t );
/* check WriteInhibit bit if we have a ressource fork
* the test is done here, after some Mac trafic capture
{
struct ofork *ofork;
off_t size;
- u_int16_t ofrefnum, bitmap;
+ uint16_t ofrefnum, bitmap;
int err;
int is64;
int eid;
struct ofork *ofork;
off_t offset, length;
int eid;
- u_int16_t ofrefnum;
- u_int8_t flags;
+ uint16_t ofrefnum;
+ uint8_t flags;
int lockop;
*rbuflen = 0;
off_t offset, saveoff, reqcount, savereqcount;
ssize_t cc, err;
int eid, xlate = 0;
- u_int16_t ofrefnum;
+ uint16_t ofrefnum;
u_char nlmask, nlchar;
ibuf += 2;
int afp_flush(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
struct vol *vol;
- u_int16_t vid;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
int afp_flushfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
struct ofork *ofork;
- u_int16_t ofrefnum;
+ uint16_t ofrefnum;
*rbuflen = 0;
ibuf += 2;
int afp_syncfork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
struct ofork *ofork;
- u_int16_t ofrefnum;
+ uint16_t ofrefnum;
*rbuflen = 0;
ibuf += 2;
int afp_closefork(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
struct ofork *ofork;
- u_int16_t ofrefnum;
+ uint16_t ofrefnum;
*rbuflen = 0;
ibuf += 2;
struct ofork *ofork;
off_t offset, saveoff, reqcount;
int endflag, eid, xlate = 0, err = AFP_OK;
- u_int16_t ofrefnum;
+ uint16_t ofrefnum;
ssize_t cc;
/* figure out parameters */
{
struct ofork *ofork;
int ret;
- u_int16_t ofrefnum, bitmap;
+ uint16_t ofrefnum, bitmap;
size_t buflen;
ibuf += 2;
memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
#define of_name(a) (a)->of_ad->ad_m_name
/* in ofork.c */
extern struct ofork *of_alloc (struct vol *, struct dir *,
- char *, u_int16_t *, const int,
+ char *, uint16_t *, const int,
struct adouble *,
struct stat *);
extern void of_dealloc (struct ofork *);
-extern struct ofork *of_find (const u_int16_t);
+extern struct ofork *of_find (const uint16_t);
extern struct ofork *of_findname (struct path *);
extern int of_rename (const struct vol *,
struct ofork *,
char *p = strrchr(uname, '.');
if (p && p != uname) {
- u_int16_t flags = CONV_FORCE | CONV_UNESCAPEHEX;
+ uint16_t flags = CONV_FORCE | CONV_UNESCAPEHEX;
size_t len = convert_charset(vol->v_volcharset, charset,
vol->v_maccharset, p, strlen(p),
extension, MAX_EXT_LENGTH, &flags);
static char *demangle_checks(const struct vol *vol, char* uname, char * mfilename, size_t prefix, char * ext)
{
- u_int16_t flags;
+ uint16_t flags;
static char buffer[MAXPATHLEN +2]; /* for convert_charset dest_len parameter +2 */
size_t len;
size_t mfilenamelen;
{
char *t;
char *u_name;
- u_int32_t id, file_id;
+ uint32_t id, file_id;
static char buffer[12 + MAXPATHLEN + 1];
int len = 12 + MAXPATHLEN + 1;
struct dir *dir;
k = sprintf(mangle_suffix, "%c%X", MANGLE_CHAR, ntohl(id));
if (filenamelen + k + ext_len > maxlen) {
- u_int16_t opt = CONV_FORCE | CONV_UNESCAPEHEX;
+ uint16_t opt = CONV_FORCE | CONV_UNESCAPEHEX;
size_t n = convert_charset(vol->v_volcharset,
(flags & 2) ? CH_UTF8_MAC : vol->v_maccharset,
vol->v_maccharset, uname, strlen(uname),
int rc;
static int c;
uid_t euid;
- u_int32_t maxmsgsize;
+ uint32_t maxmsgsize;
maxmsgsize = (obj->proto == AFPPROTO_DSI)?MIN(MAX(((DSI*)obj->handle)->attn_quantum, MAXMESGSIZE),MAXPATHLEN):MAXMESGSIZE;
int afp_getsrvrmesg(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
{
char *message;
- u_int16_t type, bitmap;
- u_int16_t msgsize;
+ uint16_t type, bitmap;
+ uint16_t msgsize;
size_t outlen = 0;
size_t msglen = 0;
int utf8 = 0;
#define GQR_RQUOTA getquota_rslt_u.gqr_rquota
#endif /* USE_OLD_RQUOTA */
-int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize,
+int getnfsquota(struct vol *vol, const int uid, const uint32_t bsize,
struct dqblk *dqp)
{
of_alloc(struct vol *vol,
struct dir *dir,
char *path,
- u_int16_t *ofrefnum,
+ uint16_t *ofrefnum,
const int eid,
struct adouble *ad,
struct stat *st)
{
struct ofork *of;
- u_int16_t refnum, of_refnum;
+ uint16_t refnum, of_refnum;
int i;
return( of );
}
-struct ofork *of_find(const u_int16_t ofrefnum )
+struct ofork *of_find(const uint16_t ofrefnum )
{
if (!oforks || !nforks)
return NULL;
if ((ret = quotactl(QCMD(Q_XGETQUOTA,(what ? GRPQUOTA : USRQUOTA)), path, euser_id, (caddr_t)&D)))
return ret;
- dqb->bsize = (u_int64_t)512;
- dqb->dqb_bsoftlimit = (u_int64_t)D.d_blk_softlimit;
- dqb->dqb_bhardlimit = (u_int64_t)D.d_blk_hardlimit;
- dqb->dqb_ihardlimit = (u_int64_t)D.d_ino_hardlimit;
- dqb->dqb_isoftlimit = (u_int64_t)D.d_ino_softlimit;
- dqb->dqb_curinodes = (u_int64_t)D.d_icount;
- dqb->dqb_curblocks = (u_int64_t)D.d_bcount;
+ dqb->bsize = (uint64_t)512;
+ dqb->dqb_bsoftlimit = (uint64_t)D.d_blk_softlimit;
+ dqb->dqb_bhardlimit = (uint64_t)D.d_blk_hardlimit;
+ dqb->dqb_ihardlimit = (uint64_t)D.d_ino_hardlimit;
+ dqb->dqb_isoftlimit = (uint64_t)D.d_ino_softlimit;
+ dqb->dqb_curinodes = (uint64_t)D.d_icount;
+ dqb->dqb_curblocks = (uint64_t)D.d_bcount;
#endif
return ret;
}
if(
/* if overquota, free space is 0 otherwise hard-current */
( overquota( dq ) ? 0 : ( dq->dqb_bhardlimit ? dq->dqb_bhardlimit -
- dq->dqb_curblocks : ~((u_int64_t) 0) ) )
+ dq->dqb_curblocks : ~((uint64_t) 0) ) )
>
( overquota( &dqg ) ? 0 : ( dqg.dqb_bhardlimit ? dqg.dqb_bhardlimit -
- dqg.dqb_curblocks : ~((u_int64_t) 0) ) )
+ dqg.dqb_curblocks : ~((uint64_t) 0) ) )
) /* if */
{
}
-static int getquota( struct vol *vol, struct dqblk *dq, const u_int32_t bsize)
+static int getquota( struct vol *vol, struct dqblk *dq, const uint32_t bsize)
{
char *p;
#define tobytes(a, b) dbtob((VolSpace) (a))
#endif
-int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
+int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const uint32_t bsize)
{
- u_int64_t this_bsize;
+ uint64_t this_bsize;
struct dqblk dqblk;
this_bsize = bsize;
char *start = data;
char *Obj, *Type, *Zone;
char buf[32];
- u_int16_t status;
+ uint16_t status;
size_t len;
/* make room for all offsets before server name */
static void status_machine(char *data)
{
char *start = data;
- u_int16_t status;
+ uint16_t status;
int len;
#ifdef AFS
const char *machine = "afs";
}
/* server signature is a 16-byte quantity */
-static u_int16_t status_signature(char *data, int *servoffset,
+static uint16_t status_signature(char *data, int *servoffset,
const struct afp_options *options)
{
char *status;
- u_int16_t offset, sigoff;
+ uint16_t offset, sigoff;
status = data;
const struct afp_options *options)
{
char *begin;
- u_int16_t offset;
+ uint16_t offset;
size_t addresses_len = 0;
begin = data;
const struct afp_options *options)
{
char *begin = data;
- u_int16_t offset;
+ uint16_t offset;
memcpy(&offset, data + *diroffset, sizeof(offset));
offset = ntohs(offset);
data += offset;
}
/* Calculate and store offset for UTF8ServerName */
- *diroffset += sizeof(u_int16_t);
+ *diroffset += sizeof(uint16_t);
offset = htons(data - begin);
- memcpy(begin + *diroffset, &offset, sizeof(u_int16_t));
+ memcpy(begin + *diroffset, &offset, sizeof(uint16_t));
/* return length of buffer */
return (data - begin);
const struct afp_options *options)
{
char *Obj, *Type, *Zone;
- u_int16_t namelen;
+ uint16_t namelen;
size_t len;
char *begin = data;
- u_int16_t offset, status;
+ uint16_t offset, status;
memcpy(&offset, data + *nameoffset, sizeof(offset));
offset = ntohs(offset);
data += sizeof(namelen);
data += len;
offset = htons(offset);
- memcpy(begin + *nameoffset, &offset, sizeof(u_int16_t));
+ memcpy(begin + *nameoffset, &offset, sizeof(uint16_t));
}
/* return length of buffer */
{
char *start = data;
char *sigdata = data + sigoffset;
- u_int16_t ret, status;
+ uint16_t ret, status;
memcpy(&status, start + AFPSTATUS_ICONOFF, sizeof(status));
if ( icondata == NULL ) {
int uam_random_string (AFPObj *obj, char *buf, int len)
{
- u_int32_t result;
+ uint32_t result;
int ret;
int fd;
/*
* Get the free space on a partition.
*/
-int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, u_int32_t *bsize)
+int ustatfs_getvolspace(const struct vol *vol, VolSpace *bfree, VolSpace *btotal, uint32_t *bsize)
{
VolSpace maxVolSpace = (~(VolSpace)0);
#endif /* linux */
-extern int getnfsquota (struct vol *, const int, const u_int32_t,
- struct dqblk *);
+extern int getnfsquota (struct vol *, const int, const uint32_t,
+ struct dqblk *);
extern int uquota_getvolspace (struct vol *, VolSpace *, VolSpace *,
- const u_int32_t);
+ const uint32_t);
#endif /* NO_QUOTA_SUPPORT */
extern struct afp_options default_options;
struct vol *current_vol; /* last volume from getvolbyvid() */
static struct vol *Volumes = NULL;
-static u_int16_t lastvid = 0;
+static uint16_t lastvid = 0;
static char *Trash = "\02\024Network Trash Folder";
static struct extmap *Extmap = NULL, *Defextmap = NULL;
char tmpname[AFPVOL_U8MNAMELEN+1];
ucs2_t u8mtmpname[(AFPVOL_U8MNAMELEN+1)*2], mactmpname[(AFPVOL_MACNAMELEN+1)*2];
char suffix[6]; /* max is #FFFF */
- u_int16_t flags;
+ uint16_t flags;
LOG(log_debug, logtype_afpd, "createvol: Volume '%s'", name);
}
static int getvolspace(struct vol *vol,
- u_int32_t *bfree, u_int32_t *btotal,
- VolSpace *xbfree, VolSpace *xbtotal, u_int32_t *bsize)
+ uint32_t *bfree, uint32_t *btotal,
+ VolSpace *xbfree, VolSpace *xbtotal, uint32_t *bsize)
{
int spaceflag, rc;
- u_int32_t maxsize;
+ uint32_t maxsize;
VolSpace used;
#ifndef NO_QUOTA_SUPPORT
VolSpace qfree, qtotal;
* set volume creation date
* avoid duplicate, well at least it tries
*/
-static void vol_setdate(u_int16_t id, struct adouble *adp, time_t date)
+static void vol_setdate(uint16_t id, struct adouble *adp, time_t date)
{
struct vol *volume;
struct vol *vol = Volumes;
}
/* ----------------------- */
-static int getvolparams( u_int16_t bitmap, struct vol *vol, struct stat *st, char *buf, size_t *buflen)
+static int getvolparams( uint16_t bitmap, struct vol *vol, struct stat *st, char *buf, size_t *buflen)
{
struct adouble ad;
int bit = 0, isad = 1;
- u_int32_t aint;
+ uint32_t aint;
u_short ashort;
- u_int32_t bfree, btotal, bsize;
+ uint32_t bfree, btotal, bsize;
VolSpace xbfree, xbtotal; /* extended bytes */
char *data, *nameoff = NULL;
char *slash;
case VOLPBIT_NAME :
nameoff = data;
- data += sizeof( u_int16_t );
+ data += sizeof( uint16_t );
break;
case VOLPBIT_BSIZE: /* block size */
}
/* ------------------------- */
-static int stat_vol(u_int16_t bitmap, struct vol *vol, char *rbuf, size_t *rbuflen)
+static int stat_vol(uint16_t bitmap, struct vol *vol, char *rbuf, size_t *rbuflen)
{
struct stat st;
int ret;
return AFPERR_PARAM;
}
tv.tv_sec = AD_DATE_FROM_UNIX(tv.tv_sec);
- memcpy(data, &tv.tv_sec, sizeof( u_int32_t));
- data += sizeof( u_int32_t);
+ memcpy(data, &tv.tv_sec, sizeof( uint32_t));
+ data += sizeof( uint32_t);
*data = vcnt;
return( AFP_OK );
}
struct dir *dir;
int len, ret;
size_t namelen;
- u_int16_t bitmap;
+ uint16_t bitmap;
char path[ MAXPATHLEN + 1];
char *vol_uname;
char *vol_mname;
int afp_closevol(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf _U_, size_t *rbuflen)
{
struct vol *vol;
- u_int16_t vid;
+ uint16_t vid;
*rbuflen = 0;
ibuf += 2;
}
/* ------------------------- */
-struct vol *getvolbyvid(const u_int16_t vid )
+struct vol *getvolbyvid(const uint16_t vid )
{
struct vol *vol;
int afp_getvolparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_,char *rbuf, size_t *rbuflen)
{
struct vol *vol;
- u_int16_t vid, bitmap;
+ uint16_t vid, bitmap;
ibuf += 2;
memcpy(&vid, ibuf, sizeof( vid ));
{
struct adouble ad;
struct vol *vol;
- u_int16_t vid, bitmap;
- u_int32_t aint;
+ uint16_t vid, bitmap;
+ uint32_t aint;
ibuf += 2;
*rbuflen = 0;
{
char *p,*q,*r;
struct adouble ad;
- u_int16_t attr;
+ uint16_t attr;
struct stat st;
int ret;
#include <atalk/unicode.h>
#include <atalk/globals.h>
-extern struct vol *getvolbyvid (const u_int16_t);
+extern struct vol *getvolbyvid (const uint16_t);
extern int ustatfs_getvolspace (const struct vol *,
VolSpace *, VolSpace *,
- u_int32_t *);
+ uint32_t *);
extern void setvoltime (AFPObj *, struct vol *);
extern int pollvoltime (AFPObj *);
extern void load_volumes (AFPObj *obj);
static gcry_mpi_t serverNonce;
static char *K_MD5hash = NULL;
static int K_hash_len;
-static u_int16_t ID;
+static uint16_t ID;
/* The initialization vectors for CAST128 are fixed by Apple. */
static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' };
/* Session ID first */
ID = dhxhash(obj);
- *(u_int16_t *)rbuf = htons(ID);
+ *(uint16_t *)rbuf = htons(ID);
rbuf += 2;
*rbuflen += 2;
*rbuflen += 4;
/* len = length of p = PRIMEBITS/8 */
- *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8);
+ *(uint16_t *)rbuf = htons((uint16_t) PRIMEBITS/8);
rbuf += 2;
*rbuflen += 2;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
/* ---- Start building reply packet ---- */
/* Session ID + 1 first */
- *(u_int16_t *)rbuf = htons(ID+1);
+ *(uint16_t *)rbuf = htons(ID+1);
rbuf += 2;
*rbuflen += 2;
char *ibuf, size_t ibuflen,
char *rbuf, size_t *rbuflen)
{
- u_int16_t retID;
+ uint16_t retID;
int ret;
/* check for session id */
- retID = ntohs(*(u_int16_t *)ibuf);
+ retID = ntohs(*(uint16_t *)ibuf);
if (retID == ID)
ret = logincont1(obj, ibuf, ibuflen, rbuf, rbuflen);
else if (retID == ID+1)
static gcry_mpi_t serverNonce;
static char *K_MD5hash = NULL;
static int K_hash_len;
-static u_int16_t ID;
+static uint16_t ID;
/* The initialization vectors for CAST128 are fixed by Apple. */
static unsigned char dhx_c2siv[] = { 'L', 'W', 'a', 'l', 'l', 'a', 'c', 'e' };
/* Session ID first */
ID = dhxhash(obj);
- *(u_int16_t *)rbuf = htons(ID);
+ *(uint16_t *)rbuf = htons(ID);
rbuf += 2;
*rbuflen += 2;
*rbuflen += 4;
/* len = length of p = PRIMEBITS/8 */
- *(u_int16_t *)rbuf = htons((u_int16_t) PRIMEBITS/8);
+ *(uint16_t *)rbuf = htons((uint16_t) PRIMEBITS/8);
rbuf += 2;
*rbuflen += 2;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
/* ---- Start building reply packet ---- */
/* Session ID + 1 first */
- *(u_int16_t *)rbuf = htons(ID+1);
+ *(uint16_t *)rbuf = htons(ID+1);
rbuf += 2;
*rbuflen += 2;
char *ibuf, size_t ibuflen,
char *rbuf, size_t *rbuflen)
{
- u_int16_t retID;
+ uint16_t retID;
int ret;
/* check for session id */
- retID = ntohs(*(u_int16_t *)ibuf);
+ retID = ntohs(*(uint16_t *)ibuf);
if (retID == ID)
ret = logincont1(obj, uam_pwd, ibuf, ibuflen, rbuf, rbuflen);
else if (retID == ID+1)
/* the secret key */
static CAST_KEY castkey;
static struct passwd *dhxpwd;
-static u_int8_t randbuf[KEYSIZE];
+static uint8_t randbuf[KEYSIZE];
/* diffie-hellman bits */
static unsigned char msg2_iv[] = "CJalbert";
static unsigned char msg3_iv[] = "LWallace";
-static const u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4,
+static const uint8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4,
0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B};
-static const u_int8_t g = 0x07;
+static const uint8_t g = 0x07;
/* Static variables used to communicate between the conversation function
static int dhx_setup(void *obj, char *ibuf, size_t ibuflen _U_,
char *rbuf, size_t *rbuflen)
{
- u_int16_t sessid;
+ uint16_t sessid;
size_t i;
BIGNUM *bn, *gbn, *pbn;
DH *dh;
char *username;
int len;
size_t ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
{
const char *hostname;
BIGNUM *bn1, *bn2, *bn3;
- u_int16_t sessid;
+ uint16_t sessid;
int err, PAM_error;
*rbuflen = 0;
char *hostname;
pam_handle_t *lpamh;
uid_t uid;
- u_int16_t sessid;
+ uint16_t sessid;
int PAM_error;
if (ibuflen < sizeof(sessid)) {
/* the secret key */
static CAST_KEY castkey;
static struct passwd *dhxpwd;
-static u_int8_t randbuf[16];
+static uint8_t randbuf[16];
#ifdef TRU64
#include <sia.h>
char *rbuf, size_t *rbuflen)
{
unsigned char iv[] = "CJalbert";
- u_int8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4,
+ uint8_t p[] = {0xBA, 0x28, 0x73, 0xDF, 0xB0, 0x60, 0x57, 0xD4,
0x3F, 0x20, 0x24, 0x74, 0x4C, 0xEE, 0xE7, 0x5B };
- u_int8_t g = 0x07;
+ uint8_t g = 0x07;
#ifdef SHADOWPW
struct spwd *sp;
#endif /* SHADOWPW */
BIGNUM *bn, *gbn, *pbn;
- u_int16_t sessid;
+ uint16_t sessid;
size_t i;
DH *dh;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
#endif /* SHADOWPW */
unsigned char iv[] = "LWallace";
BIGNUM *bn1, *bn2, *bn3;
- u_int16_t sessid;
+ uint16_t sessid;
char *p;
int err = AFPERR_NOTAUTH;
if (!ret) {
/* FIXME: Is copying the authenticator really necessary?
Where is this documented? */
- u_int16_t auth_len = htons( authenticator_buff.length );
+ uint16_t auth_len = htons( authenticator_buff.length );
/* copy the authenticator length into the reply buffer */
memcpy( rbuf, &auth_len, sizeof(auth_len) );
char *rbuf, size_t *rbuflen)
{
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
char *rbuf, size_t *rbuflen)
{
struct passwd *pwd = NULL;
- u_int16_t login_id;
+ uint16_t login_id;
char *username;
- u_int16_t ticket_len;
+ uint16_t ticket_len;
char *p;
int rblen;
size_t userlen;
/* Apple's AFP 3.1 documentation specifies that this command
* takes the following format:
* pad (byte)
- * id returned in LoginExt response (u_int16_t)
+ * id returned in LoginExt response (uint16_t)
* username (format unspecified) padded, when necessary, to end on an even boundary
- * ticket length (u_int16_t)
+ * ticket length (uint16_t)
* ticket
*/
* format of this request is as follows:
* pad (byte) [consumed before login_ext is called]
* ?? (byte) - always observed to be 0
- * id returned in LoginExt response (u_int16_t)
+ * id returned in LoginExt response (uint16_t)
* username, encoding unspecified, null terminated C string,
* padded when the terminating null is an even numbered byte.
* The packet is formated such that the username begins on an
* odd numbered byte. Eg if the username is 3 characters and the
* terminating null makes 4, expect to pad the the result.
* The encoding of this string is unknown.
- * ticket length (u_int16_t)
+ * ticket length (uint16_t)
* ticket
*/
char *ibuf, size_t ibuflen,
char *rbuf, size_t *rbuflen)
{
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
/* the secret key */
static struct passwd *pgppwd;
static CAST_KEY castkey;
-static u_int8_t randbuf[16];
+static uint8_t randbuf[16];
/* pgp passwd */
static int pgp_login(void *obj, struct passwd **uam_pwd,
{
unsigned char iv[] = "RJscorat";
BIGNUM *bn1, *bn2, *bn3;
- u_int16_t sessid;
+ uint16_t sessid;
char *p;
*rbuflen = 0;
static C_Block seskey;
static Key_schedule seskeysched;
static struct passwd *randpwd;
-static u_int8_t randbuf[8];
+static uint8_t randbuf[8];
/* hash to a 16-bit number. this will generate completely harmless
* warnings on 64-bit machines. */
unsigned char *passwd, int len,
const int set)
{
- u_int8_t key[DES_KEY_SZ*2];
+ uint8_t key[DES_KEY_SZ*2];
char buf[MAXPATHLEN + 1], *p;
Key_schedule schedule;
FILE *fp;
{
char *passwdfile;
- u_int16_t sessid;
+ uint16_t sessid;
size_t len;
int err;
char *ibuf, size_t ibuflen _U_,
char *rbuf _U_, size_t *rbuflen)
{
- u_int16_t sessid;
+ uint16_t sessid;
*rbuflen = 0;
char *ibuf, size_t ibuflen _U_,
char *rbuf, size_t *rbuflen)
{
- u_int16_t sessid;
+ uint16_t sessid;
unsigned int i;
*rbuflen = 0;
{
char *username;
size_t len, ulen;
- u_int16_t temp16;
+ uint16_t temp16;
*rbuflen = 0;
#define RFORK_EA_ALLOCSIZE (128*1024) /* 128k */
-typedef u_int32_t cnid_t;
+typedef uint32_t cnid_t;
struct ad_entry {
uint32_t ade_off;
};
struct adouble {
- u_int32_t ad_magic; /* Official adouble magic */
- u_int32_t ad_version; /* Official adouble version number */
+ uint32_t ad_magic; /* Official adouble magic */
+ uint32_t ad_version; /* Official adouble version number */
char ad_filler[16];
struct ad_entry ad_eid[ADEID_MAX];
struct ad_fd ad_data_fork; /* the data fork */
extern int ad_getattr(const struct adouble *, uint16_t *);
extern int ad_setname(struct adouble *, const char *);
extern int ad_setid(struct adouble *, dev_t dev, ino_t ino, uint32_t, uint32_t, const void *);
-extern u_int32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *);
-extern u_int32_t ad_forcegetid(struct adouble *adp);
+extern uint32_t ad_getid(struct adouble *, dev_t, ino_t, cnid_t, const void *);
+extern uint32_t ad_forcegetid(struct adouble *adp);
#ifdef WITH_SENDFILE
extern int ad_readfile_init(const struct adouble *ad, int eid, off_t *off, int end);
#include <sys/types.h>
-typedef u_int16_t AFPUserBytes;
+typedef uint16_t AFPUserBytes;
/* protocols */
#define AFPPROTO_ASP 1
* This is instance of CNID database object.
*/
struct _cnid_db {
- u_int32_t flags; /* Flags describing some CNID backend aspects. */
+ uint32_t flags; /* Flags describing some CNID backend aspects. */
char *volpath; /* Volume path this particular CNID db refers to. */
void *_private; /* back-end speficic data */
char *name;
struct list_head db_list; /* CNID modules are also stored on a bidirectional list. */
struct _cnid_db *(*cnid_open)(struct cnid_open_args *args);
- u_int32_t flags; /* Flags describing some CNID backend aspects. */
+ uint32_t flags; /* Flags describing some CNID backend aspects. */
};
typedef struct _cnid_module cnid_module;
};
typedef struct CNID_private {
- u_int32_t magic;
+ uint32_t magic;
char db_dir[MAXPATHLEN + 1]; /* Database directory without /.AppleDB appended */
char *cnidserver;
char *cnidport;
#define DSI_BLOCKSIZ 16
struct dsi_block {
- u_int8_t dsi_flags; /* packet type: request or reply */
- u_int8_t dsi_command; /* command */
- u_int16_t dsi_requestID; /* request ID */
- u_int32_t dsi_code; /* error code or data offset */
- u_int32_t dsi_len; /* total data length */
- u_int32_t dsi_reserved; /* reserved field */
+ uint8_t dsi_flags; /* packet type: request or reply */
+ uint8_t dsi_command; /* command */
+ uint16_t dsi_requestID; /* request ID */
+ uint32_t dsi_code; /* error code or data offset */
+ uint32_t dsi_len; /* total data length */
+ uint32_t dsi_reserved; /* reserved field */
};
#define DSI_CMDSIZ 8192
int msg_request; /* pending message to the client */
int down_request; /* pending SIGUSR1 down in 5 mn */
- u_int32_t attn_quantum, datasize, server_quantum;
- u_int16_t serverID, clientID;
+ uint32_t attn_quantum, datasize, server_quantum;
+ uint16_t serverID, clientID;
char *status;
- u_int8_t commands[DSI_CMDSIZ], data[DSI_DATASIZ];
+ uint8_t commands[DSI_CMDSIZ], data[DSI_DATASIZ];
size_t statuslen;
size_t datalen, cmdlen;
off_t read_count, write_count;
const char * /*program*/,
const char * /*host*/, const char * /*address*/,
const char * /*port*/, const int /*proxy*/,
- const u_int32_t /* server quantum */);
+ const uint32_t /* server quantum */);
extern void dsi_setstatus (DSI *, char *, const size_t);
/* in dsi_getsess.c */
int disconnected; /* Maximum time in disconnected state (in tickles) */
unsigned int tcp_sndbuf, tcp_rcvbuf;
unsigned char passwdbits, passwdminlen, loginmaxfail;
- u_int32_t server_quantum;
+ uint32_t server_quantum;
int dsireadbuf; /* scale factor for sizefof(dsi->buffer) = server_quantum * dsireadbuf */
char hostname[MAXHOSTNAMELEN + 1], *server, *ipaddr, *port, *configfile;
char *uampath, *fqdn;
extern void server_child_kill (server_child *, const int, const int);
extern void server_child_kill_one_by_id (server_child *children, const int forkid, const pid_t pid, const uid_t,
- const u_int32_t len, char *id, u_int32_t boottime);
+ const uint32_t len, char *id, uint32_t boottime);
extern int server_child_transfer_session(server_child *children, int forkid, pid_t, uid_t, int, uint16_t);
extern void server_child_setup (server_child *, const int, void (*)(const pid_t));
extern void server_child_handler (server_child *);
#include <errno.h>
#include <sys/param.h>
-#define ucs2_t u_int16_t
+#define ucs2_t uint16_t
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
char **outbuf, size_t *outbytesleft);
size_t (*push)(void *, char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft);
- u_int32_t flags;
+ uint32_t flags;
const char *iname;
struct charset_functions *prev, *next;
};
/* from utf16_case.c */
extern ucs2_t toupper_w (ucs2_t);
-extern u_int32_t toupper_sp (u_int32_t);
+extern uint32_t toupper_sp (uint32_t);
extern ucs2_t tolower_w (ucs2_t);
-extern u_int32_t tolower_sp (u_int32_t);
+extern uint32_t tolower_sp (uint32_t);
/* from util_unistr.c */
extern int strupper_w (ucs2_t *);
extern size_t utf8_to_charset_allocate (charset_t, char **dest, const char *src);
extern size_t ucs2_to_charset (charset_t, const ucs2_t *src, char *dest, size_t);
-extern size_t convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, u_int16_t *);
+extern size_t convert_charset (charset_t, charset_t, charset_t, const char *, size_t, char *, size_t, uint16_t *);
extern size_t charset_precompose ( charset_t, char *, size_t, char *, size_t);
extern size_t charset_decompose ( charset_t, char *, size_t, char *, size_t);
#define VOLINFOFILE ".volinfo"
typedef struct {
- const u_int32_t option;
+ const uint32_t option;
const char *name;
} vol_opt_name_t;
#define AFPVOL_U8MNAMELEN 255 /* AFP3 sepc */
#define AFPVOL_MACNAMELEN 27 /* AFP2 spec */
-typedef u_int64_t VolSpace;
+typedef uint64_t VolSpace;
struct vol {
struct vol *v_next;
- u_int16_t v_vid;
+ uint16_t v_vid;
int v_flags;
char *v_path;
struct dir *v_root;
charset_t v_volcharset;
charset_t v_maccharset;
- u_int16_t v_mtou_flags; /* flags for convert_charset in mtoupath */
- u_int16_t v_utom_flags;
+ uint16_t v_mtou_flags; /* flags for convert_charset in mtoupath */
+ uint16_t v_utom_flags;
long v_kTextEncoding; /* mac charset encoding in network order
* FIXME: should be a u_int32_t ? */
size_t max_filename;
retrieved from the FinderFlags. This fixes Bug #2802236:
<https://sourceforge.net/tracker/?func=detail&aid=2802236&group_id=8642&atid=108642>
*/
-int ad_getattr(const struct adouble *ad, u_int16_t *attr)
+int ad_getattr(const struct adouble *ad, uint16_t *attr)
{
- u_int16_t fflags;
+ uint16_t fflags;
*attr = 0;
if (ad->ad_version == AD_VERSION2) {
}
/* ----------------- */
-int ad_setattr(const struct adouble *ad, const u_int16_t attribute)
+int ad_setattr(const struct adouble *ad, const uint16_t attribute)
{
uint16_t fflags;
/* we don't save open forks indicator */
- u_int16_t attr = attribute & ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN);
+ uint16_t attr = attribute & ~htons(ATTRBIT_DOPEN | ATTRBIT_ROPEN);
/* Proactively (10.4 does indeed try to set ATTRBIT_MULTIUSER (=ATTRBIT_EXPFLDR)
for dirs with SetFile -a M <dir> ) disable all flags not defined for dirs. */
* save file/folder ID in AppleDoubleV2 netatalk private parameters
* return 1 if resource fork has been modified
*/
-int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const u_int32_t id, const cnid_t did, const void *stamp)
+int ad_setid (struct adouble *adp, const dev_t dev, const ino_t ino , const uint32_t id, const cnid_t did, const void *stamp)
{
if ((adp->ad_flags == AD_VERSION2) && (adp->ad_options & ADVOL_CACHE)) {
}
/* ----------------------------- */
-u_int32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino , const cnid_t did, const void *stamp)
+uint32_t ad_getid (struct adouble *adp, const dev_t st_dev, const ino_t st_ino , const cnid_t did, const void *stamp)
{
- u_int32_t aint = 0;
+ uint32_t aint = 0;
dev_t dev;
ino_t ino;
cnid_t a_did;
}
/* ----------------------------- */
-u_int32_t ad_forcegetid (struct adouble *adp)
+uint32_t ad_forcegetid (struct adouble *adp)
{
- u_int32_t aint = 0;
+ uint32_t aint = 0;
if (adp && (adp->ad_options & ADVOL_CACHE)) {
memcpy(&aint, ad_entry(adp, ADEID_PRIVID), sizeof(aint));
#include <atalk/adouble.h>
int ad_setdate(struct adouble *ad,
- unsigned int dateoff, u_int32_t date)
+ unsigned int dateoff, uint32_t date)
{
int xlate = (dateoff & AD_DATE_UNIX);
}
int ad_getdate(const struct adouble *ad,
- unsigned int dateoff, u_int32_t *date)
+ unsigned int dateoff, uint32_t *date)
{
int xlate = (dateoff & AD_DATE_UNIX);
if (dateoff > AD_DATE_ACCESS)
return -1;
- memcpy(date, ad_entry(ad, ADEID_FILEDATESI) + dateoff, sizeof(u_int32_t));
+ memcpy(date, ad_entry(ad, ADEID_FILEDATESI) + dateoff, sizeof(uint32_t));
if (xlate)
*date = AD_DATE_TO_UNIX(*date);
#include "ad_lock.h"
-static const u_int32_t set_eid[] = {
+static const uint32_t set_eid[] = {
0,1,2,3,4,5,6,7,8,
9,10,11,12,13,14,15,
AD_DEV, AD_INO, AD_SYN, AD_ID
*/
int ad_rebuild_adouble_header(struct adouble *ad)
{
- u_int32_t eid;
- u_int32_t temp;
- u_int16_t nent;
+ uint32_t eid;
+ uint32_t temp;
+ uint16_t nent;
char *buf, *nentp;
int len;
*/
int ad_copy_header(struct adouble *add, struct adouble *ads)
{
- u_int32_t eid;
- u_int32_t len;
+ uint32_t eid;
+ uint32_t len;
for ( eid = 0; eid < ADEID_MAX; eid++ ) {
if ( ads->ad_eid[ eid ].ade_off == 0 ) {
}
/* ------------------ */
-static int ad_fcntl_lock(struct adouble *ad, const u_int32_t eid, const int locktype,
+static int ad_fcntl_lock(struct adouble *ad, const uint32_t eid, const int locktype,
const off_t off, const off_t len, const int fork)
{
#if 0
/* -------------------------
*/
-static int ad_fcntl_tmplock(struct adouble *ad, const u_int32_t eid, const int locktype,
+static int ad_fcntl_tmplock(struct adouble *ad, const uint32_t eid, const int locktype,
const off_t off, const off_t len, const int fork)
{
struct flock lock;
- there's no locks held by another process (clients)
- or we already know the answer and don't need to test.
*/
-uint16_t ad_openforks(struct adouble *ad, u_int16_t attrbits)
+uint16_t ad_openforks(struct adouble *ad, uint16_t attrbits)
{
return 0;
#if 0
the fork is opened in Read Write, Deny Read, Deny Write mode
lock the whole file once
*/
-int ad_excl_lock(struct adouble *ad, const u_int32_t eid)
+int ad_excl_lock(struct adouble *ad, const uint32_t eid)
{
return 0;
#if 0
static int new_ad_header(const char *path, struct adouble *ad, int adflags)
{
const struct entry *eid;
- u_int16_t ashort;
+ uint16_t ashort;
struct stat st;
ad->ad_magic = AD_MAGIC;
static int ad_header_read(struct adouble *ad, struct stat *hst)
{
char *buf = ad->ad_data;
- u_int16_t nentries;
+ uint16_t nentries;
int len;
ssize_t header_len;
struct stat st;
/* XXX: locks have to be checked before each stream of consecutive
* ad_reads to prevent a denial in the middle from causing
* problems. */
-ssize_t ad_read( struct adouble *ad, const u_int32_t eid, off_t off, char *buf, const size_t buflen)
+ssize_t ad_read( struct adouble *ad, const uint32_t eid, off_t off, char *buf, const size_t buflen)
{
ssize_t cc;
#include <atalk/logger.h>
#include <atalk/adouble.h>
-off_t ad_size(const struct adouble *ad, const u_int32_t eid)
+off_t ad_size(const struct adouble *ad, const uint32_t eid)
{
if (eid == ADEID_DFORK) {
struct stat st;
}
/* ------------------- */
-static void block_signal( u_int32_t flags)
+static void block_signal(uint32_t flags)
{
if ((flags & CNID_FLAG_BLOCK)) {
pthread_sigmask(SIG_BLOCK, &sigblockset, NULL);
}
/* ------------------- */
-static void unblock_signal(u_int32_t flags)
+static void unblock_signal(uint32_t flags)
{
if ((flags & CNID_FLAG_BLOCK)) {
pthread_sigmask(SIG_UNBLOCK, &sigblockset, NULL);
/* Closes CNID database. Currently it's just a wrapper around db->cnid_close(). */
void cnid_close(struct _cnid_db *db)
{
-u_int32_t flags;
+ uint32_t flags;
if (NULL == db) {
LOG(log_error, logtype_afpd, "Error: cnid_close called with NULL argument !");
extern cnid_t cnid_tdb_nextid (struct _cnid_db *);
/* construct db_cnid data. NOTE: this is not re-entrant. */
-extern unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len);
+extern unsigned char *make_tdb_data(uint32_t flags, const struct stat *st, const cnid_t did, const char *name, const size_t len);
#endif /* include/atalk/cnid_tdb.h */
buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino;
}
-unsigned char *make_tdb_data(u_int32_t flags, const struct stat *st,const cnid_t did,
+unsigned char *make_tdb_data(uint32_t flags, const struct stat *st,const cnid_t did,
const char *name, const size_t len)
{
static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1];
unsigned char *buf = start +CNID_LEN;
- u_int32_t i;
+ uint32_t i;
if (len > MAXPATHLEN)
return NULL;
int devino = 1, didname = 1;
char dev[CNID_DEV_LEN];
char ino[CNID_INO_LEN];
- u_int32_t type_devino = (unsigned)-1;
- u_int32_t type_didname = (unsigned)-1;
- u_int32_t type;
+ uint32_t type_devino = (unsigned)-1;
+ uint32_t type_didname = (unsigned)-1;
+ uint32_t type;
int update = 0;
cnid_t id_devino = 0, id_didname = 0,id = 0;
data = tdb_fetch(db->tdb_didname, key);
if (!data.dptr) {
- u_int32_t version = htonl(DBVERSION);
+ uint32_t version = htonl(DBVERSION);
data.dptr = (char *)&version;
data.dsize = sizeof(version);
{
/* header + AFPUserBytes */
char block[DSI_BLOCKSIZ + sizeof(AFPUserBytes)];
- u_int32_t len, nlen;
- u_int16_t id;
+ uint32_t len, nlen;
+ uint16_t id;
if (dsi->flags & DSI_SLEEPING)
return 1;
DSI *dsi_init(const dsi_proto protocol, const char *program,
const char *hostname, const char *address,
- const char *port, const int proxy, const u_int32_t quantum)
+ const char *port, const int proxy, const uint32_t quantum)
{
DSI *dsi;
/* OpenSession. set up the connection */
void dsi_opensession(DSI *dsi)
{
- u_int32_t i = 0; /* this serves double duty. it must be 4-bytes long */
+ uint32_t i = 0; /* this serves double duty. it must be 4-bytes long */
int offs;
dsi_init_buffer(dsi);
/*
* Return all bytes up to count from dsi->buffer if there are any buffered there
*/
-static size_t from_buf(DSI *dsi, u_int8_t *buf, size_t count)
+static size_t from_buf(DSI *dsi, uint8_t *buf, size_t count)
{
size_t nbe = 0;
* Note: this may return fewer bytes then requested in count !!
* 3. If the buffer was empty, read from the socket.
*/
-static ssize_t buf_read(DSI *dsi, u_int8_t *buf, size_t count)
+static ssize_t buf_read(DSI *dsi, uint8_t *buf, size_t count)
{
ssize_t len;
* Get "length" bytes from buffer and/or socket. In order to avoid frequent small reads
* this tries to read larger chunks (8192 bytes) into a buffer.
*/
-static size_t dsi_buffered_stream_read(DSI *dsi, u_int8_t *data, const size_t length)
+static size_t dsi_buffered_stream_read(DSI *dsi, uint8_t *data, const size_t length)
{
size_t len;
size_t buflen;
return -1;
while (written < length) {
- len = send(dsi->socket, (u_int8_t *) data + written, length - written, flags);
+ len = send(dsi->socket, (uint8_t *) data + written, length - written, flags);
if (len >= 0) {
written += len;
continue;
stored = 0;
while (stored < length) {
- len = buf_read(dsi, (u_int8_t *) data + stored, length - stored);
+ len = buf_read(dsi, (uint8_t *) data + stored, length - stored);
if (len == -1 && (errno == EINTR || errno == EAGAIN)) {
LOG(log_maxdebug, logtype_dsi, "dsi_stream_read: select read loop");
continue;
return 0;
/* read in the header */
- if (dsi_buffered_stream_read(dsi, (u_int8_t *)block, sizeof(block)) != sizeof(block))
+ if (dsi_buffered_stream_read(dsi, (uint8_t *)block, sizeof(block)) != sizeof(block))
return 0;
dsi->header.dsi_flags = block[0];
if (0 == (pid = fork()) ) { /* child */
static struct itimerval timer = {{0, 0}, {DSI_TCPTIMEOUT, 0}};
struct sigaction newact, oldact;
- u_int8_t block[DSI_BLOCKSIZ];
+ uint8_t block[DSI_BLOCKSIZ];
size_t stored;
/* Immediateyl mark globally that we're a child now */
int dsi_tickle(DSI *dsi)
{
char block[DSI_BLOCKSIZ];
- u_int16_t id;
+ uint16_t id;
if ((dsi->flags & DSI_SLEEPING) || dsi->in_write)
return 1;
#define __location__ __FILE__ ":" __LINESTR__
#endif
+#include <atalk/util.h>
#include "atalk/tdb.h"
/* #define TDB_TRACE 1 */
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
#define IVALS(buf,pos) ((int32_t)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val)))
+#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16_t)(val)))
+#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32_t)(val)))
#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val)))
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
#define IVALS(buf,pos) ((int32_t)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((u_int16_t)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((u_int32_t)(val)))
+#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16_t)(val)))
+#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32_t)(val)))
#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32_t)(val)))
*/
/* get single value from an SMB buffer */
-#define SVAL(buf,pos) (*(const u_int16_t *)((const char *)(buf) + (pos)))
-#define SVAL_NC(buf,pos) (*(u_int16_t *)((char *)(buf) + (pos))) /* Non const version of above. */
-#define IVAL(buf,pos) (*(const u_int32_t *)((const char *)(buf) + (pos)))
-#define IVAL_NC(buf,pos) (*(u_int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */
+#define SVAL(buf,pos) (*(const uint16_t *)((const char *)(buf) + (pos)))
+#define SVAL_NC(buf,pos) (*(uint16_t *)((char *)(buf) + (pos))) /* Non const version of above. */
+#define IVAL(buf,pos) (*(const uint32_t *)((const char *)(buf) + (pos)))
+#define IVAL_NC(buf,pos) (*(uint32_t *)((char *)(buf) + (pos))) /* Non const version of above. */
#define SVALS(buf,pos) (*(const int16_t *)((const char *)(buf) + (pos)))
#define SVALS_NC(buf,pos) (*(int16 *)((char *)(buf) + (pos))) /* Non const version of above. */
#define IVALS(buf,pos) (*(const int32_t *)((const char *)(buf) + (pos)))
#define IVALS_NC(buf,pos) (*(int32_t *)((char *)(buf) + (pos))) /* Non const version of above. */
/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((u_int16_t)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((u_int32_t)(val))
+#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16_t)(val))
+#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32_t)(val))
#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val))
#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32_t)(val))
* for e.g. HFS cdroms.
*/
-static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags)
+static size_t pull_charset_flags (charset_t from_set, charset_t cap_set, const char *src, size_t srclen, char* dest, size_t destlen, uint16_t *flags)
{
- const u_int16_t option = (flags ? *flags : 0);
+ const uint16_t option = (flags ? *flags : 0);
size_t i_len, o_len;
size_t j = 0;
const char* inbuf = (const char*)src;
*/
-static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, u_int16_t *flags)
+static size_t push_charset_flags (charset_t to_set, charset_t cap_set, char* src, size_t srclen, char* dest, size_t destlen, uint16_t *flags)
{
- const u_int16_t option = (flags ? *flags : 0);
+ const uint16_t option = (flags ? *flags : 0);
size_t i_len, o_len, i;
size_t j = 0;
const char* inbuf = (const char*)src;
* FIXME the size is a mess we really need a malloc/free logic
*`dest size must be dest_len +2
*/
-size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, u_int16_t *flags)
+size_t convert_charset ( charset_t from_set, charset_t to_set, charset_t cap_charset, const char *src, size_t src_len, char *dest, size_t dest_len, uint16_t *flags)
{
size_t i_len, o_len;
ucs2_t *u;
return n;
}
-size_t cjk_generic_push(size_t (*char_func)(u_int8_t*, const ucs2_t*, size_t*),
+size_t cjk_generic_push(size_t (*char_func)(uint8_t*, const ucs2_t*, size_t*),
void *cd, char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
char *in = *inbuf;
while (*inbytesleft >= sizeof(ucs2_t) && *outbytesleft > 0) {
- u_int8_t buf[CJK_PUSH_BUFFER];
+ uint8_t buf[CJK_PUSH_BUFFER];
size_t size = *inbytesleft / sizeof(ucs2_t);
size_t n = (char_func)(buf, (const ucs2_t*)in, &size);
if (n == 0) {
return 0;
}
-size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const u_int8_t*, size_t*),
+size_t cjk_generic_pull(size_t (*char_func)(ucs2_t*, const uint8_t*, size_t*),
void *cd, char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
while (*inbytesleft > 0 && *outbytesleft >= sizeof(ucs2_t)) {
ucs2_t buf[CJK_PULL_BUFFER];
size_t size = *inbytesleft;
- size_t n = (char_func)(buf, (const u_int8_t*)in, &size);
+ size_t n = (char_func)(buf, (const uint8_t*)in, &size);
if (n == 0) {
in += size;
*inbytesleft -= size;
return 0;
}
-size_t cjk_char_push(u_int16_t c, u_int8_t *out)
+size_t cjk_char_push(uint16_t c, uint8_t *out)
{
if (!c) return 0;
- if (c == (u_int16_t)-1) {
+ if (c == (uint16_t)-1) {
errno = EILSEQ;
return (size_t)-1;
}
if (c <= 0xff) {
- out[0] = (u_int8_t)c;
+ out[0] = (uint8_t)c;
return 1;
}
- out[0] = (u_int8_t)(c >> 8);
- out[1] = (u_int8_t)c;
+ out[0] = (uint8_t)(c >> 8);
+ out[1] = (uint8_t)c;
return 2;
}
-size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const u_int32_t* compose)
+size_t cjk_char_pull(ucs2_t wc, ucs2_t* out, const uint32_t* compose)
{
if (!wc) return 0;
if ((wc & 0xf000) == 0xe000) {
ucs2_t buf[CJK_PULL_BUFFER];
size_t i = sizeof(buf) / sizeof(*buf) - 1;
do {
- u_int32_t v = compose[wc & 0xfff];
+ uint32_t v = compose[wc & 0xfff];
buf[i] = (ucs2_t)v;
wc = (ucs2_t)(v >> 16);
} while (--i && (wc & 0xf000) == 0xe000);
return 1;
}
-u_int16_t cjk_lookup(u_int16_t c, const cjk_index_t *index, const u_int16_t *charset)
+uint16_t cjk_lookup(uint16_t c, const cjk_index_t *index, const uint16_t *charset)
{
while (index->summary && c >= index->range[0]) {
if (c <= index->range[1]) {
- const u_int16_t* summary = index->summary[(c - index->range[0]) >> 4];
- u_int16_t used = 1 << (c & 15);
+ const uint16_t* summary = index->summary[(c - index->range[0]) >> 4];
+ uint16_t used = 1 << (c & 15);
if (summary[0] & used) {
used = summary[0] & (used - 1);
return 0;
}
-ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const u_int32_t* table, size_t size)
+ucs2_t cjk_compose(ucs2_t base, ucs2_t comb, const uint32_t* table, size_t size)
{
- u_int32_t v = ((u_int32_t)base << 16) | comb;
+ uint32_t v = ((uint32_t)base << 16) | comb;
size_t low = 0;
while (size > low) {
size_t n = (low + size) / 2;
return 0;
}
-ucs2_t cjk_compose_seq(const ucs2_t* in, size_t* len, const u_int32_t* table, size_t size)
+ucs2_t cjk_compose_seq(const ucs2_t* in, size_t* len, const uint32_t* table, size_t size)
{
- static u_int8_t sz[] = { 3, 4, 5, 5, 5, 5, 5, 3 };
+ static uint8_t sz[] = { 3, 4, 5, 5, 5, 5, 5, 3 };
ucs2_t wc = in[0];
size_t n = sz[wc & 7];
size_t i = 0;
#define CJK_PULL_BUFFER 8
typedef struct {
- u_int16_t range[2];
- const u_int16_t (*summary)[2];
+ uint16_t range[2];
+ const uint16_t (*summary)[2];
} cjk_index_t;
-extern size_t cjk_generic_push (size_t (*)(u_int8_t*, const ucs2_t*, size_t*),
+extern size_t cjk_generic_push (size_t (*)(uint8_t*, const ucs2_t*, size_t*),
void*, char**, size_t*, char**, size_t*);
-extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const u_int8_t*, size_t*),
+extern size_t cjk_generic_pull (size_t (*)(ucs2_t*, const uint8_t*, size_t*),
void*, char**, size_t*, char**, size_t*);
-extern size_t cjk_char_push (u_int16_t, u_int8_t*);
-extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const u_int32_t*);
+extern size_t cjk_char_push (uint16_t, uint8_t*);
+extern size_t cjk_char_pull (ucs2_t, ucs2_t*, const uint32_t*);
-extern u_int16_t cjk_lookup (u_int16_t, const cjk_index_t*, const u_int16_t*);
-extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const u_int32_t*, size_t);
-extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const u_int32_t*, size_t);
+extern uint16_t cjk_lookup (uint16_t, const cjk_index_t*, const uint16_t*);
+extern ucs2_t cjk_compose (ucs2_t, ucs2_t, const uint32_t*, size_t);
+extern ucs2_t cjk_compose_seq (const ucs2_t*, size_t*, const uint32_t*, size_t);
NULL, NULL
};
-static size_t mac_chinese_simp_char_push(u_int8_t* out, const ucs2_t* in, size_t* size)
+static size_t mac_chinese_simp_char_push(uint8_t* out, const ucs2_t* in, size_t* size)
{
ucs2_t wc = in[0];
if (wc <= 0x7f) {
*size = 1;
- out[0] = (u_int8_t)wc;
+ out[0] = (uint8_t)wc;
return 1;
} else if ((wc & 0xf000) == 0xe000) {
*size = 1;
return 0;
} else if (*size >= 2 && (in[1] & ~15) == 0xf870) {
ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_simp_compose,
- sizeof(mac_chinese_simp_compose) / sizeof(u_int32_t));
+ sizeof(mac_chinese_simp_compose) / sizeof(uint32_t));
if (comp) {
wc = comp;
*size = 2;
cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
-static size_t mac_chinese_simp_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size)
+static size_t mac_chinese_simp_char_pull(ucs2_t* out, const uint8_t* in, size_t* size)
{
- u_int16_t c = in[0];
+ uint16_t c = in[0];
if (c <= 0x7f) {
*size = 1;
return 1;
} else if (c >= 0xa1 && c <= 0xfc) {
if (*size >= 2) {
- u_int8_t c2 = in[1];
+ uint8_t c2 = in[1];
if (c2 >= 0xa1 && c2 <= 0xfe) {
*size = 2;
* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/
*/
-static const u_int16_t mac_chinese_simp_uni2_page00[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page00[][2] = {
/* 0x00a */ { 0x022d, 0 }, { 0x0080, 5 },
/* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x010 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x024 */ { 0x0000, 0 }, { 0x0002, 9 }, { 0x0002, 10 },
};
-static const u_int16_t mac_chinese_simp_uni2_page1e[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page1e[][2] = {
/* 0x1e3 */ { 0x8000, 11 },
};
-static const u_int16_t mac_chinese_simp_uni2_page20[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page20[][2] = {
/* 0x201 */ { 0x0070, 12 }, { 0x0040, 15 }, { 0x4000, 16 },
};
-static const u_int16_t mac_chinese_simp_uni2_page21[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page21[][2] = {
/* 0x212 */ { 0x0004, 17 },
};
-static const u_int16_t mac_chinese_simp_uni2_page22[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page22[][2] = {
/* 0x22e */ { 0x8000, 18 },
};
-static const u_int16_t mac_chinese_simp_uni2_page30[][2] = {
+static const uint16_t mac_chinese_simp_uni2_page30[][2] = {
/* 0x301 */ { 0x1000, 19 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x308 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0800, 20 },
};
-static const u_int16_t mac_chinese_simp_uni2_pagee0[][2] = {
+static const uint16_t mac_chinese_simp_uni2_pagee0[][2] = {
/* 0xe00 */ { 0x07ff, 21 },
};
-static const u_int16_t mac_chinese_simp_uni2_pagef8[][2] = {
+static const uint16_t mac_chinese_simp_uni2_pagef8[][2] = {
/* 0xf88 */ { 0x0003, 32 },
};
-static const u_int16_t mac_chinese_simp_uni2_pagefe[][2] = {
+static const uint16_t mac_chinese_simp_uni2_pagefe[][2] = {
/* 0xfe3 */ { 0xfffa, 34 }, { 0x001f, 48 },
};
-static const u_int16_t mac_chinese_simp_uni2_pageff[][2] = {
+static const uint16_t mac_chinese_simp_uni2_pageff[][2] = {
/* 0xff5 */ { 0x4000, 53 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xff8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xffc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x002b, 54 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_chinese_simp_uni2_charset[] = {
+static const uint16_t mac_chinese_simp_uni2_charset[] = {
0x00a0, 0xa1e9, 0xa1ea, 0xa3a4, 0x00fd, 0xa1a4, 0xa8bd, 0xa8be,
0xa8bf, 0xa8bb, 0xa8c0, 0xa8bc, 0xa1aa, 0xffff, 0xa1ac, 0x00ff,
0xa3fe, 0x00fe, 0xa1ad, 0xa1ab, 0xffff, 0x0080, 0xa6f3, 0xa6db,
0xffff, 0xffff,
};
-static const u_int16_t mac_chinese_simp_2uni_page00[][2] = {
+static const uint16_t mac_chinese_simp_2uni_page00[][2] = {
/* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 },
/* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 },
};
-static const u_int16_t mac_chinese_simp_2uni_pagea1[][2] = {
+static const uint16_t mac_chinese_simp_2uni_pagea1[][2] = {
/* 0xa1a */ { 0x3c10, 7 }, { 0x0000, 0 },
/* 0xa1c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0600, 12 },
};
-static const u_int16_t mac_chinese_simp_2uni_pagea3[][2] = {
+static const uint16_t mac_chinese_simp_2uni_pagea3[][2] = {
/* 0xa3a */ { 0x0010, 14 }, { 0x0000, 0 },
/* 0xa3c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4000, 15 },
};
-static const u_int16_t mac_chinese_simp_2uni_pagea6[][2] = {
+static const uint16_t mac_chinese_simp_2uni_pagea6[][2] = {
/* 0xa6d */ { 0xfe00, 16 }, { 0xffff, 23 }, { 0x003f, 39 },
};
-static const u_int16_t mac_chinese_simp_2uni_pagea8[][2] = {
+static const uint16_t mac_chinese_simp_2uni_pagea8[][2] = {
/* 0xa8b */ { 0xf800, 45 }, { 0x0001, 50 },
};
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_chinese_simp_2uni_charset[] = {
+static const uint16_t mac_chinese_simp_2uni_charset[] = {
0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7,
0x2014, 0x301c, 0x2016, 0x22ef, 0x00a2, 0x00a3, 0x00a5, 0x203e,
0xe007, 0xe003, 0xe002, 0xe008, 0xe009, 0xe006, 0xe00a, 0xfe35,
0x0148, 0x01f9, 0x0261,
};
-static const u_int32_t mac_chinese_simp_compose[] = {
+static const uint32_t mac_chinese_simp_compose[] = {
0x00fcf87f, 0x22eff87e, 0x3001f87e, 0x3002f87e,
0x3016f87e, 0x3017f87e, 0xff01f87e, 0xff0cf87e,
0xff1af87e, 0xff1bf87e, 0xff1ff87e,
NULL, NULL
};
-static size_t mac_chinese_trad_char_push(u_int8_t* out, const ucs2_t* in, size_t* size)
+static size_t mac_chinese_trad_char_push(uint8_t* out, const ucs2_t* in, size_t* size)
{
ucs2_t wc = in[0];
out[0] = 0x80;
} else {
*size = 1;
- out[0] = (u_int8_t)wc;
+ out[0] = (uint8_t)wc;
}
return 1;
} else if ((wc & 0xf000) == 0xe000) {
return 0;
} else if (*size >= 2 && (in[1] & ~15) == 0xf870) {
ucs2_t comp = cjk_compose(wc, in[1], mac_chinese_trad_compose,
- sizeof(mac_chinese_trad_compose) / sizeof(u_int32_t));
+ sizeof(mac_chinese_trad_compose) / sizeof(uint32_t));
if (comp) {
wc = comp;
*size = 2;
cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
-static size_t mac_chinese_trad_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size)
+static size_t mac_chinese_trad_char_pull(ucs2_t* out, const uint8_t* in, size_t* size)
{
- u_int16_t c = in[0];
+ uint16_t c = in[0];
if (c <= 0x7f) {
*size = 1;
return 1;
} else if (c >= 0xa1 && c <= 0xfc) {
if (*size >= 2) {
- u_int8_t c2 = in[1];
+ uint8_t c2 = in[1];
if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0xa1 && c2 <= 0xfe)) {
*size = 2;
* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/
*/
-static const u_int16_t mac_chinese_trad_uni2_page00[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page00[][2] = {
/* 0x00a */ { 0x0201, 0 }, { 0x0080, 2 },
};
-static const u_int16_t mac_chinese_trad_uni2_page20[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page20[][2] = {
/* 0x202 */ { 0x0044, 3 },
};
-static const u_int16_t mac_chinese_trad_uni2_page21[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page21[][2] = {
/* 0x212 */ { 0x0004, 5 },
};
-static const u_int16_t mac_chinese_trad_uni2_page22[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page22[][2] = {
/* 0x229 */ { 0x0020, 6 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x22c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 7 },
};
-static const u_int16_t mac_chinese_trad_uni2_page25[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page25[][2] = {
/* 0x259 */ { 0x0020, 8 },
};
-static const u_int16_t mac_chinese_trad_uni2_page26[][2] = {
+static const uint16_t mac_chinese_trad_uni2_page26[][2] = {
/* 0x264 */ { 0x0002, 9 },
};
-static const u_int16_t mac_chinese_trad_uni2_pagee0[][2] = {
+static const uint16_t mac_chinese_trad_uni2_pagee0[][2] = {
/* 0xe00 */ { 0xffff, 10 }, { 0x00ff, 26 },
};
-static const u_int16_t mac_chinese_trad_uni2_pagef8[][2] = {
+static const uint16_t mac_chinese_trad_uni2_pagef8[][2] = {
/* 0xf88 */ { 0x0003, 34 },
};
-static const u_int16_t mac_chinese_trad_uni2_pagefe[][2] = {
+static const uint16_t mac_chinese_trad_uni2_pagefe[][2] = {
/* 0xfe4 */ { 0x1000, 36 }, { 0x7ef5, 37 },
};
-static const u_int16_t mac_chinese_trad_uni2_pageff[][2] = {
+static const uint16_t mac_chinese_trad_uni2_pageff[][2] = {
/* 0xff6 */ { 0x0010, 49 },
};
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_chinese_trad_uni2_charset[] = {
+static const uint16_t mac_chinese_trad_uni2_charset[] = {
0x00a0, 0x00fd, 0xa145, 0xffff, 0x00ff, 0x00fe, 0xa1f2, 0xa14b,
0xffff, 0xffff, 0x0080, 0xa1c3, 0xa279, 0xa14e, 0xa1a3, 0xa1a4,
0xa2cc, 0xa2ce, 0xa1cb, 0xa154, 0xa17d, 0xa17e, 0xa14d, 0xa14f,
0xffff, 0xffff,
};
-static const u_int16_t mac_chinese_trad_2uni_page00[][2] = {
+static const uint16_t mac_chinese_trad_2uni_page00[][2] = {
/* 0x008 */ { 0x0007, 0 }, { 0x0000, 0 }, { 0x0001, 3 }, { 0x0000, 0 },
/* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 4 },
};
-static const u_int16_t mac_chinese_trad_2uni_pagea1[][2] = {
+static const uint16_t mac_chinese_trad_2uni_pagea1[][2] = {
/* 0xa14 */ { 0xe820, 7 }, { 0x041f, 12 }, { 0x0000, 0 }, { 0x6000, 18 },
/* 0xa18 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x001e, 20 }, { 0x0000, 0 },
/* 0xa1c */ { 0x0828, 24 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x4004, 27 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_chinese_trad_2uni_charset[] = {
+static const uint16_t mac_chinese_trad_2uni_charset[] = {
0xe000, 0xf880, 0xf881, 0x00a0, 0x00a9, 0x2122, 0x2026, 0x00b7,
0x22ef, 0xe00c, 0xe003, 0xe00d, 0xe00e, 0xe011, 0xe010, 0xe012,
0xe009, 0xe015, 0xe00a, 0xe00b, 0xe016, 0xe017, 0xe004, 0xe005,
0xe007,
};
-static const u_int32_t mac_chinese_trad_compose[] = {
+static const uint32_t mac_chinese_trad_compose[] = {
0x005cf87f, 0x203ef87c, 0x2502f87f, 0x3001f87d,
0x3014f87f, 0x3015f87f, 0x5341f87f, 0x5345f87f,
0xfe4bf87c, 0xff01f87d, 0xff08f87f, 0xff09f87f,
NULL, NULL
};
-static size_t mac_japanese_char_push(u_int8_t* out, const ucs2_t* in, size_t* size)
+static size_t mac_japanese_char_push(uint8_t* out, const ucs2_t* in, size_t* size)
{
ucs2_t wc = in[0];
if (wc <= 0x7f) {
*size = 1;
- out[0] = (u_int8_t)(wc == 0x5c ? 0x80 : wc);
+ out[0] = (uint8_t)(wc == 0x5c ? 0x80 : wc);
return 1;
} else if ((wc & 0xf000) == 0xe000) { /* user defined */
*size = 1;
if (wc > 0xe98b) return 0;
wc -= 0xe000;
- out[0] = (u_int8_t)(wc / 188 + 0xf0);
- out[1] = (u_int8_t)(wc % 188 + 0x40);
+ out[0] = (uint8_t)(wc / 188 + 0xf0);
+ out[1] = (uint8_t)(wc % 188 + 0x40);
if (out[1] >= 0x7f) ++out[1];
return 2;
} else if ((wc & ~7) == 0xf860) {
wc = cjk_compose_seq(in, size, mac_japanese_compose,
- sizeof(mac_japanese_compose) / sizeof(u_int32_t));
+ sizeof(mac_japanese_compose) / sizeof(uint32_t));
if (!wc) return (size_t)-1;
} else if (*size >= 2 && ((in[1] & ~15) == 0xf870 || in[1] == 0x20dd)) {
ucs2_t comp = cjk_compose(wc, in[1], mac_japanese_compose,
- sizeof(mac_japanese_compose) / sizeof(u_int32_t));
+ sizeof(mac_japanese_compose) / sizeof(uint32_t));
if (comp) {
wc = comp;
*size = 2;
cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
-static size_t mac_japanese_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size)
+static size_t mac_japanese_char_pull(ucs2_t* out, const uint8_t* in, size_t* size)
{
- u_int16_t c = in[0];
+ uint16_t c = in[0];
if (c <= 0x7f) {
*size = 1;
return 1;
} else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) {
if (*size >= 2) {
- u_int8_t c2 = in[1];
+ uint8_t c2 = in[1];
if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0x80 && c2 <= 0xfc)) {
*size = 2;
* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/
*/
-static const u_int16_t mac_japanese_uni2_page00[][2] = {
+static const uint16_t mac_japanese_uni2_page00[][2] = {
/* 0x00a */ { 0x0201, 1 },
};
-static const u_int16_t mac_japanese_uni2_page20[][2] = {
+static const uint16_t mac_japanese_uni2_page20[][2] = {
/* 0x201 */ { 0x0030, 3 }, { 0x0000, 0 }, { 0x4000, 5 },
/* 0x204 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x228 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 44 },
};
-static const u_int16_t mac_japanese_uni2_page24[][2] = {
+static const uint16_t mac_japanese_uni2_page24[][2] = {
/* 0x246 */ { 0xffff, 45 }, { 0xffff, 61 },
/* 0x248 */ { 0xffff, 77 }, { 0xf001, 93 }, { 0xffff, 98 }, { 0x003f, 114 },
};
-static const u_int16_t mac_japanese_uni2_page26[][2] = {
+static const uint16_t mac_japanese_uni2_page26[][2] = {
/* 0x260 */ { 0x4000, 120 }, { 0xf000, 121 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x264 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x00ff, 125 }, { 0x0000, 0 },
/* 0x268 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x274 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x7fc0, 133 },
};
-static const u_int16_t mac_japanese_uni2_page30[][2] = {
+static const uint16_t mac_japanese_uni2_page30[][2] = {
/* 0x300 */ { 0x0010, 142 }, { 0xa000, 143 }, { 0x0001, 145 }, { 0x0000, 0 },
/* 0x304 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x308 */ { 0x0000, 0 }, { 0x0010, 146 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x30c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0780, 147 },
};
-static const u_int16_t mac_japanese_uni2_page32[][2] = {
+static const uint16_t mac_japanese_uni2_page32[][2] = {
/* 0x322 */ { 0xfc00, 151 }, { 0xffff, 157 },
/* 0x324 */ { 0x000d, 173 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x328 */ { 0x0000, 0 }, { 0x6340, 176 }, { 0x03f0, 181 }, { 0x0000, 0 },
/* 0x33c */ { 0x2810, 242 }, { 0x0010, 245 },
};
-static const u_int16_t mac_japanese_uni2_pagee0[][2] = {
+static const uint16_t mac_japanese_uni2_pagee0[][2] = {
/* 0xe00 */ { 0xffff, 246 }, { 0xffff, 262 }, { 0x0fff, 278 }, { 0x001f, 290 },
/* 0xe04 */ { 0x7f00, 295 },
};
-static const u_int16_t mac_japanese_uni2_pagefe[][2] = {
+static const uint16_t mac_japanese_uni2_pagefe[][2] = {
/* 0xfe3 */ { 0xffeb, 302 },
/* 0xfe4 */ { 0x001f, 316 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_japanese_uni2_charset[] = {
+static const uint16_t mac_japanese_uni2_charset[] = {
0x0080, 0x00a0, 0x00fd, 0x815c, 0xffff, 0xffff, 0x8656, 0x8650,
0x869b, 0x869d, 0x00fe, 0x859f, 0x85a0, 0x85a1, 0x85a2, 0x85a3,
0x85a4, 0x85a5, 0x85a6, 0x85a7, 0x85a8, 0x85a9, 0x85aa, 0x85b3,
0xeb78, 0x815f,
};
-static const u_int16_t mac_japanese_2uni_page00[][2] = {
+static const uint16_t mac_japanese_2uni_page00[][2] = {
/* 0x008 */ { 0x0001, 0 }, { 0x0000, 0 }, { 0x0001, 1 }, { 0x0000, 0 },
/* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xe000, 2 },
};
-static const u_int16_t mac_japanese_2uni_page81[][2] = {
+static const uint16_t mac_japanese_2uni_page81[][2] = {
/* 0x815 */ { 0x9000, 5 },
};
-static const u_int16_t mac_japanese_2uni_page85[][2] = {
+static const uint16_t mac_japanese_2uni_page85[][2] = {
/* 0x854 */ { 0xffff, 7 }, { 0xc00f, 23 }, { 0xffff, 29 }, { 0x7003, 45 },
/* 0x858 */ { 0x003f, 50 }, { 0x87fe, 56 }, { 0x3fff, 67 }, { 0xfff8, 81 },
/* 0x85c */ { 0x0003, 94 }, { 0xf800, 96 }, { 0xffff, 101 }, { 0x001f, 117 },
/* 0x884 */ { 0x0007, 257 }, { 0x0030, 260 }, { 0x3d00, 262 },
};
-static const u_int16_t mac_japanese_2uni_pageeb[][2] = {
+static const uint16_t mac_japanese_2uni_pageeb[][2] = {
/* 0xeb4 */ { 0x0006, 267 }, { 0x3803, 269 }, { 0xfe1f, 274 }, { 0x07ff, 286 },
/* 0xeb8 */ { 0x0002, 297 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xebc */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_japanese_2uni_charset[] = {
+static const uint16_t mac_japanese_2uni_charset[] = {
0x005c, 0x00a0, 0x00a9, 0x2122, 0xe003, 0x2014, 0xff3c, 0x2460,
0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, 0x2468,
0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, 0x2470,
0xe019, 0xe01a, 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f, 0xe020,
};
-static const u_int32_t mac_japanese_compose[] = {
+static const uint32_t mac_japanese_compose[] = {
0x2010f87e, 0x2016f87e, 0x2026f87e, 0x2026f87f,
0x21e6f87a, 0x21e7f87a, 0x21e8f87a, 0x21e9f87a,
0x3001f87e, 0x3002f87e, 0x301cf87e, 0x3041f87e,
NULL, NULL
};
-static size_t mac_korean_char_push(u_int8_t* out, const ucs2_t* in, size_t* size)
+static size_t mac_korean_char_push(uint8_t* out, const ucs2_t* in, size_t* size)
{
ucs2_t wc = in[0];
if ((wc & ~7) == 0xf860) {
wc = cjk_compose_seq(in, size, mac_korean_compose,
- sizeof(mac_korean_compose) / sizeof(u_int32_t));
+ sizeof(mac_korean_compose) / sizeof(uint32_t));
if (!wc) return (size_t)-1;
} else if ((wc & 0xf000) == 0xe000) {
*size = 1;
(comb >= 0x0300 && comb <= 0x036f) ||
(comb >= 0x20d0 && comb <= 0x20ea)) {
ucs2_t comp = cjk_compose(wc, comb, mac_korean_compose,
- sizeof(mac_korean_compose) / sizeof(u_int32_t));
+ sizeof(mac_korean_compose) / sizeof(uint32_t));
if (!comp) break;
wc = comp;
if (++n == *size) break;
*size = 1;
}
if (wc <= 0x7f) {
- out[0] = (u_int8_t)wc;
+ out[0] = (uint8_t)wc;
return 1;
}
return cjk_char_push(cjk_lookup(wc, mac_korean_uni2_index,
cd, inbuf, inbytesleft, outbuf, outbytesleft);
}
-static size_t mac_korean_char_pull(ucs2_t* out, const u_int8_t* in, size_t* size)
+static size_t mac_korean_char_pull(ucs2_t* out, const uint8_t* in, size_t* size)
{
- u_int16_t c = in[0];
+ uint16_t c = in[0];
if (c <= 0x7f) {
*size = 1;
return 1;
} else if (c >= 0xa1 && c <= 0xfe) {
if (*size >= 2) {
- u_int8_t c2 = in[1];
+ uint8_t c2 = in[1];
if ((c2 >= 0x41 && c2 <= 0x7d) || (c2 >= 0x81 && c2 <= 0xfe)) {
*size = 2;
c = (c << 8) + c2;
* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/
*/
-static const u_int16_t mac_korean_uni2_page00[][2] = {
+static const uint16_t mac_korean_uni2_page00[][2] = {
/* 0x00a */ { 0x7a2d, 0 }, { 0x0880, 9 },
};
-static const u_int16_t mac_korean_uni2_page02[][2] = {
+static const uint16_t mac_korean_uni2_page02[][2] = {
/* 0x02b */ { 0x1000, 11 },
/* 0x02c */ { 0x0000, 0 }, { 0x1001, 12 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x030 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x03c */ { 0x0000, 0 }, { 0x0020, 14 },
};
-static const u_int16_t mac_korean_uni2_page20[][2] = {
+static const uint16_t mac_korean_uni2_page20[][2] = {
/* 0x201 */ { 0x8878, 15 }, { 0x0004, 21 }, { 0x5670, 22 },
/* 0x204 */ { 0x7284, 29 }, { 0x0002, 35 }, { 0x0000, 0 }, { 0x7c00, 36 },
/* 0x208 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x1200, 41 }, { 0x0000, 0 },
/* 0x230 */ { 0x0040, 118 }, { 0x0010, 119 },
};
-static const u_int16_t mac_korean_uni2_page24[][2] = {
+static const uint16_t mac_korean_uni2_page24[][2] = {
/* 0x246 */ { 0x8000, 120 }, { 0x000f, 121 },
/* 0x248 */ { 0x00f8, 125 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0xffc0, 130 },
/* 0x24c */ { 0xffff, 140 }, { 0x0000, 0 }, { 0xf800, 156 }, { 0x001f, 161 },
/* 0x278 */ { 0xfc00, 210 }, { 0x581f, 216 }, { 0x0012, 224 }, { 0x0024, 226 },
};
-static const u_int16_t mac_korean_uni2_page29[][2] = {
+static const uint16_t mac_korean_uni2_page29[][2] = {
/* 0x293 */ { 0x02f0, 228 },
/* 0x294 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x003c, 233 }, { 0x0000, 0 },
/* 0x298 */ { 0x0062, 237 }, { 0x0180, 240 }, { 0x0008, 242 }, { 0xc000, 243 },
/* 0x2ac */ { 0x1860, 253 }, { 0x0000, 0 }, { 0x0100, 257 },
};
-static const u_int16_t mac_korean_uni2_page30[][2] = {
+static const uint16_t mac_korean_uni2_page30[][2] = {
/* 0x301 */ { 0xd3c4, 258 }, { 0x0001, 266 }, { 0x0040, 267 },
};
-static const u_int16_t mac_korean_uni2_page32[][2] = {
+static const uint16_t mac_korean_uni2_page32[][2] = {
/* 0x323 */ { 0x0202, 268 },
/* 0x324 */ { 0x0000, 0 }, { 0x07fe, 270 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x328 */ { 0xfc00, 280 }, { 0x4011, 286 }, { 0x0020, 289 },
};
-static const u_int16_t mac_korean_uni2_page33[][2] = {
+static const uint16_t mac_korean_uni2_page33[][2] = {
/* 0x33c */ { 0x0800, 290 },
};
-static const u_int16_t mac_korean_uni2_pagee0[][2] = {
+static const uint16_t mac_korean_uni2_pagee0[][2] = {
/* 0xe00 */ { 0xffff, 291 }, { 0xffff, 307 }, { 0xffff, 323 }, { 0xffff, 339 },
/* 0xe04 */ { 0xffff, 355 }, { 0xffff, 371 }, { 0xffff, 387 }, { 0xffff, 403 },
/* 0xe08 */ { 0xffff, 419 }, { 0xffff, 435 }, { 0xffff, 451 }, { 0xffff, 467 },
/* 0xe40 */ { 0x0000, 0 }, { 0x1ffc, 1126 },
};
-static const u_int16_t mac_korean_uni2_pagef8[][2] = {
+static const uint16_t mac_korean_uni2_pagef8[][2] = {
/* 0xf80 */ { 0x1fe0, 1137 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x2000, 1145 },
/* 0xf84 */ { 0xffff, 1146 },
};
-static const u_int16_t mac_korean_uni2_pagefe[][2] = {
+static const uint16_t mac_korean_uni2_pagefe[][2] = {
/* 0xfe5 */ { 0x0600, 1162 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xfe8 */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0xfec */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_korean_uni2_charset[] = {
+static const uint16_t mac_korean_uni2_charset[] = {
0x0080, 0xa1cb, 0xa1cc, 0xa1cd, 0x0083, 0xa65c, 0xa1fe, 0xffff,
0xffff, 0xa1a4, 0xa65d, 0xa198, 0xa2b0, 0xa2a6, 0xa76a, 0xa1a9,
0xa1aa, 0xffff, 0xa1ab, 0xa170, 0xa16f, 0xa655, 0xa5de, 0xadad,
0xffff, 0xffff,
};
-static const u_int16_t mac_korean_2uni_page00[][2] = {
+static const uint16_t mac_korean_2uni_page00[][2] = {
/* 0x008 */ { 0x001f, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 },
/* 0x00c */ { 0x0000, 0 }, { 0x0000, 0 }, { 0x0000, 0 }, { 0x8000, 5 },
};
-static const u_int16_t mac_korean_2uni_pagea1[][2] = {
+static const uint16_t mac_korean_2uni_pagea1[][2] = {
/* 0xa14 */ { 0xfffe, 6 }, { 0xffff, 21 }, { 0xffff, 37 }, { 0x3fff, 53 },
/* 0xa18 */ { 0xfffe, 67 }, { 0xf7ff, 82 }, { 0x2e11, 97 }, { 0x0000, 0 },
/* 0xa1c */ { 0x3800, 103 }, { 0x0000, 0 }, { 0x3000, 106 }, { 0x4000, 108 },
{ { 0, 0 }, NULL }
};
-static const u_int16_t mac_korean_2uni_charset[] = {
+static const uint16_t mac_korean_2uni_charset[] = {
0x00a0, 0x20a9, 0xe022, 0x00a9, 0xe41c, 0xe02b, 0xe12a, 0xe12e,
0xe128, 0xe12c, 0xe129, 0xe12d, 0xe130, 0xe132, 0xe125, 0xe126,
0xe123, 0xe124, 0xfe59, 0xfe5a, 0xe413, 0xe415, 0xe118, 0xe11e,
0x2036, 0xe02e, 0x2035, 0xe02c, 0xe08d, 0xe001,
};
-static const u_int32_t mac_korean_compose[] = {
+static const uint32_t mac_korean_compose[] = {
0x0021f877, 0x0021f87f, 0x0028f87c, 0x0028f87f,
0x0029f87c, 0x0029f87f, 0x002af877, 0x002d0308,
0x003020de, 0x003120de, 0x003220de, 0x003320de,
http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
*/
-static const u_int16_t upper_table_1[704] = {
+static const uint16_t upper_table_1[704] = {
0x0000, /*U+0000*/ /**/
0x0001, /*U+0001*/ /**/
0x0002, /*U+0002*/ /**/
0x02BF, /*U+02BF*/ /**/
};
-static const u_int16_t upper_table_2[640] = {
+static const uint16_t upper_table_2[640] = {
0x0340, /*U+0340*/ /**/
0x0341, /*U+0341*/ /**/
0x0342, /*U+0342*/ /**/
0x05BF, /*U+05BF*/ /**/
};
-static const u_int16_t upper_table_3[64] = {
+static const uint16_t upper_table_3[64] = {
0x1D40, /*U+1D40*/ /**/
0x1D41, /*U+1D41*/ /**/
0x1D42, /*U+1D42*/ /**/
0x1D7F, /*U+1D7F*/ /**/
};
-static const u_int16_t upper_table_4[512] = {
+static const uint16_t upper_table_4[512] = {
0x1E00, /*U+1E00*/ /**/
0x1E00, /*U+1E01*/ /*LATIN SMALL LETTER A WITH RING BELOW*/
0x1E02, /*U+1E02*/ /**/
0x1FFF, /*U+1FFF*/ /**/
};
-static const u_int16_t upper_table_5[128] = {
+static const uint16_t upper_table_5[128] = {
0x2140, /*U+2140*/ /**/
0x2141, /*U+2141*/ /**/
0x2142, /*U+2142*/ /**/
0x21BF, /*U+21BF*/ /**/
};
-static const u_int16_t upper_table_6[64] = {
+static const uint16_t upper_table_6[64] = {
0x24C0, /*U+24C0*/ /**/
0x24C1, /*U+24C1*/ /**/
0x24C2, /*U+24C2*/ /**/
0x24FF, /*U+24FF*/ /**/
};
-static const u_int16_t upper_table_7[320] = {
+static const uint16_t upper_table_7[320] = {
0x2C00, /*U+2C00*/ /**/
0x2C01, /*U+2C01*/ /**/
0x2C02, /*U+2C02*/ /**/
0x2D3F, /*U+2D3F*/ /**/
};
-static const u_int16_t upper_table_8[128] = {
+static const uint16_t upper_table_8[128] = {
0xA640, /*U+A640*/ /**/
0xA640, /*U+A641*/ /*CYRILLIC SMALL LETTER ZEMLYA*/
0xA642, /*U+A642*/ /**/
0xA6BF, /*U+A6BF*/ /**/
};
-static const u_int16_t upper_table_9[192] = {
+static const uint16_t upper_table_9[192] = {
0xA700, /*U+A700*/ /**/
0xA701, /*U+A701*/ /**/
0xA702, /*U+A702*/ /**/
0xA7BF, /*U+A7BF*/ /**/
};
-static const u_int16_t upper_table_10[64] = {
+static const uint16_t upper_table_10[64] = {
0xFF40, /*U+FF40*/ /**/
0xFF21, /*U+FF41*/ /*FULLWIDTH LATIN SMALL LETTER A*/
0xFF22, /*U+FF42*/ /*FULLWIDTH LATIN SMALL LETTER B*/
0xFF7F, /*U+FF7F*/ /**/
};
-static const u_int32_t upper_table_sp_1[128] = {
+static const uint32_t upper_table_sp_1[128] = {
0xD801DC00, /*0xD801DC00*/ /*U+010400*/ /*U+010400*/ /**/
0xD801DC01, /*0xD801DC01*/ /*U+010401*/ /*U+010401*/ /**/
0xD801DC02, /*0xD801DC02*/ /*U+010402*/ /*U+010402*/ /**/
0xD801DC7F, /*0xD801DC7F*/ /*U+01047F*/ /*U+01047F*/ /**/
};
-static const u_int16_t lower_table_1[128] = {
+static const uint16_t lower_table_1[128] = {
0x0000, /*U+0000*/ /**/
0x0001, /*U+0001*/ /**/
0x0002, /*U+0002*/ /**/
0x007F, /*U+007F*/ /**/
};
-static const u_int16_t lower_table_2[448] = {
+static const uint16_t lower_table_2[448] = {
0x00E0, /*U+00C0*/ /*LATIN CAPITAL LETTER A WITH GRAVE*/
0x00E1, /*U+00C1*/ /*LATIN CAPITAL LETTER A WITH ACUTE*/
0x00E2, /*U+00C2*/ /*LATIN CAPITAL LETTER A WITH CIRCUMFLEX*/
0x027F, /*U+027F*/ /**/
};
-static const u_int16_t lower_table_3[576] = {
+static const uint16_t lower_table_3[576] = {
0x0340, /*U+0340*/ /**/
0x0341, /*U+0341*/ /**/
0x0342, /*U+0342*/ /**/
0x057F, /*U+057F*/ /**/
};
-static const u_int16_t lower_table_4[128] = {
+static const uint16_t lower_table_4[128] = {
0x1080, /*U+1080*/ /**/
0x1081, /*U+1081*/ /**/
0x1082, /*U+1082*/ /**/
0x10FF, /*U+10FF*/ /**/
};
-static const u_int16_t lower_table_5[512] = {
+static const uint16_t lower_table_5[512] = {
0x1E01, /*U+1E00*/ /*LATIN CAPITAL LETTER A WITH RING BELOW*/
0x1E01, /*U+1E01*/ /**/
0x1E03, /*U+1E02*/ /*LATIN CAPITAL LETTER B WITH DOT ABOVE*/
0x1FFF, /*U+1FFF*/ /**/
};
-static const u_int16_t lower_table_6[192] = {
+static const uint16_t lower_table_6[192] = {
0x2100, /*U+2100*/ /**/
0x2101, /*U+2101*/ /**/
0x2102, /*U+2102*/ /**/
0x21BF, /*U+21BF*/ /**/
};
-static const u_int16_t lower_table_7[128] = {
+static const uint16_t lower_table_7[128] = {
0x2480, /*U+2480*/ /**/
0x2481, /*U+2481*/ /**/
0x2482, /*U+2482*/ /**/
0x24FF, /*U+24FF*/ /**/
};
-static const u_int16_t lower_table_8[256] = {
+static const uint16_t lower_table_8[256] = {
0x2C30, /*U+2C00*/ /*GLAGOLITIC CAPITAL LETTER AZU*/
0x2C31, /*U+2C01*/ /*GLAGOLITIC CAPITAL LETTER BUKY*/
0x2C32, /*U+2C02*/ /*GLAGOLITIC CAPITAL LETTER VEDE*/
0x2CFF, /*U+2CFF*/ /**/
};
-static const u_int16_t lower_table_9[128] = {
+static const uint16_t lower_table_9[128] = {
0xA641, /*U+A640*/ /*CYRILLIC CAPITAL LETTER ZEMLYA*/
0xA641, /*U+A641*/ /**/
0xA643, /*U+A642*/ /*CYRILLIC CAPITAL LETTER DZELO*/
0xA6BF, /*U+A6BF*/ /**/
};
-static const u_int16_t lower_table_10[192] = {
+static const uint16_t lower_table_10[192] = {
0xA700, /*U+A700*/ /**/
0xA701, /*U+A701*/ /**/
0xA702, /*U+A702*/ /**/
0xA7BF, /*U+A7BF*/ /**/
};
-static const u_int16_t lower_table_11[64] = {
+static const uint16_t lower_table_11[64] = {
0xFF00, /*U+FF00*/ /**/
0xFF01, /*U+FF01*/ /**/
0xFF02, /*U+FF02*/ /**/
0xFF3F, /*U+FF3F*/ /**/
};
-static const u_int32_t lower_table_sp_1[64] = {
+static const uint32_t lower_table_sp_1[64] = {
0xD801DC28, /*0xD801DC00*/ /*U+010428*/ /*U+010400*/ /*DESERET CAPITAL LETTER LONG I*/
0xD801DC29, /*0xD801DC01*/ /*U+010429*/ /*U+010401*/ /*DESERET CAPITAL LETTER LONG E*/
0xD801DC2A, /*0xD801DC02*/ /*U+01042A*/ /*U+010402*/ /*DESERET CAPITAL LETTER LONG A*/
int min = 0;
int max = PRECOMP_COUNT - 1;
int mid;
- u_int32_t sought = (base << 16) | comb, that;
+ uint32_t sought = (base << 16) | comb, that;
/* binary search */
while (max >= min) {
}
/* ------------------------ */
-static u_int32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp)
+static uint32_t do_precomposition_sp(unsigned int base_sp, unsigned int comb_sp)
{
int min = 0;
int max = PRECOMP_SP_COUNT - 1;
int mid;
- u_int64_t sought_sp = ((u_int64_t)base_sp << 32) | (u_int64_t)comb_sp, that_sp;
+ uint64_t sought_sp = ((uint64_t)base_sp << 32) | (uint64_t)comb_sp, that_sp;
/* binary search */
while (max >= min) {
mid = (min + max) / 2;
- that_sp = ((u_int64_t)precompositions_sp[mid].base_sp << 32) | ((u_int64_t)precompositions_sp[mid].comb_sp);
+ that_sp = ((uint64_t)precompositions_sp[mid].base_sp << 32) | ((uint64_t)precompositions_sp[mid].comb_sp);
if (that_sp < sought_sp) {
min = mid + 1;
} else if (that_sp > sought_sp) {
}
/* -------------------------- */
-static u_int32_t do_decomposition(ucs2_t base)
+static uint32_t do_decomposition(ucs2_t base)
{
int min = 0;
int max = DECOMP_COUNT - 1;
int mid;
- u_int32_t sought = base;
- u_int32_t result, that;
+ uint32_t sought = base;
+ uint32_t result, that;
/* binary search */
while (max >= min) {
}
/* -------------------------- */
-static u_int64_t do_decomposition_sp(unsigned int base_sp)
+static uint64_t do_decomposition_sp(unsigned int base_sp)
{
int min = 0;
int max = DECOMP_SP_COUNT - 1;
int mid;
- u_int32_t sought_sp = base_sp;
- u_int32_t that_sp;
- u_int64_t result_sp;
+ uint32_t sought_sp = base_sp;
+ uint32_t that_sp;
+ uint64_t result_sp;
/* binary search */
while (max >= min) {
} else if (that_sp > sought_sp) {
max = mid - 1;
} else {
- result_sp = ((u_int64_t)decompositions_sp[mid].base_sp << 32) | ((u_int64_t)decompositions_sp[mid].comb_sp);
+ result_sp = ((uint64_t)decompositions_sp[mid].base_sp << 32) | ((uint64_t)decompositions_sp[mid].comb_sp);
return result_sp;
}
}
{
size_t i;
ucs2_t base, comb;
- u_int32_t base_sp, comb_sp;
+ uint32_t base_sp, comb_sp;
ucs2_t *in, *out;
ucs2_t lindex, vindex;
ucs2_t result;
- u_int32_t result_sp;
+ uint32_t result_sp;
size_t o_len = *outlen;
if (!inplen || (inplen & 1) || inplen > o_len)
/* Binary Search for Surrogate Pair */
else if ((0xD800 <= base) && (base < 0xDC00)) {
if ((0xDC00 <= comb) && (comb < 0xE000) && (i + 4 <= inplen)) {
- base_sp = ((u_int32_t)base << 16) | (u_int32_t)comb;
+ base_sp = ((uint32_t)base << 16) | (uint32_t)comb;
do {
- comb_sp = ((u_int32_t)in[1] << 16) | (u_int32_t)in[2];
+ comb_sp = ((uint32_t)in[1] << 16) | (uint32_t)in[2];
if (result_sp = do_precomposition_sp(base_sp, comb_sp)) {
base_sp = result_sp;
i += 4;
size_t i;
size_t comblen;
ucs2_t base, comb[COMBBUFLEN];
- u_int32_t base_sp;
+ uint32_t base_sp;
ucs2_t sindex, tjamo;
ucs2_t *in, *out;
unsigned int result;
- u_int64_t result_sp;
+ uint64_t result_sp;
size_t o_len = *outlen;
if (!inplen || (inplen & 1))
/* Binary Search for Surrogate Pair */
else if ((0xD800 <= base) && (base < 0xDC00)) {
if (i + 2 < inplen) {
- base_sp = ((u_int32_t)base << 16) | (u_int32_t)in[1];
+ base_sp = ((uint32_t)base << 16) | (uint32_t)in[1];
do {
if ( !(result_sp = do_decomposition_sp(base_sp))) break;
comblen += 2;
/* ----------------- */
static int ipc_get_session(struct ipc_header *ipc, server_child *children)
{
- u_int32_t boottime;
- u_int32_t idlen;
+ uint32_t boottime;
+ uint32_t idlen;
char *clientid, *p;