Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commits (1)
This project (Synchronet BBS List, SBL, the native C version) has been
retired and deprecated in favor of the new Synchronet BBS List (v4,
JavaScript version), a.k.a. exec/sbbslist.js.
See http://wiki.synchro.net/module:sbbslist for details about migrating to the
new Synchronet BBS List.
# Makefile.gnu
#########################################################################
# Makefile for Synchronet BBS List #
# For use with GNU make and GNU C Compiler #
# @format.tab-size 4, @format.use-tabs true #
# #
# Linux: make -f Makefile.gnu #
# Win32: make -f Makefile.gnu os=win32 #
# FreeBSD: make -f Makefile.gnu os=freebsd #
#########################################################################
# $Id: GNUmakefile,v 1.28 2019/08/06 17:06:32 deuce Exp $
# Macros
XSDK = ../sdk
SRC_ROOT ?= ../../src
include $(SRC_ROOT)/build/Common.gmake
ifeq ($(os),sunos)
LDFLAGS += -lnsl -lrt
endif
LDFLAGS += $(XPDEV_LDFLAGS)
vpath %.c $(XSDK)
CFLAGS += -I$(SRC_ROOT)$(DIRSEP)sbbs3 -I$(XSDK) -DUSE_XPDEV $(XPDEV_CFLAGS) $(SMBLIB_CFLAGS) $(HASH_CFLAGS) $(ENCODE_CFLAGS)
$(SBL): $(OBJS)
@echo Linking $@
$(QUIET)$(CC) $(MT_LDFLAGS) $(LDFLAGS) $^ -o $@ $(XPDEV-MT_LIBS)
$(SBL2SMB): $(OBJODIR)$(DIRSEP)sbl2smb$(OFILE) $(HASH_LIB) $(ENCODE_LIB)
@echo Linking $@
$(QUIET)$(CC) $(LDFLAGS) $(SMBLIB_LDFLAGS) $(HASH_LDFLAGS) $(ENCODE_LDFLAGS) $^ -o $@ $(LIBS) $(SMBLIB_LIBS) $(XPDEV_LIBS) $(HASH_LIBS) $(ENCODE_LIBS)
$(SMB2SBL): $(OBJODIR)$(DIRSEP)smb2sbl$(OFILE) $(HASH_LIB) $(ENCODE_LIB)
@echo Linking $@
$(QUIET)$(CC) $(LDFLAGS) $(SMBLIB_LDFLAGS) $(HASH_LDFLAGS) $(ENCODE_LDFLAGS) $^ -o $@ $(SMBLIB_LIBS) $(XPDEV_LIBS) $(HASH_LIBS) $(ENCODE_LIBS)
$(SBLPACK): $(OBJODIR)$(DIRSEP)sblpack$(OFILE)
@echo Linking $@
$(QUIET)$(CC) $(LDFLAGS) $(SMBLIB_LDFLAGS) $^ -o $@ $(XPDEV_LIBS)
$(SBBSLIST): $(OBJODIR)$(DIRSEP)sbbslist$(OFILE)
@echo Linking $@
$(QUIET)$(CC) $(LDFLAGS) $(SMBLIB_LDFLAGS) $^ -o $@ $(XPDEV_LIBS)
##################################################################
# Makefile for SBL (Synchronet BBS List Online External Program) #
# For use with Borland C++ or C++ Builder (for Win32) #
# Tabstop=8 #
##################################################################
# Macros
CC = bcc32
LD = ilink32
XSDK = ..\sdk
!ifndef SRC_ROOT
SRC_ROOT= ..\..\src
!endif
!ifndef XPDEV
XPDEV = $(SRC_ROOT)\xpdev
!endif
!ifndef SBBS_SRC
SBBS_SRC = $(SRC_ROOT)\sbbs3
!endif
!ifndef SMBLIB_SRC
SMBLIB_SRC = $(SRC_ROOT)\smblib
!endif
CFLAGS = -WM -I$(XSDK);$(XPDEV);$(SBBS_SRC);$(SMBLIB_SRC)
CFLAGS = $(CFLAGS) -q -d -H -X- -w-csu -w-pch -w-ccc -w-rch -w-par -w-8004
OBJS = xsdk.obj xsdkvars.obj xsdkwrap.obj
.path.c = .;$(XSDK);$(XPDEV);$(SBBS_SRC)
# Enable auto-dependency checking
.autodepend
.cacheautodepend
# Implicit C Compile Rule
.c.obj:
@$(CC) $(CFLAGS) -c $<
all: sbl.exe smb2sbl.exe sbl2smb.exe sblpack.exe
# Main EXE Link Rule
sbl.exe: $(OBJS) sbl.obj
@echo Linking $@
@$(CC) $(CFLAGS) -e$@ $**
SMBIO = $(XPDEV)/bcc.win32.lib.debug/xpdev_mt.lib $(SMBLIB_SRC)/bcc.win32.lib.debug/smb.lib
sbl2smb.exe: sbl2smb.obj $(SMBIO)
@echo Linking $@
@$(CC) $(CFLAGS) -e$@ $**
smb2sbl.exe: smb2sbl.obj $(SMBIO)
@echo Linking $@
@$(CC) $(CFLAGS) -e$@ $**
sblpack.exe: sblpack.obj
@echo Linking $@
@$(CC) $(CFLAGS) -e$@ $**
clean:
del $(OBJS) $(SMBIO)
\ No newline at end of file
OBJS = $(MTOBJODIR)$(DIRSEP)sbl$(OFILE) \
$(MTOBJODIR)$(DIRSEP)xsdk$(OFILE) \
$(MTOBJODIR)$(DIRSEP)xsdkvars$(OFILE)
This diff is collapsed.
#!/bin/sh
. ${SBBSEXEC}unixstub.sh
USEUNIT("Sbl.c");
USEUNIT("..\SDK\Xsdkvars.c");
USEUNIT("..\SDK\Xsdk.c");
USELIB("D:\Borland\CBuilder5\Lib\ws2_32.lib");
USEUNIT("..\sdk\xsdkwrap.c");
//---------------------------------------------------------------------------
This file is used by the project manager only and should be treated like the project file
main
\ No newline at end of file
<?xml version='1.0' encoding='utf-8' ?>
<!-- C++Builder XML Project -->
<PROJECT>
<MACROS>
<VERSION value="BCB.05.03"/>
<PROJECT value="sbl.exe"/>
<OBJFILES value="Sbl.obj ..\SDK\Xsdkvars.obj ..\SDK\Xsdk.obj ..\sdk\xsdkwrap.obj"/>
<RESFILES value=""/>
<IDLFILES value=""/>
<IDLGENFILES value=""/>
<DEFFILE value=""/>
<RESDEPEN value="$(RESFILES)"/>
<LIBFILES value="D:\Borland\CBuilder5\Lib\ws2_32.lib"/>
<LIBRARIES value=""/>
<SPARELIBS value=""/>
<PACKAGES value="VCL50.bpi VCLX50.bpi bcbsmp50.bpi VCLDB50.bpi VCLADO50.bpi ibsmp50.bpi
VCLBDE50.bpi VCLDBX50.bpi QRPT50.bpi TEEUI50.bpi TEEDB50.bpi TEE50.bpi
DSS50.bpi TEEQR50.bpi VCLIB50.bpi VCLMID50.bpi VCLIE50.bpi INETDB50.bpi
INET50.bpi NMFAST50.bpi WEBMID50.bpi bcbie50.bpi dclocx50.bpi"/>
<PATHCPP value=".;..\SDK"/>
<PATHPAS value=".;"/>
<PATHRC value=".;"/>
<PATHASM value=".;"/>
<DEBUGLIBPATH value="$(BCB)\lib\debug"/>
<RELEASELIBPATH value="$(BCB)\lib\release"/>
<LINKER value="tlink32"/>
<USERDEFINES value="_DEBUG"/>
<SYSDEFINES value="NO_STRICT;_NO_VCL"/>
<MAINSOURCE value="sbl.bpf"/>
<INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl;..\sdk"/>
<LIBPATH value="..\SDK;$(BCB)\lib\obj;$(BCB)\lib"/>
<WARNINGS value="-w-par"/>
</MACROS>
<OPTIONS>
<IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -I..\sdk -src_suffix cpp -D_DEBUG -boa"/>
<CFLAG1 value="-Od -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi- -tWC
-tWM -c"/>
<PFLAGS value="-$YD -$W -$O- -v -JPHNE -M"/>
<RFLAGS value=""/>
<AFLAGS value="/mx /w2 /zd"/>
<LFLAGS value="-D&quot;&quot; -ap -Tpe -x -Gn -v"/>
</OPTIONS>
<LINKER>
<ALLOBJ value="c0x32.obj $(OBJFILES)"/>
<ALLRES value="$(RESFILES)"/>
<ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cw32mt.lib"/>
</LINKER>
<IDEOPTIONS>
[Version Info]
IncludeVerInfo=0
AutoIncBuild=0
MajorVer=1
MinorVer=0
Release=0
Build=0
Debug=0
PreRelease=0
Special=0
Private=0
DLL=0
Locale=1033
CodePage=1252
[Version Info Keys]
CompanyName=
FileDescription=
FileVersion=1.0.0.0
InternalName=
LegalCopyright=
LegalTrademarks=
OriginalFilename=
ProductName=
ProductVersion=1.0.0.0
Comments=
[HistoryLists\hlIncludePath]
Count=3
Item0=$(BCB)\include;$(BCB)\include\vcl;..\sdk
Item1=$(BCB)\include;$(BCB)\include\vcl;c:\sbbs\xtrn\sdk
Item2=$(BCB)\include;$(BCB)\include\vcl
[HistoryLists\hlLibraryPath]
Count=2
Item0=..\SDK;$(BCB)\lib\obj;$(BCB)\lib
Item1=$(BCB)\lib\obj;$(BCB)\lib
[HistoryLists\hlDebugSourcePath]
Count=1
Item0=$(BCB)\source\vcl
[HistoryLists\hlConditionals]
Count=1
Item0=_DEBUG
[Debugging]
DebugSourceDirs=$(BCB)\source\vcl
[Parameters]
RunParams=
HostApplication=
RemoteHost=
RemotePath=
RemoteDebug=0
[Compiler]
ShowInfoMsgs=0
LinkDebugVcl=0
LinkCGLIB=0
[CORBA]
AddServerUnit=1
AddClientUnit=1
PrecompiledHeaders=1
[Language]
ActiveLang=
ProjectLang=
RootDir=
</IDEOPTIONS>
</PROJECT>
\ No newline at end of file
This diff is collapsed.
30 Days to keep non-updated entries
50 Minimum security level to add
50 Minimum security level to update
50 Minimum security level to remove
10 Minimum security level to verify
1 User to notify of changes (0=none)
Synchronet BBS List v3.20 (native 32-bit for Win32 and Unix)
=========================
Create the directory: SBL off of your Synchronet XTRN directory.
(Example: C:\SBBS\XTRN\SBL)
Make sure SBL.CFG are is this directory.
Use an ASCII editor to edit the Synchronet BBS List config file (SBL.CFG) to
your liking.
Under SCFG->External Programs->Online Programs->Main, hit INS (if it doesn't
already exist) and add Synchronet BBS List with the following configuration:
Name Synchronet BBS List
Internal Code SBL
Start-up Directory ..\xtrn\sbl
Command Line sbl%.
Clean-up Command Line
Execution Cost None
Access Requirements
Execution Requirements
Multiple Concurrent Users Yes
Intercept Standard I/O No
Native (32-bit) Executable Yes
Use Shell to Execute No
Modify User Data No
Execute on Event No
BBS Drop File Type Synchronet XTRN.DAT
Place Drop File In Node Directory
SBL Utilities
=============
SBLPACK Remove deleted entries to save disk space and speed up listings
Networking the Synchronet BBS List
==================================
If you wish to link your SBL database with other Synchronet BBSes, you must
carry the Synchronet Data echo via DOVE-Net, FidoNet, or RIME and add
the following two events in SCFG->External Programs->Timed Events:
Internal Code SMB2SBL
Start-up Directory ..\xtrn\sbl
Command Line smb2sbl%. %jsubs\syncdata sbl.dab
Execution Node 1
Execution Days of Month Any
Execution Days of Week All
Execution Time 00:00
Requires Exclusive Execution No
Force Users Off-line For Event No
Native (32-bit) Executable Yes
Use Shell to Execute No
Background Execution No
Internal Code SBL2SMB
Start-up Directory ..\xtrn\sbl
Command Line sbl2smb%. sbl.dab %jsubs\syncdata
Execution Node 11
Execution Days of Month Any
Execution Days of Week All
Execution Time 00:00
Requires Exclusive Execution No
Force Users Off-line For Event No
Native (32-bit) Executable Yes
Use Shell to Execute No
Background Execution No
Change "SYNCDATA" to the internal code of the Synchronet Data sub-board on
your BBS. We used SYNCDATA, since that is the example given in the Synchronet
manual for the DOVE-Net Synchronet Data sub-board internal code. It is okay
if you used a completely different internal code, as long as you specify that
code instead of "SYNCDATA" on the above command lines.
Make note that all networked SBL entries will be deleted from Vertrauen
(Home of the Synchronet BBS List) after 90 days unless the entry is
retransmitted in the message base or updated manually on Vertrauen in that
time. To cause a retransmission from your BBS, you must (U)pdate the entry
using SBL and then SBL2SMB will re-export it automatically next time it is run
(via Timed Event). (V)erified entries are not re-exported by SBL2SMB, only new
and updated entries. You can also create a BBS entry message by hand (not
using SBL). Download SBBSLIST.ZIP from Vertrauen for more details.
Source Code
===========
If you are a C programmer, you may find the included source code interesting
and/or useful as an example for writing your own XSDK and/or SMB utilities.
Makefile is for use with Borland C++ or C++Builder and the Synchronet XSDK
to create SBL.EXE. GNUmakefile is for use with the GNU C Compiler.
And sbl.dsp is for use with Microsoft Visual C++ v6.0.
/* End of SBL.DOC */
\ No newline at end of file
# Microsoft Developer Studio Project File - Name="sbl" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sbl - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sbl.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sbl.mak" CFG="sbl - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sbl - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sbl - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sbl - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "sbl___Win32_Release"
# PROP BASE Intermediate_Dir "sbl___Win32_Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\sdk" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "sbl - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "sbl___Win32_Debug"
# PROP BASE Intermediate_Dir "sbl___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\sdk" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /map /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "sbl - Win32 Release"
# Name "sbl - Win32 Debug"
# Begin Source File
SOURCE=.\sbl.c
# End Source File
# Begin Source File
SOURCE=.\sbldefs.h
# End Source File
# Begin Source File
SOURCE=..\Sdk\xsdk.c
# End Source File
# Begin Source File
SOURCE=..\Sdk\xsdkvars.c
# End Source File
# Begin Source File
SOURCE=..\sdk\xsdkwrap.c
# End Source File
# End Target
# End Project
#!/bin/sh
. ${SBBSEXEC}unixstub.sh
/* sbl2smb.c */
/* Scans SBL database and posts any additions/updates into the an SMB base */
/* $Id: sbl2smb.c,v 1.14 2019/08/06 17:06:32 deuce Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout xtrn *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#ifdef _WIN32
#include <windows.h>
#include <io.h> /* access */
#include <share.h>
#endif
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "md5.h"
#include "genwrap.h"
#include "filewrap.h"
#include "dirwrap.h"
#include "sbbsdefs.h"
#include "smblib.h"
#include "sbldefs.h"
smb_t smb;
char revision[16];
/****************************************************************************/
/* Converts unix time format (long - time_t) into a char str MM/DD/YY */
/****************************************************************************/
char* unixtodstr(time_t unix_time, char *str)
{
struct tm* tm;
if(!unix_time)
strcpy(str,"00/00/00");
else {
tm=gmtime(&unix_time);
if(tm==NULL) {
strcpy(str,"00/00/00");
return(str);
}
if(tm->tm_mon>11) { /* DOS leap year bug */
tm->tm_mon=0;
tm->tm_year++; }
if(tm->tm_mday>31)
tm->tm_mday=1;
sprintf(str,"%02u/%02u/%02u",tm->tm_mday,tm->tm_mon+1
,TM_YEAR(tm->tm_year));
}
return(str);
}
#define BUF_LEN (32*1024)
int main(int argc, char **argv)
{
uchar str[128],tmp[128],*buf,*p,software[128];
int i,file;
ushort xlat;
long length;
ulong offset;
time_t last,now;
bbs_t bbs;
smbmsg_t msg;
FILE *stream;
sscanf("$Revision: 1.14 $" + 11, "%s", revision);
fprintf(stderr,"\nSBL2SMB v2.%s-%s - Write SBL to SMB - Coyright 2002 "
"Rob Swindell\n\n",revision,PLATFORM_DESC);
if(argc<3) {
fprintf(stderr,"usage: sbl2smb <sbl.dab> <smb_file> [/s:software]\n\n");
fprintf(stderr,"ex: sbl2smb /sbbs/xtrn/sbl/sbl.dab "
"/sbbs/data/subs/syncdata\n");
return(1);
}
if((buf = malloc(BUF_LEN)) == NULL) {
fprintf(stderr,"!malloc failure\n");
return(2);
}
now=time(NULL);
software[0]=0;
if(argc>3 && !strnicmp(argv[3],"/S:",3))
SAFECOPY(software,argv[3]+3);
SAFECOPY(smb.file,argv[2]);
SAFECOPY(str,argv[1]);
if((file=sopen(str,O_RDWR|O_BINARY,SH_DENYNO))==-1) {
printf("error opening %s\n",str);
return(1); }
if((stream=fdopen(file,"rb"))==NULL) {
printf("error fdopening %s\n",str);
return(1); }
strcpy(tmp,str);
p=strrchr(tmp,'.');
if(p) {
(*p)=0;
strcat(tmp,"2smb.dab");
if((file=open(tmp,O_RDWR|O_BINARY|O_CREAT,S_IWRITE|S_IREAD))==-1) {
printf("error opening %s\n",str);
return(1); }
if(read(file,&last,sizeof(time_t))!=sizeof(time_t))
last=0;
lseek(file,0L,SEEK_SET);
write(file,&now,sizeof(now));
close(file); }
sprintf(str,"%s.shd",smb.file);
if(!fexist(str)) {
printf("%s doesn't exist\n",smb.file);
return(0); }
fprintf(stderr,"Opening %s\n",smb.file);
smb.retry_time=30;
if((i=smb_open(&smb))!=0) {
printf("smb_open returned %d\n",i);
return(1); }
i=smb_locksmbhdr(&smb);
if(i) {
printf("smb_locksmbhdr returned %d\n",i);
return(1); }
i=smb_getstatus(&smb);
smb_unlocksmbhdr(&smb);
if(i) {
printf("smb_getstatus returned %d\n",i);
return(1); }
while(!feof(stream)) {
if(!fread(&bbs,sizeof(bbs_t),1,stream))
break;
if(bbs.total_numbers<1 /* corrupted? */
|| bbs.total_numbers>MAX_NUMBERS)
continue;
truncsp(bbs.name);
if(bbs.name[0]<=' ' /* corrupted? */
|| bbs.misc&FROM_SMB
|| (bbs.updated<last && bbs.created<last
&& bbs.verified<last))
continue;
if(software[0] && strnicmp(software,bbs.software,strlen(software)))
continue;
truncsp(bbs.user);
if(bbs.user[0]<=' ') /* corrupted? */
continue;
truncsp(bbs.software);
if(bbs.software[0]<=' ') /* corrupted? */
continue;
printf("%s\r\n",bbs.name);
memset(buf,0,BUF_LEN);
sprintf(str,"%-15.15s%s\r\n"
,"Name:",bbs.name);
strcat(buf,str);
sprintf(str,"%-15.15s%s\r\n"
,"Birth:",unixtodstr(bbs.birth,tmp));
strcat(buf,str);
sprintf(str,"%-15.15s%s\r\n"
,"Software:",bbs.software);
strcat(buf,str);
for(i=0;i<bbs.total_sysops;i++) {
truncsp(bbs.sysop[i]);
sprintf(str,"%-15.15s%s\r\n"
,"Sysop:",bbs.sysop[i]);
strcat(buf,str); }
strcat(buf,"\r\n");
truncsp(bbs.sysop_email);
if(bbs.sysop_email[0]) {
sprintf(str,"%-15.15s%s\r\n"
,"E-mail:",bbs.sysop_email);
strcat(buf,str);
}
truncsp(bbs.web_url);
if(bbs.web_url[0]) {
sprintf(str,"%-15.15s%s\r\n"
,"Web-site:",bbs.web_url);
strcat(buf,str);
}
strcat(buf,"\r\n");
for(i=0;i<bbs.total_numbers;i++) {
truncsp(bbs.number[i].modem.number);
sprintf(str,"%-15.15s%s\r\n"
,"Number:",bbs.number[i].modem.number);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"MinRate:",bbs.number[i].modem.min_rate);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"MaxRate:",bbs.number[i].modem.max_rate);
strcat(buf,str);
if(bbs.number[i].modem.min_rate!=0xffff) {
sprintf(str,"%-15.15s%s\r\n"
,"Modem:",bbs.number[i].modem.desc);
strcat(buf,str);
}
truncsp(bbs.number[i].modem.location);
sprintf(str,"%-15.15s%s\r\n"
,"Location:",bbs.number[i].modem.location);
strcat(buf,str);
if(i+1<bbs.total_numbers)
strcat(buf,"\r\n"); }
if(bbs.total_networks)
strcat(buf,"\r\n");
for(i=0;i<bbs.total_networks;i++) {
sprintf(str,"%-15.15s%s\r\n"
,"Network:",bbs.network[i]);
strcat(buf,str);
sprintf(str,"%-15.15s%s\r\n"
,"Address:",bbs.address[i]);
strcat(buf,str);
if(i+1<bbs.total_networks)
strcat(buf,"\r\n"); }
strcat(buf,"\r\n");
for(i=0;i<bbs.total_terminals;i++) {
sprintf(str,"%-15.15s%s\r\n"
,"Terminal:",bbs.terminal[i]);
strcat(buf,str); }
strcat(buf,"\r\n");
sprintf(str,"%-15.15s%lu\r\n"
,"Megs:",bbs.megs);
strcat(buf,str);
sprintf(str,"%-15.15s%lu\r\n"
,"Msgs:",bbs.msgs);
strcat(buf,str);
sprintf(str,"%-15.15s%lu\r\n"
,"Files:",bbs.files);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"Nodes:",bbs.nodes);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"Users:",bbs.users);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"Subs:",bbs.subs);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"Dirs:",bbs.dirs);
strcat(buf,str);
sprintf(str,"%-15.15s%u\r\n"
,"Xtrns:",bbs.xtrns);
strcat(buf,str);
if(bbs.desc[0][0])
strcat(buf,"\r\n");
for(i=0;i<5;i++) {
if(!bbs.desc[i][0])
break;
sprintf(str,"%-15.15s%s\r\n"
,"Desc:",bbs.desc[i]);
strcat(buf,str); }
sprintf(buf+strlen(buf),"\r\n--- SBL2SMB 2.%s-%s",revision,PLATFORM_DESC);
length=strlen(buf); /* +2 for translation string */
if(smb.status.attr&SMB_HYPERALLOC)
offset=smb_hallocdat(&smb);
else {
i=smb_open_da(&smb);
if(i) {
printf("smb_open_da returned %d\n",i);
exit(1); }
offset=smb_allocdat(&smb,length+2,1);
fclose(smb.sda_fp); }
fseek(smb.sdt_fp,offset,SEEK_SET);
xlat=XLAT_NONE;
fwrite(&xlat,2,1,smb.sdt_fp);
fwrite(buf,length,1,smb.sdt_fp);
length+=2;
memset(&msg,0,sizeof(smbmsg_t));
memcpy(msg.hdr.msghdr_id,"SHD\x1a",4);
msg.hdr.version=smb_ver();
msg.hdr.when_written.time=now;
msg.hdr.when_imported.time=now;
msg.hdr.offset=offset;
strcpy(str,"SBL");
i=smb_hfield(&msg,RECIPIENT,(ushort)strlen(str),str);
if(i) {
printf("smb_hfield returned %d\n",i);
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
strlwr(str);
msg.idx.to=crc16(str);
strcpy(str,bbs.user);
i=smb_hfield(&msg,SENDER,(ushort)strlen(str),str);
if(i) {
printf("smb_hfield returned %d\n",i);
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
strlwr(str);
msg.idx.from=crc16(str);
strcpy(str,bbs.name);
i=smb_hfield(&msg,SUBJECT,(ushort)strlen(str),str);
if(i) {
printf("smb_hfield returned %d\n",i);
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
strlwr(str);
msg.idx.subj=crc16(str);
i=smb_dfield(&msg,TEXT_BODY,length);
if(i) {
printf("smb_dfield returned %d\n",i);
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
i=smb_addmsghdr(&smb,&msg,smb.status.attr&SMB_HYPERALLOC);
if(i) {
printf("smb_addmsghdr returned %d\n",i);
smb_freemsgdat(&smb,offset,length,1);
exit(1); }
smb_freemsgmem(&msg); }
return(0);
}
/* End of SBL2SMB.C */
# Microsoft Developer Studio Project File - Name="sbl2smb" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sbl2smb - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sbl2smb.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sbl2smb.mak" CFG="sbl2smb - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sbl2smb - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sbl2smb - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sbl2smb - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "c:\src\sbbs3" /I "c:\src\xpdev" /I "..\sdk" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "sbl2smb - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "sbl2smb___Win32_Debug"
# PROP BASE Intermediate_Dir "sbl2smb___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "c:\src\sbbs3" /I "c:\src\xpdev" /I "..\sdk" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "sbl2smb - Win32 Release"
# Name "sbl2smb - Win32 Debug"
# Begin Source File
SOURCE=c:\src\xpdev\dirwrap.c
# End Source File
# Begin Source File
SOURCE=c:\src\xpdev\filewrap.c
# End Source File
# Begin Source File
SOURCE=c:\src\xpdev\genwrap.c
# End Source File
# Begin Source File
SOURCE=.\sbl2smb.c
# End Source File
# Begin Source File
SOURCE=C:\src\sbbs3\smblib.c
# End Source File
# End Target
# End Project
/* SBL2TXT.C */
/* Developed 1990-1997 by Rob Swindell; PO Box 501, Yorba Linda, CA 92885 */
/* Converts Synchronet BBS List (SBL.DAB) to text file */
#include "xsdk.h"
#include "sbldefs.h"
char *wday[]={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
char *mon[]={"Jan","Feb","Mar","Apr","May","Jun"
,"Jul","Aug","Sep","Oct","Nov","Dec"};
char *nulstr="";
char tmp[256];
struct date date;
struct time curtime;
extern int daylight=0;
extern long timezone=0L;
/****************************************************************************/
/* Generates a 24 character ASCII string that represents the time_t pointer */
/* Used as a replacement for ctime() */
/****************************************************************************/
char *timestr(time_t *intime)
{
static char str[256];
char mer[3],hour;
struct tm *gm;
gm=localtime(intime);
if(gm->tm_hour>=12) {
if(gm->tm_hour==12)
hour=12;
else
hour=gm->tm_hour-12;
strcpy(mer,"pm"); }
else {
if(gm->tm_hour==0)
hour=12;
else
hour=gm->tm_hour;
strcpy(mer,"am"); }
sprintf(str,"%s %s %02d %4d %02d:%02d %s"
,wday[gm->tm_wday],mon[gm->tm_mon],gm->tm_mday,gm->tm_year%100
,hour,gm->tm_min,mer);
return(str);
}
/****************************************************************************/
/* Converts unix time format (long - time_t) into a char str MM/DD/YY */
/****************************************************************************/
char *unixtodstr(time_t unix, char *str)
{
if(!unix)
strcpy(str,"00/00/00");
else {
unixtodos(unix,&date,&curtime);
if((unsigned)date.da_mon>12) { /* DOS leap year bug */
date.da_mon=1;
date.da_year++; }
if((unsigned)date.da_day>31)
date.da_day=1;
sprintf(str,"%02u/%02u/%02u",date.da_mon,date.da_day
,date.da_year>=2000 ? date.da_year-2000 : date.da_year-1900); }
return(str);
}
void long_bbs_info(FILE *out, bbs_t bbs)
{
int i;
fprintf(out,"BBS Name: %s since %s\r\n"
,bbs.name,unixtodstr(bbs.birth,tmp));
fprintf(out,"Operator: ");
for(i=0;i<bbs.total_sysops;i++) {
if(i) {
if(bbs.total_sysops>2)
fprintf(out,", ");
else
fputc(' ',out);
if(!(i%4))
fprintf(out,"\r\n ");
if(i+1==bbs.total_sysops)
fprintf(out,"and "); }
fprintf(out,"%s",bbs.sysop[i]); }
fprintf(out,"\r\n");
fprintf(out,"Software: %-15.15s Nodes: %-5u "
"Users: %-5u Doors: %u\r\n"
,bbs.software,bbs.nodes,bbs.users,bbs.xtrns);
fprintf(out,"Download: %lu files in %u directories of "
"%luMB total space\r\n"
,bbs.files,bbs.dirs,bbs.megs);
fprintf(out,"Messages: %lu messages in %u sub-boards\r\n"
,bbs.msgs,bbs.subs);
fprintf(out,"Networks: ");
for(i=0;i<bbs.total_networks;i++) {
if(i) {
if(bbs.total_networks>2)
fprintf(out,", ");
else
fputc(' ',out);
if(!(i%3))
fprintf(out,"\r\n ");
if(i+1==bbs.total_networks)
fprintf(out,"and "); }
fprintf(out,"%s [%s]",bbs.network[i],bbs.address[i]); }
fprintf(out,"\r\n");
fprintf(out,"Terminal: ");
for(i=0;i<bbs.total_terminals;i++) {
if(i) {
if(bbs.total_terminals>2)
fprintf(out,", ");
else
fputc(' ',out);
if(i+1==bbs.total_terminals)
fprintf(out,"and "); }
fprintf(out,"%s",bbs.terminal[i]); }
fprintf(out,"\r\n\r\n");
for(i=0;i<bbs.total_numbers;i++)
fprintf(out,"%-30.30s %12.12s %5u %-15.15s "
"Minimum: %u\r\n"
,i && !strcmp(bbs.number[i].modem.location,bbs.number[i-1].modem.location)
? nulstr : bbs.number[i].modem.location
,bbs.number[i].modem.number
,bbs.number[i].modem.max_rate
,bbs.number[i].modem.desc
,bbs.number[i].modem.min_rate);
fprintf(out,"\r\n");
for(i=0;i<5;i++) {
if(!bbs.desc[i][0])
break;
fprintf(out,"%15s%s\r\n",nulstr,bbs.desc[i]); }
fprintf(out,"\r\n");
fprintf(out,"Entry created on %s by %s\r\n"
,timestr(&bbs.created),bbs.user);
fprintf(out," Last updated on %s\r\n\r\n",timestr(&bbs.updated));
}
void main(int argc, char **argv)
{
char software[16]="";
char telnet_port[16];
int i,in;
FILE *out;
bbs_t bbs;
for(i=1;i<argc;i++)
if(argv[i][0]=='s' && argv[i][1]=='=')
sprintf(software,"%.15s",argv[i]+2);
if((in=open("SBL.DAB",O_RDONLY|O_BINARY))==-1) {
printf("error opening SBL.DAB\n");
return; }
if((out=fopen("SBL.TXT","wb"))==NULL) {
printf("error opening/creating SBL.TXT\n");
return; }
while(!eof(in)) {
read(in,&bbs,sizeof(bbs_t));
if(!bbs.name[0])
continue;
if(software[0] && strnicmp(bbs.software,software,strlen(software)))
continue;
// long_bbs_info(out,bbs);
for(i=0;i<bbs.total_numbers;i++)
if(bbs.number[i].modem.min_rate==0xffff) {
if(bbs.number[i].telnet.port && bbs.number[i].telnet.port!=23)
sprintf(telnet_port,":%u",bbs.number[i].telnet.port);
else
telnet_port[0]=0;
fprintf(out,"%-25.25s telnet://%s%s\r\n"
,bbs.name
,bbs.number[i].telnet.addr
,telnet_port);
} else
fprintf(out,"%-25.25s %12.12s %5u %s\r\n"
,bbs.name,bbs.number[i].modem.number
,bbs.number[i].modem.max_rate
,bbs.number[i].modem.desc);
}
close(in);
fclose(out);
}
/* sbldefs.h */
/* Synchronet BBS List Macros, constants, and type definitions */
/* $Id: sbldefs.h,v 1.11 2013/09/15 09:16:47 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2013 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include "gen_defs.h"
#define MAX_SYSOPS 5
#define MAX_NUMBERS 20
#define MAX_NETS 10
#define MAX_TERMS 5
#define DESC_LINES 5
#define DEF_LIST_FMT "NSTP"
#ifndef IPPORT_TELNET
#define IPPORT_TELNET 23
#endif
#define Y2K_2DIGIT_WINDOW 70
/* Misc bits */
#define FROM_SMB (1L<<0) /* BBS info imported from message base */
#ifdef _WIN32 /* necessary for compatibility with SBL */
#pragma pack(push)
#pragma pack(1)
#endif
#ifndef _PACK
#ifdef __GNUC__
#define _PACK __attribute__ ((packed))
#else
#define _PACK
#endif
#endif
typedef union _PACK {
struct {
char number[13]; /* Phone number */
char desc[16]; /* Modem description */
char location[31]; /* Location of phone number */
uint16_t min_rate; /* Minimum connect rate */
uint16_t max_rate; /* Maximum connect rate */
} modem;
struct {
char addr[29]; /* Telnet address */
char location[31]; /* Location */
uint16_t unused; /* 0xffff */
uint16_t port; /* TCP port number */
} telnet;
} number_t;
typedef struct _PACK {
char name[26] /* System name */
,user[26] /* User who created entry */
,software[16] /* BBS software */
,total_sysops
,sysop[MAX_SYSOPS][26] /* Sysop names */
,total_numbers
,total_networks
,network[MAX_NETS][16] /* Network names */
,address[MAX_NETS][26] /* Network addresses */
,total_terminals
,terminal[MAX_TERMS][16] /* Terminals supported */
,desc[DESC_LINES][51] /* 5 line description */
;
uint16_t nodes /* Total nodes */
,users /* Total users */
,subs /* Total sub-boards */
,dirs /* Total file dirs */
,xtrns /* Total external programs */
;
uint32_t created /* Time/date entry was created */
,updated /* Time/date last updated */
,birth /* Birthdate of BBS */
;
uint32_t megs /* Storage space in megabytes */
,msgs /* Total messages */
,files /* Total files */
,misc /* Miscellaneous bits */
;
number_t number[MAX_NUMBERS]; /* Access numbers */
char userupdated[26]; /* User who last updated */
uint32_t verified; /* Time/Date last vouched for */
char userverified[26]; /* User who last vouched */
char web_url[61]; /* Web-site address */
char sysop_email[61]; /* Sysop's e-mail address */
uint32_t exported; /* Date last exported to SMB */
uint32_t verification_count; /* Number of successful auto-verifications */
uint32_t verification_attempts; /* Number of auto-verification attempts */
char unused[310]; /* Unused space */
} bbs_t;
#ifdef _WIN32
#pragma pack(pop) /* original packing */
#endif
/* End of SBL.H */
#!/bin/sh
. ${SBBSEXEC}unixstub.sh
/* sblpack.c */
/* Synchronet BBS List Database Packer */
/* $Id: sblpack.c,v 1.5 2004/07/16 18:02:41 deuce Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout xtrn *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include <stdio.h>
#include <stdlib.h> /* exit() */
#include <time.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "filewrap.h" /* sopen() */
#include "genwrap.h" /* PLATFORM_DESC */
#include "sbldefs.h"
int main(void)
{
int file;
FILE * in;
FILE * out;
bbs_t bbs;
ulong records=0;
ulong deleted=0;
char revision[16];
sscanf("$Revision: 1.5 $", "%*s %s", revision);
printf("\nSBLPACK %s-%s Copyright 2003 Rob Swindell\n\n"
,revision,PLATFORM_DESC);
if((file=sopen("sbl.dab",O_RDWR|O_BINARY,SH_DENYNO))==-1) {
printf("\n\7Error opening/creating sbl.dab\n");
exit(1); }
if((in=fdopen(file,"w+b"))==NULL) {
printf("\n\7Error converting sbl.dab file handle to stream\n");
exit(1); }
setvbuf(in,0L,_IOFBF,2048);
if((out=fopen("sbl.tmp","wb"))==NULL) {
printf("\n\7Error opening sbl.tmp file\n");
exit(1); }
while(!feof(in)) {
if(!fread(&bbs,sizeof(bbs_t),1,in))
break;
records++;
putchar('.');
if(bbs.name[0]==0
|| bbs.user[0]==0
|| bbs.total_numbers<1) {
deleted++;
continue;
}
fwrite(&bbs,sizeof(bbs_t),1,out);
}
fclose(in);
fclose(out);
putchar('\n');
if(remove("sbl.dab")) {
printf("\n\7Data file in use, can't remove.\n");
remove("sbl.tmp");
exit(1);
}
rename("sbl.tmp","sbl.dab");
printf("\nDone.\n");
printf("\n%lu records in original file, %lu deleted (packed), new total = %lu.\n"
,records,deleted,records-deleted);
return(0);
}
# Microsoft Developer Studio Project File - Name="sblpack" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=sblpack - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "sblpack.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "sblpack.mak" CFG="sblpack - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "sblpack - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "sblpack - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "sblpack - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\sdk" /I "c:\src\xpdev" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "sblpack - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "sblpack___Win32_Debug"
# PROP BASE Intermediate_Dir "sblpack___Win32_Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir ""
# PROP Intermediate_Dir "msvc.win32.debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\sdk" /I "c:\src\xpdev" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "sblpack - Win32 Release"
# Name "sblpack - Win32 Debug"
# Begin Source File
SOURCE=.\sblpack.c
# End Source File
# End Target
# End Project
#!/bin/sh
. ${SBBSEXEC}unixstub.sh
/* smb2sbl.c */
/* Scans SMB message base for messages to "SBL" and adds them to the SBL */
/* $Id: smb2sbl.c,v 1.20 2006/08/07 22:58:01 rswindell Exp $ */
/****************************************************************************
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2000 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation; either version 2 *
* of the License, or (at your option) any later version. *
* See the GNU General Public License for more details: gpl.txt or *
* http://www.fsf.org/copyleft/gpl.html *
* *
* Anonymous FTP access to the most recent released source is available at *
* ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net *
* *
* Anonymous CVS access to the development source and modification history *
* is available at cvs.synchro.net:/cvsroot/sbbs, example: *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login *
* (just hit return, no password is necessary) *
* cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout xtrn *
* *
* For Synchronet coding style and modification guidelines, see *
* http://www.synchro.net/source.html *
* *
* You are encouraged to submit any modifications (preferably in Unix diff *
* format) via e-mail to mods@synchro.net *
* *
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include <time.h> /* struct tm */
#include <fcntl.h> /* O_RDWR */
#include <sys/stat.h> /* S_IWRITE */
#include <ctype.h> /* isdigit */
#include <stdlib.h> /* atoi */
#include <string.h>
#include <errno.h> /* errno */
#include "smblib.h"
#include "sbldefs.h"
#include "genwrap.h" /* PLATFORM_DESC */
#include "dirwrap.h" /* fexist/flength */
#include "filewrap.h" /* O_BINARY */
smb_t smb;
char revision[16];
char *loadmsgtxt(smbmsg_t msg, int tails)
{
char *buf=NULL,*lzhbuf;
ushort xlat;
int i,lzh;
long l=0,lzhlen,length;
for(i=0;i<msg.hdr.total_dfields;i++) {
if(!(msg.dfield[i].type==TEXT_BODY
|| (tails && msg.dfield[i].type==TEXT_TAIL)))
continue;
fseek(smb.sdt_fp,msg.hdr.offset+msg.dfield[i].offset