Skip to content

Commit

Permalink
more OS2 work
Browse files Browse the repository at this point in the history
  • Loading branch information
wwiv committed Apr 30, 2021
1 parent 008a6a1 commit e8ef877
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 151 deletions.
266 changes: 122 additions & 144 deletions bbs/CMakeLists.txt
@@ -1,121 +1,117 @@
# CMake for WWIV
include_directories(../deps/cl345)
include_directories(../deps/cereal/include)

set(COMMON_SOURCES
acs.cpp
application.cpp
archivers.cpp
attach.cpp
automsg.cpp
batch.cpp
bbs.cpp
bbs_event_handlers.cpp
bbslist.cpp
bbsovl1.cpp
bbsovl2.cpp
bbsovl3.cpp
bbsutl.cpp
bbsutl1.cpp
bbsutl2.cpp
chains.cpp
chat.cpp
chnedit.cpp
conf.cpp
confutil.cpp
connect1.cpp
crc.cpp
defaults.cpp
diredit.cpp
dirlist.cpp
dropfile.cpp
dsz.cpp
email.cpp
execexternal.cpp
external_edit.cpp
external_edit_qbbs.cpp
external_edit_wwiv.cpp
extract.cpp
finduser.cpp
gfiles.cpp
gfileedit.cpp
hop.cpp
inetmsg.cpp
inmsg.cpp
instmsg.cpp
interpret.cpp
lilo.cpp
listplus.cpp
lpfunc.cpp
misccmd.cpp
message_file.cpp
message_find.cpp
mmkey.cpp
msgbase1.cpp
msgscan.cpp
multinst.cpp
multmail.cpp
netsup.cpp
newuser.cpp
normupld.cpp
save_qscan.cpp
readmail.cpp
read_message.cpp
shortmsg.cpp
showfiles.cpp
sr.cpp
srrcv.cpp
srsend.cpp
stuffin.cpp
subacc.cpp
subedit.cpp
sublist.cpp
subreq.cpp
syschat.cpp
sysopf.cpp
sysoplog.cpp
trashcan.cpp
trytoul.cpp
uedit.cpp
utility.cpp
valscan.cpp
vote.cpp
voteedit.cpp
wqscn.cpp
xfer.cpp
xferovl.cpp
xferovl1.cpp
xfertmp.cpp
xinit.cpp
wfc.cpp
basic/basic.cpp
basic/util.cpp
basic/wwiv.cpp
basic/wwiv_data.cpp
basic/wwiv_file.cpp
basic/wwiv_io.cpp
basic/wwiv_os.cpp
basic/wwiv_time.cpp
../deps/my_basic/core/my_basic.c
menus/config_menus.cpp
menus/mainmenu.cpp
menus/menucommands.cpp
menus/menuspec.cpp
menus/menusupp.cpp
menus/printcommands.cpp
qwk/qwk.cpp
qwk/qwk_email.cpp
qwk/qwk_mail_packet.cpp
qwk/qwk_reply.cpp
qwk/qwk_text.cpp
qwk/qwk_ui.cpp
qwk/qwk_util.cpp
)

set(BBS_MAIN bbs_main.cpp)

