--- deliantra/server/common/porting.C 2006/08/29 08:01:35 1.2 +++ deliantra/server/common/porting.C 2006/08/30 16:30:37 1.3 @@ -1,6 +1,6 @@ /* * static char *rcsid_porting_c = - * "$Id: porting.C,v 1.2 2006/08/29 08:01:35 root Exp $"; + * "$Id: porting.C,v 1.3 2006/08/30 16:30:37 root Exp $"; */ /* @@ -65,19 +65,6 @@ static unsigned int curtmp = 0; -/* This is a list of the suffix, uncompress and compress functions. Thus, - * if you have some other compress program you want to use, the only thing - * that needs to be done is to extended this. - * The first entry must be NULL - this is what is used for non - * compressed files. - */ -EXTERN char *uncomp[NROF_COMPRESS_METHODS][3] = { - {NULL, NULL, NULL}, - {".Z", UNCOMPRESS, COMPRESS}, - {".gz", GUNZIP, GZIP}, - {".bz2", BUNZIP, BZIP} -}; - /***************************************************************************** * File related functions ****************************************************************************/ @@ -322,18 +309,6 @@ #endif -/* This takes an err number and returns a string with a description of - * the error. - */ -char *strerror_local(int errnum) -{ -#if defined(HAVE_STRERROR) - return(strerror(errnum)); -#else - return("strerror_local not implemented"); -#endif -} - /* * Based on (n+1)^2 = n^2 + 2n + 1 * given that 1^2 = 1, then @@ -376,41 +351,6 @@ return tbuf; } -/* - * A fast routine which appends the name and decimal number specified - * to the given buffer. - * Could be faster, though, if the strcat()s at the end could be changed - * into alternate strcat which returned a pointer to the _end_, not the - * start! - * - * Hey good news, it IS faster now, according to changes in get_ob_diff - * Completly redone prototype and made define in loader.l. See changes there. - * Didn't touch those for speed reason (don't use them anymore) . - * Tchize - */ - -void save_long(char *buf, char *name, long n) { - char buf2[MAX_BUF]; - strcpy(buf2,name); - strcat(buf2," "); - strcat(buf2,ltostr10(n)); - strcat(buf2,"\n"); - strcat(buf,buf2); -} - - - -void save_long_long(char *buf, char *name, sint64 n) { - char buf2[MAX_BUF]; - -#ifndef WIN32 - sprintf(buf2,"%s %lld\n", name, n); -#else - sprintf(buf2,"%s %I64d\n", name, n); -#endif - strcat(buf,buf2); -} - /** * Open and possibly uncompress a file. * @@ -521,13 +461,10 @@ size_t i; FILE *fp; - for (i = 0; i < NROF_COMPRESS_METHODS; i++) { - *compressed = i; - fp = open_and_uncompress_file(uncomp[i][0], uncomp[i][1], name, flag, compressed); + fp = open_and_uncompress_file(0,0, name, flag, compressed); if (fp != NULL) { return fp; } - } errno = ENOENT; return NULL; @@ -561,7 +498,7 @@ *cp = '\0'; if (stat(buf, &statbuf) || !S_ISDIR (statbuf.st_mode)) { if (mkdir (buf, SAVE_DIR_MODE)) { - LOG(llevError, "Cannot mkdir %s: %s\n", buf, strerror_local(errno)); + LOG(llevError, "Cannot mkdir %s: %s\n", buf, strerror(errno)); return; } }