--- src/lib/libdisk/Attic/chunk.c 2003/06/17 04:26:49 1.2 +++ src/lib/libdisk/Attic/chunk.c 2005/03/13 15:10:03 1.3 @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/lib/libdisk/chunk.c,v 1.21.2.6 2002/01/07 07:53:29 dillon Exp $ - * $DragonFly: src/lib/libdisk/chunk.c,v 1.1 2003/06/16 04:44:53 dillon Exp $ + * $DragonFly$ * */ @@ -46,7 +46,6 @@ Find_Mother_Chunk(struct chunk *chunks, case whole: if (Chunk_Inside(chunks, &ct)) return chunks; -#ifndef PC98 case extended: for(c1 = chunks->part; c1; c1 = c1->next) { if (c1->type != type) @@ -55,7 +54,6 @@ Find_Mother_Chunk(struct chunk *chunks, return c1; } return 0; -#endif case freebsd: for(c1 = chunks->part; c1; c1 = c1->next) { if (c1->type == type) @@ -86,9 +84,6 @@ Free_Chunk(struct chunk *c1) if(c1->next) Free_Chunk(c1->next); free(c1->name); -#ifdef PC98 - free(c1->sname); -#endif free(c1); } @@ -105,22 +100,14 @@ Clone_Chunk(struct chunk *c1) if (c1->private_data && c1->private_clone) c2->private_data = c2->private_clone(c2->private_data); c2->name = strdup(c2->name); -#ifdef PC98 - c2->sname = strdup(c2->sname); -#endif c2->next = Clone_Chunk(c2->next); c2->part = Clone_Chunk(c2->part); return c2; } int -#ifdef PC98 -Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, - chunk_e type, int subtype, u_long flags, const char *sname) -#else Insert_Chunk(struct chunk *c2, u_long offset, u_long size, const char *name, chunk_e type, int subtype, u_long flags) -#endif { struct chunk *ct,*cs; @@ -136,9 +123,6 @@ Insert_Chunk(struct chunk *c2, u_long of ct->size = size; ct->end = offset + size - 1; ct->type = type; -#ifdef PC98 - ct->sname = strdup(sname); -#endif ct->name = strdup(name); ct->subtype = subtype; ct->flags = flags; @@ -157,9 +141,6 @@ Insert_Chunk(struct chunk *c2, u_long of cs->size = size; cs->end = offset + size - 1; cs->type = unused; -#ifdef PC98 - cs->sname = strdup(sname); -#endif cs->name = strdup("-"); ct->part = cs; } @@ -172,10 +153,6 @@ Insert_Chunk(struct chunk *c2, u_long of cs->disk = c2->disk; cs->offset = ct->end + 1; cs->size = c2->end - ct->end; -#ifdef PC98 - if(c2->sname) - cs->sname = strdup(c2->sname); -#endif if(c2->name) cs->name = strdup(c2->name); c2->next = cs; @@ -184,17 +161,11 @@ Insert_Chunk(struct chunk *c2, u_long of } /* If no leading unused space just occupy the old chunk */ if (c2->offset == ct->offset) { -#ifdef PC98 - c2->sname = ct->sname; -#endif c2->name = ct->name; c2->type = ct->type; c2->part = ct->part; c2->subtype = ct->subtype; c2->flags = ct->flags; -#ifdef PC98 - ct->sname = 0; -#endif ct->name = 0; ct->part = 0; Free_Chunk(ct); @@ -209,13 +180,8 @@ Insert_Chunk(struct chunk *c2, u_long of } int -#ifdef PC98 -Add_Chunk(struct disk *d, long offset, u_long size, const char *name, - chunk_e type, int subtype, u_long flags, const char *sname) -#else Add_Chunk(struct disk *d, long offset, u_long size, const char *name, chunk_e type, int subtype, u_long flags) -#endif { struct chunk *c1,*c2,ct; u_long end = offset + size - 1; @@ -234,10 +200,6 @@ Add_Chunk(struct disk *d, long offset, u c2->offset = c1->offset = offset; c2->size = c1->size = size; c2->end = c1->end = end; -#ifdef PC98 - c1->sname = strdup(sname); - c2->sname = strdup("-"); -#endif c1->name = strdup(name); c2->name = strdup("-"); c1->type = type; @@ -247,22 +209,14 @@ Add_Chunk(struct disk *d, long offset, u return 0; } if (type == freebsd) -#ifdef PC98 - subtype = 0xc494; -#else subtype = 0xa5; -#endif c1 = 0; -#ifndef PC98 if(!c1 && (type == freebsd || type == fat || type == unknown)) c1 = Find_Mother_Chunk(d->chunks, offset, end, extended); -#endif if(!c1 && (type == freebsd || type == fat || type == unknown)) c1 = Find_Mother_Chunk(d->chunks, offset, end, whole); -#ifndef PC98 if(!c1 && type == extended) c1 = Find_Mother_Chunk(d->chunks, offset, end, whole); -#endif if(!c1 && type == part) c1 = Find_Mother_Chunk(d->chunks, offset, end, freebsd); if(!c1) @@ -304,13 +258,8 @@ Add_Chunk(struct disk *d, long offset, u size -= offset; doit: -#ifdef PC98 - return Insert_Chunk(c2, offset, size, name, - type, subtype, flags, sname); -#else return Insert_Chunk(c2, offset, size, name, type, subtype, flags); -#endif } } return __LINE__; @@ -339,13 +288,8 @@ Print_Chunk(struct chunk *c1,int offset) for(; i < offset; i++) putchar('-'); putchar('>'); for(; i < 10; i++) putchar(' '); -#ifdef PC98 - printf("%p %8ld %8lu %8lu %-8s %-16s %-8s 0x%02x %s", - c1, c1->offset, c1->size, c1->end, c1->name, c1->sname, -#else printf("%p %8ld %8lu %8lu %-8s %-8s 0x%02x %s", c1, c1->offset, c1->size, c1->end, c1->name, -#endif chunk_n[c1->type], c1->subtype, ShowChunkFlags(c1)); putchar('\n'); @@ -374,16 +318,12 @@ Delete_Chunk2(struct disk *d, struct chu if(type == whole) return 1; -#ifndef PC98 if(!c1 && (type == freebsd || type == fat || type == unknown)) c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, extended); -#endif if(!c1 && (type == freebsd || type == fat || type == unknown)) c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#ifndef PC98 if(!c1 && type == extended) c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, whole); -#endif if(!c1 && type == part) c1 = Find_Mother_Chunk(d->chunks, c->offset, c->end, freebsd); if(!c1) @@ -393,10 +333,6 @@ Delete_Chunk2(struct disk *d, struct chu c2->type = unused; c2->subtype = 0; c2->flags = 0; -#ifdef PC98 - free(c2->sname); - c2->sname = strdup("-"); -#endif free(c2->name); c2->name = strdup("-"); Free_Chunk(c2->part); @@ -476,9 +412,6 @@ Collapse_Chunk(struct disk *d, struct ch *c2 = *c1; c1->next = c2; c1->disk = d; -#ifdef PC98 - c1->sname = strdup("-"); -#endif c1->name = strdup("-"); c1->part = 0; c1->type = unused;