Skip to content

Commit

Permalink
RVNCd v1.38
Browse files Browse the repository at this point in the history
  • Loading branch information
rolsen74 committed Oct 28, 2024
1 parent 03903b3 commit 76d4500
Show file tree
Hide file tree
Showing 78 changed files with 11,288 additions and 9,728 deletions.
48 changes: 28 additions & 20 deletions ARexx.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

/*
* Copyright (c) 2023-2024 Rene W. Olsen < renewolsen @ gmail . com >
*
* This software is released under the GNU General Public License, version 3.
* For the full text of the license, please visit:
* https://www.gnu.org/licenses/gpl-3.0.html
*
* You can also find a copy of the license in the LICENSE file included with this software.
*/
** SPDX-License-Identifier: GPL-3.0-or-later
** Copyright (c) 2023-2024 Rene W. Olsen <[email protected]>
*/

// --

Expand All @@ -31,6 +26,7 @@ static void ARexx_StopServer( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_RestartServer( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_ServerStatus( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_Quit( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_ForceQuit( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_LoadConfig( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_SaveConfig( struct ARexxCmd *ac, struct RexxMsg *msg );
static void ARexx_SaveASConfig( struct ARexxCmd *ac, struct RexxMsg *msg );
Expand Down Expand Up @@ -60,7 +56,8 @@ static struct ARexxCmd Commands[] =
{ "SAVEASCONFIG", 8, ARexx_SaveASConfig, "FILE/F", 0, NULL, 0, 0, NULL },
{ "SAVEDEFAULTCONFIG", 9, ARexx_SaveDefaultConfig, NULL, 0, NULL, 0, 0, NULL },
{ "HELP", 10, ARexx_Help, NULL, 0, NULL, 0, 0, NULL },
{ NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL },
{ "FORCEQUIT", 11, ARexx_ForceQuit, NULL, 0, NULL, 0, 0, NULL },
{ NULL, 0, NULL, NULL, 0, NULL, 0, 0, NULL },
};

// --
Expand Down Expand Up @@ -100,7 +97,7 @@ int error;
myARexxObject = IIntuition->NewObject( ARexxClass, NULL,
AREXX_ReplyHook, & myARexxHook,
AREXX_ErrorCode, & err,
AREXX_HostName, "RVNCD",
AREXX_HostName, "rVNCd",
AREXX_Commands, Commands,
AREXX_NoSlot, TRUE,
TAG_END
Expand Down Expand Up @@ -174,7 +171,7 @@ int err;
{
ac->ac_Result = "Successful";
}
};
}

// --

Expand All @@ -192,7 +189,7 @@ int err;
{
ac->ac_Result = "Successful";
}
};
}

// --

Expand All @@ -210,7 +207,7 @@ int err;
{
ac->ac_Result = "Successful";
}
};
}

// --

Expand Down Expand Up @@ -240,18 +237,25 @@ char *txt;
}

ac->ac_Result = txt;
};
}

// --

static void ARexx_Quit( struct ARexxCmd *ac, struct RexxMsg *msg UNUSED )
{
ac->ac_Result = "Exiting Program";

ProgramRunning = FALSE;
Func_Quit( ActiveConfig );
}

IExec->Signal( ProgramTask, SIGBREAKF_CTRL_C );
};
// --

static void ARexx_ForceQuit( struct ARexxCmd *ac, struct RexxMsg *msg UNUSED )
{
ac->ac_Result = "Exiting Program";

Func_ForceQuit( ActiveConfig );
}

// --

Expand All @@ -267,7 +271,8 @@ int err;

if ( file )
{
err = Config_ParseFile( ActiveConfig, file );
Config_Reset( ActiveConfig );
err = Config_Read( ActiveConfig, file, TRUE );

if ( err )
{
Expand All @@ -277,6 +282,9 @@ int err;
{
Log_PrintF( ActiveConfig, LOGTYPE_Info, "Config file '%s' loaded", IDOS->FilePart( file ) );

myGUI_Main_RefreshSettings( ActiveConfig );
myGUI_Main_CheckSettings( ActiveConfig );

str = "Successful";

// --
Expand All @@ -300,7 +308,7 @@ int err;

static void ARexx_SaveConfig( struct ARexxCmd *ac UNUSED, struct RexxMsg *msg UNUSED )
{
Config_Save( ActiveConfig, ActiveConfig->cfg_Config_FileName );
Config_Save( ActiveConfig, ActiveConfig->cfg_Config_Filename );
}

// --
Expand Down
26 changes: 17 additions & 9 deletions Action.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

/*
* Copyright (c) 2023-2024 Rene W. Olsen < renewolsen @ gmail . com >
*
* This software is released under the GNU General Public License, version 3.
* For the full text of the license, please visit:
* https://www.gnu.org/licenses/gpl-3.0.html
*
* You can also find a copy of the license in the LICENSE file included with this software.
*/
** SPDX-License-Identifier: GPL-3.0-or-later
** Copyright (c) 2023-2024 Rene W. Olsen <[email protected]>
*/

// --

Expand Down Expand Up @@ -110,6 +105,7 @@ BPTR o;
if (( i ) && ( o ))
{
stat = IDOS->SystemTags( FmtBuffer,
SYS_UserShell, TRUE,
SYS_Asynch, TRUE,
SYS_Output, o,
SYS_Input, i,
Expand Down Expand Up @@ -138,6 +134,8 @@ BPTR o;

void DoAction_ProgramStart( struct Config *cfg UNUSED )
{
printf( "DoAction_ProgramStart\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_ProgramStart );
Expand All @@ -149,6 +147,8 @@ void DoAction_ProgramStart( struct Config *cfg UNUSED )

void DoAction_ProgramStop( struct Config *cfg UNUSED )
{
printf( "DoAction_ProgramStop\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_ProgramStop );
Expand All @@ -160,6 +160,8 @@ void DoAction_ProgramStop( struct Config *cfg UNUSED )

void DoAction_ServerStart( struct Config *cfg UNUSED )
{
printf( "DoAction_ServerStart\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_ServerStart );
Expand All @@ -171,6 +173,8 @@ void DoAction_ServerStart( struct Config *cfg UNUSED )

void DoAction_ServerStop( struct Config *cfg UNUSED )
{
printf( "DoAction_ServerStop\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_ServerStop );
Expand All @@ -182,6 +186,8 @@ void DoAction_ServerStop( struct Config *cfg UNUSED )

void DoAction_UserConnect( struct Config *cfg UNUSED )
{
printf( "DoAction_UserConnect\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_UserConnect );
Expand All @@ -193,6 +199,8 @@ void DoAction_UserConnect( struct Config *cfg UNUSED )

void DoAction_UserDisconnect( struct Config *cfg UNUSED )
{
printf( "DoAction_UserDisconnect\n" );

IExec->ObtainSemaphore( & ActionSema );

myDoCmd( ActionBuffer_UserDisconnect );
Expand Down
Loading

0 comments on commit 76d4500

Please sign in to comment.