include_directories(prot)
set(ZMODEM_SOURCES

add_library(
bbs_lib
acs.cpp
application.cpp
archivers.cpp
attach.cpp
automsg.cpp
batch.cpp
bbs.cpp
bbs_event_handlers.cpp
bbslist.cpp
bbsovl1.cpp
bbsovl2.cpp
bbsovl3.cpp
bbsutl.cpp
bbsutl1.cpp
bbsutl2.cpp
chains.cpp
chat.cpp
chnedit.cpp
conf.cpp
confutil.cpp
connect1.cpp
crc.cpp
defaults.cpp
diredit.cpp
dirlist.cpp
dropfile.cpp
dsz.cpp
email.cpp
execexternal.cpp
external_edit.cpp
external_edit_qbbs.cpp
external_edit_wwiv.cpp
extract.cpp
finduser.cpp
gfiles.cpp
gfileedit.cpp
hop.cpp
inetmsg.cpp
inmsg.cpp
instmsg.cpp
interpret.cpp
lilo.cpp
listplus.cpp
lpfunc.cpp
misccmd.cpp
message_file.cpp
message_find.cpp
mmkey.cpp
msgbase1.cpp
msgscan.cpp
multinst.cpp
multmail.cpp
netsup.cpp
newuser.cpp
normupld.cpp
save_qscan.cpp
readmail.cpp
read_message.cpp
shortmsg.cpp
showfiles.cpp
sr.cpp
srrcv.cpp
srsend.cpp
stuffin.cpp
subacc.cpp
subedit.cpp
sublist.cpp
subreq.cpp
syschat.cpp
sysopf.cpp
sysoplog.cpp
trashcan.cpp
trytoul.cpp
uedit.cpp
utility.cpp
valscan.cpp
vote.cpp
voteedit.cpp
wqscn.cpp
xfer.cpp
xferovl.cpp
xferovl1.cpp
xfertmp.cpp
xinit.cpp
wfc.cpp
basic/basic.cpp
basic/util.cpp
basic/wwiv.cpp
basic/wwiv_data.cpp
basic/wwiv_file.cpp
basic/wwiv_io.cpp
basic/wwiv_os.cpp
basic/wwiv_time.cpp
../deps/my_basic/core/my_basic.c
menus/config_menus.cpp
menus/mainmenu.cpp
menus/menucommands.cpp
menus/menuspec.cpp
menus/menusupp.cpp
menus/printcommands.cpp
qwk/qwk.cpp
qwk/qwk_email.cpp
qwk/qwk_mail_packet.cpp
qwk/qwk_reply.cpp
qwk/qwk_text.cpp
qwk/qwk_ui.cpp
qwk/qwk_util.cpp
prot/crctab.cpp
prot/zmodem.cpp
prot/zmodemcrc.cpp
Expand All @@ -126,48 +122,34 @@ set(ZMODEM_SOURCES
)

if (WWIV_SSH_CRYPTLIB AND NOT OS2)
list(APPEND COMMON_SOURCES "ssh.cpp")
target_sources(bbs_lib PRIVATE ssh.cpp)
target_link_libraries(bbs_lib CL345_LIB)

endif()

if(UNIX)
set(PLATFORM_SOURCES
exec_unix.cpp
target_sources(bbs_lib PRIVATE
exec_unix.cpp
make_abs_cmd_unix.cpp
)
find_package (Threads)
set(FORKPTY_LIB util)

)
if(CMAKE_SYSTEM_NAME MATCHES "SunOS.*")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-lsocket -lnsl -lkstat -lssp")
endif()

set(PLATFORM_LIBS
z
${CMAKE_DL_LIBS}
)
find_package (Threads)
target_link_libraries(bbs_lib z util ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})

endif()

if(WIN32)
set(
PLATFORM_SOURCES
exec_win32.cpp
make_abs_cmd_win32.cpp
)

set(
PLATFORM_LIBS
target_sources(bbs_lib PRIVATE
exec_win32.cpp
make_abs_cmd_win32.cpp
)

SET_MSVC_WARNING_LEVEL_4()
endif()

add_library(
bbs_lib
${COMMON_SOURCES}
${ZMODEM_SOURCES}
${PLATFORM_SOURCES}
)

if (WWIV_SSH_CRYPTLIB AND NOT OS2)
target_compile_definitions(bbs_lib PRIVATE WWIV_HAS_SSH_CRYPTLIB)
Expand All @@ -181,11 +163,7 @@ target_link_libraries(
core
fsed
sdk
CL345_LIB
${CMAKE_THREAD_LIBS_INIT}
${FORKPTY_LIB}
${PLATFORM_LIBS}
)

add_executable(bbs ${BBS_MAIN})
add_executable(bbs bbs_main.cpp)
target_link_libraries(bbs bbs_lib fmt::fmt-header-only)
2 changes: 1 addition & 1 deletion cmake/FindWWIVCurses.cmake
Expand Up @@ -12,6 +12,6 @@ elseif(WIN32 OR OS2)
# message("FindWWIVCurses: Using PDCurses")
include_directories(${PDCURSES_INCLUDE_DIRS})
# message("FindWWIVCurses: PDCURSES_INCLUDE_DIRS: ${PDCURSES_INCLUDE_DIRS}")
# message("FindWWIVCurses: CURSES_LIBRARIES: ${CURSES_LIBRARIES}")
message("FindWWIVCurses: CURSES_LIBRARIES: ${CURSES_LIBRARIES}")
endif()
# message("FindWWIVCurses: Curses Library: ${CURSES_LIBRARIES}")
11 changes: 5 additions & 6 deletions core/CMakeLists.txt
@@ -1,6 +1,6 @@
# CMake for WWIV

set(COMMON_SOURCES
add_library(core
clock.cpp
cp437.cpp
crc32.cpp
Expand Down Expand Up @@ -35,28 +35,27 @@ set(COMMON_SOURCES
)

if(UNIX)
set(PLATFORM_SOURCES
target_sources(core PRIVATE
file_unix.cpp
os_unix.cpp
wfndfile_unix.cpp
)
)
endif()

if(WIN32)
include(FindWWIVCurses)

set(PLATFORM_SOURCES
target_sources(core PRIVATE
file_win32.cpp
os_win.cpp
wfndfile_win32.cpp
)
)
endif()

set_max_warnings()

configure_file(version_internal.h.in version_internal.h @ONLY)

add_library(core ${COMMON_SOURCES} ${PLATFORM_SOURCES})
#target_compile_options(core PRIVATE /fsanitize=address)
target_link_libraries(core fmt::fmt-header-only)
target_include_directories(core PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
Expand Down
34 changes: 34 additions & 0 deletions core/file_os2.cpp
@@ -0,0 +1,34 @@
/**************************************************************************/
/* */
/* WWIV Version 5.x */
/* Copyright (C)2021, WWIV Software Services */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
/* You may obtain a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, */
/* software distributed under the License is distributed on an */
/* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, */
/* either express or implied. See the License for the specific */
/* language governing permissions and limitations under the License. */
/* */
/**************************************************************************/
#include "core/file.h"

#include <share.h>

namespace wwiv::core {

const int File::shareDenyReadWrite = SH_DENYRW;
const int File::shareDenyWrite = SH_DENYWR;
const int File::shareDenyRead = SH_DENYRD;
const int File::shareDenyNone = SH_DENYNO;

const int File::permReadWrite = (_S_IREAD | _S_IWRITE);

const char File::pathSeparatorChar = '\\';

} // namespace wwiv

0 comments on commit e8ef877

Please sign in to comment.