*** empty log message ***

svn path=/trunk/boinc/; revision=3523
This commit is contained in:
Rom Walton 2004-06-10 07:49:50 +00:00
parent 68798ed6d8
commit e1196c0b28
17 changed files with 409 additions and 19 deletions

View File

@ -13201,3 +13201,18 @@ David 9 June 2004
explain_state.php
info.php
Rom 9 June 2004
- Put together the gui rpc testing application for Windows.
- Fix a bug or two with yesterdays checkin.
client/
gui_rpc_client.C, .h
gui_test.C
main.C
stdafx.cpp, .h
lib/
filesys.C
parse.h
win_build/
*.vcproj

View File

@ -1,3 +1,27 @@
// The contents of this file are subject to the BOINC Public License
// Version 1.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://boinc.berkeley.edu/license_1.0.txt
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
//
// The Initial Developer of the Original Code is the SETI@home project.
// Portions created by the SETI@home project are Copyright (C) 2002
// University of California at Berkeley. All Rights Reserved.
//
// Contributor(s):
//
#ifdef _WIN32
#include "stdafx.h"
#endif
#ifndef _WIN32
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -6,6 +30,7 @@
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#endif
#include "parse.h"
#include "error_numbers.h"
@ -16,16 +41,24 @@ int RPC_CLIENT::init(char* path) {
sockaddr_in addr;
addr.sin_family = AF_INET;
addr.sin_port = htons(GUI_RPC_PORT);
addr.sin_addr.s_addr = htonl(INADDR_ANY);
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
sock = socket(AF_INET, SOCK_STREAM, 0);
retval = connect(sock, (const sockaddr*)(&addr), sizeof(addr));
if (retval) {
retval = WSAGetLastError();
perror("connect");
exit(1);
}
#ifdef _WIN32
fin = fdopen(dup(_open_osfhandle(sock, _O_RDONLY)), "r");
fout = fdopen(_open_osfhandle(sock, _O_WRONLY), "w");
#else
fin = fdopen(dup(sock), "r");
fout = fdopen(sock, "w");
#endif
return 0;
}
RPC_CLIENT::~RPC_CLIENT() {
@ -35,7 +68,6 @@ RPC_CLIENT::~RPC_CLIENT() {
int RPC_CLIENT::get_state() {
char buf[256];
int retval;
PROJECT* project;
fprintf(fout, "<get_state/>\n");
@ -448,3 +480,4 @@ APP_VERSION* RPC_CLIENT::lookup_app_version(string& str, int version_num) {
}
return 0;
}

View File

@ -17,12 +17,14 @@
// Contributor(s):
//
#ifndef _WIN32
#include <stdio.h>
#include <string>
#include <vector>
using std::string;
using std::vector;
#endif
#define GUI_RPC_PORT 31416

View File

@ -1,15 +1,70 @@
// The contents of this file are subject to the BOINC Public License
// Version 1.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://boinc.berkeley.edu/license_1.0.txt
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
//
// The Initial Developer of the Original Code is the SETI@home project.
// Portions created by the SETI@home project are Copyright (C) 2002
// University of California at Berkeley. All Rights Reserved.
//
// Contributor(s):
//
// gui_test: test program for BOINC GUI RPCs.
// Does a single RPC and shows results
#ifdef _WIN32
#include "stdafx.h"
#include "win_net.h"
#endif
#ifndef _WIN32
#include <stdio.h>
#endif
#include "gui_rpc_client.h"
#include "error_numbers.h"
#ifdef _WIN32
int WinsockInitialize()
{
WSADATA wsdata;
return WSAStartup( MAKEWORD( 1, 1 ), &wsdata);
}
int WinsockCleanup()
{
return WSACleanup();
}
#endif
int main(int argc, char** argv) {
main(int argc, char** argv) {
RPC_CLIENT rpc;
unsigned int i;
vector<MESSAGE_DESC> message_descs;
#ifdef _WIN32
// Initialize WinSock
if ( WinsockInitialize() != 0 ) {
printf(
"BOINC Core Client Error Message\n"
"Failed to initialize the Windows Sockets interface\n"
"Terminating Application...\n"
);
return ERR_IO;
}
#endif
rpc.init("gui_rpc");
rpc.get_state();
rpc.print();
@ -20,4 +75,17 @@ main(int argc, char** argv) {
md.project.c_str(), md.priority, md.timestamp, md.body.c_str()
);
}
#ifdef _WIN32
if ( WinsockCleanup() != 0 ) {
printf(
"BOINC Core Client Error Message\n"
"Failed to cleanup the Windows Sockets interface\n"
);
return ERR_IO;
}
#endif
return 0;
}

View File

@ -350,7 +350,7 @@ int main(int argc, char** argv) {
retval = boinc_main_loop(argc, argv);
}
if ( WinsockInitialize() != 0 ) {
if ( WinsockCleanup() != 0 ) {
printf(
"BOINC Core Client Error Message\n"
"Failed to cleanup the Windows Sockets interface\n"

View File

@ -1,7 +1,28 @@
// The contents of this file are subject to the BOINC Public License
// Version 1.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://boinc.berkeley.edu/license_1.0.txt
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
//
// The Initial Developer of the Original Code is the SETI@home project.
// Portions created by the SETI@home project are Copyright (C) 2002
// University of California at Berkeley. All Rights Reserved.
//
// Contributor(s):
//
// stdafx.cpp : source file that includes just the standard includes
// Test.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#ifdef _WIN32
#include "stdafx.h"
#endif

View File

@ -1,9 +1,26 @@
// The contents of this file are subject to the BOINC Public License
// Version 1.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://boinc.berkeley.edu/license_1.0.txt
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
// License for the specific language governing rights and limitations
// under the License.
//
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
//
// The Initial Developer of the Original Code is the SETI@home project.
// Portions created by the SETI@home project are Copyright (C) 2002
// University of California at Berkeley. All Rights Reserved.
//
// Contributor(s):
//
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#pragma once
#ifndef _STDAFX_H_
#define _STDAFX_H_

View File

@ -404,6 +404,7 @@ int boinc_copy(const char* orig, const char* newf) {
int boinc_rename(const char* old, const char* newf) {
#ifdef _WIN32
int retval=0;
boinc_delete_file(newf);
for (int i=0; i<5; i++) {
retval = rename(old, newf);

View File

@ -17,11 +17,12 @@
// Contributor(s):
//
#ifndef _WIN32
#include <cstdio>
#include <cstdlib>
#include <string>
using namespace std;
#endif
extern bool parse(char* , char* );
extern bool parse_int(const char* buf, const char*tag, int&);

View File

@ -28,7 +28,7 @@
PrecompiledHeaderFile=".\Build\Debug\RSAEuro\obj/RSAEuro.pch"
AssemblerListingLocation=".\Build\Debug\RSAEuro\obj/"
ObjectFile=".\Build\Debug\RSAEuro\obj/"
ProgramDataBaseFileName=".\Build\Debug\RSAEuro\obj/"
ProgramDataBaseFileName=".\Build\Debug\RSAEuro\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"

View File

@ -29,6 +29,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upper_case", "upper_case.vc
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc_guirpc_test", "boinc_guirpc_test.vcproj", "{DA997BD1-B575-465C-9851-EEBB727F506A}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
@ -59,8 +63,10 @@ Global
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Debug.Build.0 = Debug|Win32
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Release.ActiveCfg = Release|Win32
{48FB07D8-6E26-4BB1-98AB-22001C0FB0FF}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionItems) = postSolution
{DA997BD1-B575-465C-9851-EEBB727F506A}.Debug.ActiveCfg = Debug|Win32
{DA997BD1-B575-465C-9851-EEBB727F506A}.Debug.Build.0 = Debug|Win32
{DA997BD1-B575-465C-9851-EEBB727F506A}.Release.ActiveCfg = Release|Win32
{DA997BD1-B575-465C-9851-EEBB727F506A}.Release.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection

View File

@ -32,7 +32,7 @@
PrecompiledHeaderFile=".\Build\Debug\boinc_cli\obj/boinc_cli.pch"
AssemblerListingLocation=".\Build\Debug\boinc_cli\obj/"
ObjectFile=".\Build\Debug\boinc_cli\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_cli\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_cli\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"

View File

@ -29,7 +29,7 @@
PrecompiledHeaderFile=".\Build\Debug\boinc_dll\obj/boinc_dll.pch"
AssemblerListingLocation=".\Build\Debug\boinc_dll\obj/"
ObjectFile=".\Build\Debug\boinc_dll\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_dll\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_dll\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"

View File

@ -104,7 +104,7 @@
PrecompiledHeaderFile=".\Build\Debug\boinc_gui\obj/boinc_gui.pch"
AssemblerListingLocation=".\Build\Debug\boinc_gui\obj/"
ObjectFile=".\Build\Debug\boinc_gui\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_gui\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_gui\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
@ -1366,10 +1366,10 @@
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
<File
RelativePath="..\client\win\boinc.bmp">
RelativePath="..\client\win\res\boinc.bmp">
</File>
<File
RelativePath="..\client\win\res\boinc.bmp">
RelativePath="..\client\win\boinc.bmp">
</File>
<File
RelativePath="..\client\win\boinc_gui.rc">
@ -1389,10 +1389,10 @@
</FileConfiguration>
</File>
<File
RelativePath="..\client\win\res\boincsm.bmp">
RelativePath="..\client\win\boincsm.bmp">
</File>
<File
RelativePath="..\client\win\boincsm.bmp">
RelativePath="..\client\win\res\boincsm.bmp">
</File>
<File
RelativePath="..\res\CoreClient.ico">

View File

@ -0,0 +1,226 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="boinc_guirpctest"
RootNamespace="boinc_guirpctest"
SccProjectName=""
SccLocalPath="">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Build\Debug"
IntermediateDirectory=".\Build\Debug\boinc_guirpctest\obj"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../lib/,../api/,../RSAEuro/source/,../client/win/,../client"
PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
RuntimeTypeInfo="FALSE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="../client/StdAfx.h"
PrecompiledHeaderFile=".\Build\Debug\boinc_guirpctest\obj/boinc_guirpctest.pch"
AssemblerListingLocation=".\Build\Debug\boinc_guirpctest\obj/"
ObjectFile=".\Build\Debug\boinc_guirpctest\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_guirpctest\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="2"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libcmtd.lib libcpmtd.lib kernel32.lib user32.lib advapi32.lib wsock32.lib wininet.lib winmm.lib oldnames.lib"
OutputFile=".\Build\Debug/boinc_guirpctest.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreAllDefaultLibraries="TRUE"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Build\Debug/boinc_guirpctest.pdb"
SubSystem="1"
OptimizeReferences="0"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Build\Debug/boinc_guirpctest.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Build\Release"
IntermediateDirectory=".\Build\Release\boinc_guirpctest\obj"
ConfigurationType="1"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="FALSE"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../lib/,../api/,../RSAEuro/source/,../client/win/,../client"
PreprocessorDefinitions="WIN32;NDEBUG;_MT;_WINDOWS;_CONSOLE"
StringPooling="TRUE"
RuntimeLibrary="0"
EnableFunctionLevelLinking="TRUE"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="../client/StdAfx.h"
PrecompiledHeaderFile=".\Build\Release\boinc_guirpctest\obj/boinc_guirpctest.pch"
AssemblerListingLocation=".\Build\Release\boinc_guirpctest\obj/"
ObjectFile=".\Build\Release\boinc_guirpctest\obj/"
ProgramDataBaseFileName=".\Build\Release\boinc_guirpctest\obj/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="3"
CompileAs="2"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="kernel32.lib user32.lib advapi32.lib wsock32.lib wininet.lib winmm.lib libcmt.lib libcpmt.lib oldnames.lib"
ShowProgress="0"
OutputFile=".\Build\Release/boinc_guirpctest.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
IgnoreAllDefaultLibraries="TRUE"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="TRUE"
ProgramDatabaseFile=".\Build\Release/boinc_guirpctest.pdb"
SubSystem="1"
OptimizeReferences="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName=".\Build\Release/boinc_guirpctest.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
<File
RelativePath="..\client\gui_rpc_client.C">
</File>
<File
RelativePath="..\client\gui_test.C">
</File>
<File
RelativePath="..\Lib\parse.C">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"
CompileAs="2"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
CompileAs="2"/>
</FileConfiguration>
</File>
<File
RelativePath="..\client\stdafx.cpp">
</File>
<File
RelativePath="..\lib\util.C">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl">
<File
RelativePath="..\lib\error_numbers.h">
</File>
<File
RelativePath="..\client\gui_rpc_client.h">
</File>
<File
RelativePath="..\lib\parse.h">
</File>
<File
RelativePath="..\client\stdafx.h">
</File>
<File
RelativePath="..\lib\util.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@ -30,7 +30,7 @@
PrecompiledHeaderFile=".\Build\Debug\boinc_ss\obj/boinc_ss.pch"
AssemblerListingLocation=".\Build\Debug\boinc_ss\obj/"
ObjectFile=".\Build\Debug\boinc_ss\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_ss\obj/"
ProgramDataBaseFileName=".\Build\Debug\boinc_ss\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"

View File

@ -95,7 +95,7 @@
PrecompiledHeaderFile=".\Build\Debug\upper_case\obj/upper_case.pch"
AssemblerListingLocation=".\Build\Debug\upper_case\obj/"
ObjectFile=".\Build\Debug\upper_case\obj/"
ProgramDataBaseFileName=".\Build\Debug\upper_case\obj/"
ProgramDataBaseFileName=".\Build\Debug\upper_case\obj/vc70.pdb"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="TRUE"