#ifndef lint
static const char rcsid[] =
- "$Id: utilities.c,v 1.23 2003/10/26 16:05:48 stelian Exp $";
+ "$Id: utilities.c,v 1.25 2004/12/14 14:07:58 stelian Exp $";
#endif /* not lint */
#include <config.h>
if (ep->e_type != NODE)
badentry(ep, "removenode: not a node");
- if (ep->e_entries != NULL)
- badentry(ep, "removenode: non-empty directory");
+ if (ep->e_entries != NULL) {
+ int i;
+ for (i = 0; i < DIRHASH_SIZE; i++) {
+ if (ep->e_entries[i] != NULL)
+ badentry(ep, "removenode: non-empty directory");
+ }
+ }
ep->e_flags |= REMOVED;
ep->e_flags &= ~TMPNAME;
cp = myname(ep);
fprintf(stderr, "parent name %s\n", myname(ep->e_parent));
if (ep->e_sibling != NULL)
fprintf(stderr, "sibling name: %s\n", myname(ep->e_sibling));
- if (ep->e_entries != NULL)
- fprintf(stderr, "next entry name: %s\n", myname(ep->e_entries));
+ if (ep->e_entries != NULL) {
+ int i;
+ for (i = 0; i < DIRHASH_SIZE; i++) {
+ if (ep->e_entries[i] != NULL) {
+ fprintf(stderr, "next entry name: %s\n", myname(ep->e_entries[0]));
+ break;
+ }
+ }
+ }
if (ep->e_links != NULL)
fprintf(stderr, "next link name: %s\n", myname(ep->e_links));
if (ep->e_next != NULL)
void
GetPathFile(char *source, char *path, char *fname)
{
- char *p, *s;
+ char *p, *s;
*path = 0;
*fname = 0;
int
GetSCSIIDFromPath(char *devPath, long *id)
{
- int len;
- char fbuff[2048];
- char path[2048];
- char fname[2048];
- char *fpn = fname;
- char idstr[32];
- char *ip = idstr;
+ int len;
+ char fbuff[2048];
+ char path[2048];
+ char fname[2048];
+ char *fpn = fname;
+ char idstr[32];
+ char *ip = idstr;
bzero(fbuff, sizeof(fbuff));
if ((len = readlink(devPath, fbuff, 2048)) == -1) {
CreateAppleDoubleFileRes(char *oFile, FndrFileInfo *finderinfo, mode_t mode, int flags,
struct timeval *timep, u_int32_t uid, u_int32_t gid)
{
- int err = 0;
- int fdout;
- char *p;
- char *f;
- char *pp;
+ int err = 0;
+ int fdout;
+ char *p;
+ char *pp;
ASDHeaderPtr hp;
- ASDEntryPtr ep;
- long thesize;
- long n;
- long loops;
- long remain;
+ ASDEntryPtr ep;
+ long thesize;
+ long n;
n = 1; /* number of entries in double file ._ only finderinfo */