Commit 6760bce4 authored by rswindell's avatar rswindell

Changes for new xpdev wrappers.

parent cd33d527
......@@ -55,7 +55,7 @@
#include "cmdshell.h"
#include "ars_defs.h"
#include "crc32.h"
#include "smbwrap.h" /* portability wrappers */
#include "genwrap.h" /* portability wrappers */
#ifdef __BORLANDC__
unsigned _stklen=20000; /* Set stack size in code, not header */
......
......@@ -37,13 +37,16 @@
/* ANSI */
#include <stdio.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strrchr */
#include <time.h> /* ctime */
/* SMB-specific */
#include "smbwrap.h"
#include "smblib.h"
#include "genwrap.h"
#include "conwrap.h" /* getch */
#include "dirwrap.h" /* fexist */
#include "filewrap.h" /* filelength */
/****************************************************************************/
/* Returns in 'string' a character representation of the number in l with */
......
......@@ -40,7 +40,7 @@
#include <string.h> /* strnicmp */
#include <ctype.h> /* toupper */
#include "smbwrap.h"
#include "filewrap.h"
#include "smblib.h"
char *usage="usage: fixsmb [/opts] <smb_file>\n"
......
......@@ -49,7 +49,7 @@
/* Synchronet-specific */
#include "sbbsdefs.h"
#include "smbwrap.h" /* lock/unlock/sopen */
#include "filewrap.h" /* lock/unlock/sopen */
enum {
MODE_LIST
......@@ -151,15 +151,15 @@ char* itoa(int val, char* str, int radix)
#if defined(_WIN32)
#define mswait(x) Sleep(x)
#define SLEEP(x) Sleep(x)
#elif defined(__OS2__)
#define mswait(x) DosSleep(x)
#define SLEEP(x) DosSleep(x)
#elif defined(__unix__)
#define mswait(x) usleep(x*1000)
#define SLEEP(x) usleep(x*1000)
#endif
......@@ -176,7 +176,7 @@ void getnodedat(uchar number, node_t *node, char lockit)
number--; /* make zero based */
for(count=0;count<LOOP_NODEDAB;count++) {
if(count)
mswait(100);
SLEEP(100);
lseek(nodefile,(long)number*sizeof(node_t),SEEK_SET);
if(lockit
&& lock(nodefile,(long)number*sizeof(node_t),sizeof(node_t))==-1)
......@@ -622,7 +622,7 @@ int main(int argc, char **argv)
if(!loop)
break;
mswait(1000);
SLEEP(1000);
cls();
} /* while(1) */
......
......@@ -56,7 +56,8 @@
#include <errno.h> /* errno */
#include <string.h> /* strrchr */
#include "smbwrap.h"
#include "filewrap.h"
#include "dirwrap.h" /* fexist */
#include "smblib.h"
#include "crc32.h"
#include "gen_defs.h" /* MAX_PATH */
......
......@@ -64,7 +64,8 @@
/* SMB-specific headers */
#include "smblib.h"
#include "smbwrap.h"
#include "genwrap.h"
#include "filewrap.h"
/* Use smb_ver() and smb_lib_ver() to obtain these values */
#define SMBLIB_VERSION "2.14" /* SMB library version */
......@@ -224,7 +225,7 @@ int SMBCALL smb_open_da(smb_t* smb)
,str,smb->retry_time);
return(-2);
}
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
if((smb->sda_fp=fdopen(file,"r+b"))==NULL) {
sprintf(smb->last_error,"%d fdopening %s (%d)",errno,str,file);
......@@ -269,7 +270,7 @@ int SMBCALL smb_open_ha(smb_t* smb)
,str,smb->retry_time);
return(-2);
}
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
if((smb->sha_fp=fdopen(file,"r+b"))==NULL) {
sprintf(smb->last_error,"%d fdopening %s (%d)",errno,str,file);
......@@ -363,7 +364,7 @@ int SMBCALL smb_trunchdr(smb_t* smb)
,smb->retry_time);
return(-2);
}
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
return(0);
}
......@@ -389,7 +390,7 @@ int SMBCALL smb_locksmbhdr(smb_t* smb)
break;
/* In case we've already locked it */
unlock(fileno(smb->shd_fp),0L,sizeof(smbhdr_t)+sizeof(smbstatus_t));
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
sprintf(smb->last_error,"timeout locking header");
return(-1);
......@@ -459,7 +460,7 @@ int SMBCALL smb_lockmsghdr(smb_t* smb, smbmsg_t* msg)
break;
/* In case we've already locked it */
unlock(fileno(smb->shd_fp),msg->idx.offset,sizeof(msghdr_t));
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
sprintf(smb->last_error,"timeout locking header");
return(-1);
......@@ -926,7 +927,7 @@ int SMBCALL smb_addcrc(smb_t* smb, ulong crc)
,str,smb->retry_time);
return(-2);
}
mswait(smb->retry_delay);
SLEEP(smb->retry_delay);
}
length=filelength(file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment