#include "getopt_.h"
#include "cpmfs.h"
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
/*}}}*/
/* #defines */ /*{{{*/
#ifndef O_BINARY
/*}}}*/
/* mkfs -- make file system */ /*{{{*/
-static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *format, const char *label, char *bootTracks, int timeStamps)
+static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *format, const char *label, char *bootTracks, int timeStamps, int uppercase)
{
/* variables */ /*{{{*/
unsigned int i;
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,name,err);
exit(1);
}
- cpmReadSuper(&super,&root,format);
+ cpmReadSuper(&super,&root,format,uppercase);
records=root.sb->maxdir/8;
if (!(ds=malloc(records*128)))
{
char *image;
const char *format;
+ int uppercase=0;
int c,usage=0;
struct cpmSuperBlock drive;
struct cpmInode root;
const char *boot[4]={(const char*)0,(const char*)0,(const char*)0,(const char*)0};
if (!(format=getenv("CPMTOOLSFMT"))) format=FORMAT;
- while ((c=getopt(argc,argv,"b:f:L:th?"))!=EOF) switch(c)
+ while ((c=getopt(argc,argv,"b:f:L:tuh?"))!=EOF) switch(c)
{
case 'b':
{
case 'f': format=optarg; break;
case 'L': label=optarg; break;
case 't': timeStamps=1; break;
+ case 'u': uppercase=1; break;
case 'h':
case '?': usage=1; break;
}
if (usage)
{
- fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] [-t] image\n",cmd);
+ fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] [-t] [-u] image\n",cmd);
exit(1);
}
drive.dev.opened=0;
- cpmReadSuper(&drive,&root,format);
+ cpmReadSuper(&drive,&root,format,uppercase);
bootTrackSize=drive.boottrk*drive.secLength*drive.sectrk;
if ((bootTracks=malloc(bootTrackSize))==(void*)0)
{
used+=size;
close(fd);
}
- if (mkfs(&drive,image,format,label,bootTracks,timeStamps)==-1)
+ if (mkfs(&drive,image,format,label,bootTracks,timeStamps,uppercase)==-1)
{
fprintf(stderr,"%s: can not make new file system: %s\n",cmd,boo);
exit(1);