mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11464
This commit is contained in:
parent
c73cdd3d74
commit
431da99db5
|
@ -25,7 +25,7 @@ AM_CPPFLAGS = \
|
|||
|
||||
AM_CFLAGS = $(AM_CPPFLAGS)
|
||||
AM_CXXFLAGS = $(AM_CPPFLAGS)
|
||||
AM_LDFLAGS =
|
||||
AM_LDFLAGS = -L../lib
|
||||
|
||||
# dependencies to make sure libs gets compiled before
|
||||
# programs linking to them:
|
||||
|
|
|
@ -12137,3 +12137,17 @@ David 3 Nov 2006
|
|||
clientgui/
|
||||
MainDocument.cpp,h
|
||||
ViewResources.cpp,h
|
||||
|
||||
David 3 Nov 2006
|
||||
- build fix for Gentoo
|
||||
|
||||
Makefile.incl
|
||||
|
||||
David 3 Nov 2006
|
||||
- fix gcc compile warnings
|
||||
|
||||
client/
|
||||
acct_mgr.C,h
|
||||
lib/
|
||||
boinc_cmd.C
|
||||
parse.C,h
|
||||
|
|
|
@ -506,6 +506,35 @@ ACCT_MGR_INFO::ACCT_MGR_INFO() {
|
|||
clear();
|
||||
}
|
||||
|
||||
int ACCT_MGR_INFO::parse_login_file(FILE* p) {
|
||||
char tag[1024];
|
||||
bool is_tag;
|
||||
MIOFILE mf;
|
||||
int retval;
|
||||
|
||||
mf.init_file(p);
|
||||
XML_PARSER xp(&mf);
|
||||
if (!xp.parse_start("acct_mgr_login")) {
|
||||
//
|
||||
}
|
||||
while (!xp.get(tag, sizeof(tag), is_tag)) {
|
||||
if (!is_tag) {
|
||||
printf("unexpected text: %s\n", tag);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(tag, "/acct_mgr_login")) break;
|
||||
else if (xp.parse_str(tag, "login", login_name, 256)) continue;
|
||||
else if (xp.parse_str(tag, "password_hash", password_hash, 256)) continue;
|
||||
else if (xp.parse_str(tag, "previous_host_cpid", previous_host_cpid, sizeof(previous_host_cpid))) continue;
|
||||
else if (xp.parse_double(tag, "next_rpc_time", next_rpc_time)) continue;
|
||||
else if (!strcmp(tag, "opaque")) {
|
||||
retval = xp.element_contents("</opaque>", opaque, sizeof(opaque));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ACCT_MGR_INFO::init() {
|
||||
char tag[1024];
|
||||
bool is_tag;
|
||||
|
@ -539,26 +568,7 @@ int ACCT_MGR_INFO::init() {
|
|||
|
||||
p = fopen(ACCT_MGR_LOGIN_FILENAME, "r");
|
||||
if (p) {
|
||||
mf.init_file(p);
|
||||
XML_PARSER xp(&mf);
|
||||
if (!xp.parse_start("acct_mgr_login")) {
|
||||
//
|
||||
}
|
||||
while (!xp.get(tag, sizeof(tag), is_tag)) {
|
||||
if (!is_tag) {
|
||||
printf("unexpected text: %s\n", tag);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(tag, "/acct_mgr_login")) break;
|
||||
else if (xp.parse_str(tag, "login", login_name, 256)) continue;
|
||||
else if (xp.parse_str(tag, "password_hash", password_hash, 256)) continue;
|
||||
else if (xp.parse_str(tag, "previous_host_cpid", previous_host_cpid, sizeof(previous_host_cpid))) continue;
|
||||
else if (xp.parse_double(tag, "next_rpc_time", next_rpc_time)) continue;
|
||||
else if (!strcmp(tag, "opaque")) {
|
||||
retval = xp.element_contents("</opaque>", opaque, sizeof(opaque));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
parse_login_file(p);
|
||||
fclose(p);
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -51,8 +51,7 @@ struct ACCT_MGR_INFO {
|
|||
bool password_error;
|
||||
|
||||
ACCT_MGR_INFO();
|
||||
int parse_url(MIOFILE&);
|
||||
int parse_login(MIOFILE&);
|
||||
int parse_login_file(FILE*);
|
||||
int write_info();
|
||||
int init();
|
||||
void clear();
|
||||
|
|
|
@ -7,12 +7,12 @@ echo "
|
|||
<ul>
|
||||
<li> <a href=build.php>Software prerequisites</a>
|
||||
<li> <a href=source_code.php>Getting source code</a>
|
||||
<li> <a href=build_system.php>Building BOINC on Unix</a>
|
||||
<li> <a href=road_map.php>Source code road map</a>
|
||||
</ul>
|
||||
|
||||
<h3>Platform-specific cookbooks</h3>
|
||||
<ul>
|
||||
<li> <a href=build_system.php>Building BOINC on Unix</a>
|
||||
<li> <a href=mac_build.html>Building BOINC and BOINC applications on Mac OS X</a>
|
||||
<li> <a href=http://www.spy-hill.net/~myers/help/boinc/boinc-on-windows.html>Building BOINC applications on Windows</a>
|
||||
<li> <a href=http://www.spy-hill.net/~myers/help/boinc/boinc-on-linux.html>Building BOINC and BOINC Applications on Linux</a>
|
||||
|
|
|
@ -49,7 +49,7 @@ Developing a BOINC application
|
|||
</ul>
|
||||
<li> Application development
|
||||
<ul>
|
||||
<li><a href=example.php>Example application</a>
|
||||
<li><a href=example.php>Example applications</a>
|
||||
<li><a href=app_dev.php>Application development tips</a>
|
||||
<li> <a href=app_debug.php>Application debugging</a>
|
||||
</ul>
|
||||
|
|
|
@ -5,9 +5,17 @@ page_head("Example applications");
|
|||
|
||||
echo "
|
||||
Example applications are contained
|
||||
in a separate CVS module, <b>boinc_samples</b>
|
||||
(check this out in the same parent directory as boinc,
|
||||
and the relative paths will work).
|
||||
in a separate CVS module, <b>boinc_samples</b>.
|
||||
To build these applications:
|
||||
<ul>
|
||||
<li> <a href=source_code.php>Get the source code</a>
|
||||
for both boinc and boinc_samples.
|
||||
Put them in the same parent directory;
|
||||
otherwise relative paths won't work.
|
||||
<li> <a href=compile.php>Build the BOINC software</a>
|
||||
(you only need the api/ and lib/ parts of it).
|
||||
</ul>
|
||||
|
||||
The example applications are:
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -36,17 +44,28 @@ Used for testing wrapper.
|
|||
</ul>
|
||||
|
||||
<p>
|
||||
The boinc_samples tree includes project files for
|
||||
building the app on Windows (VS 2003) and Mac (xcode).
|
||||
It also includes a Makefile for building on Linux.
|
||||
For upper_case,
|
||||
this produces a separate .so containing the graphics part.
|
||||
The boinc_samples tree includes project files for the following platforms:
|
||||
<ul>
|
||||
<li> <b>Windows</b>:
|
||||
includes project files for Microsoft Visual Studio 2003 and 2005.
|
||||
Also includes a project file samples.dev
|
||||
for <a href=http://www.bloodshed.net/>Bloodshed<a>,
|
||||
a free development environment for Windows
|
||||
(this project file doesn't work yet).
|
||||
These are in the win_build/ directory.
|
||||
<li> <b>Mac OS X</b>:
|
||||
includes an Xcode project file for upper_case,
|
||||
mac_build/UpperCase.xcodeproj
|
||||
<li> <b>Linux</b>:
|
||||
includes a Makefile for building on Linux.
|
||||
For upper_case, this produces a separate .so containing the graphics part.
|
||||
The Makefile links some libraries statically
|
||||
(stdc++, glut etc.) so that the app will run on machines
|
||||
where these are old or missing.
|
||||
It also uses a technique where the main program
|
||||
exports its symbols to the graphics .so,
|
||||
which eliminates lots of the problems we had in Einstein@home.
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
";
|
||||
|
|
|
@ -448,16 +448,16 @@ int main(int argc, char** argv) {
|
|||
retval = rpc.set_global_prefs_override(s);
|
||||
printf("retval: %d\n", retval);
|
||||
} else if (!strcmp(cmd, "--test3")) {
|
||||
GLOBAL_PREFS p;
|
||||
memset(&p, 0, sizeof(p));
|
||||
retval = rpc.get_global_prefs_override_struct(p);
|
||||
printf("retval %d max %d\n", retval, p.max_cpus);
|
||||
GLOBAL_PREFS gp;
|
||||
memset(&gp, 0, sizeof(gp));
|
||||
retval = rpc.get_global_prefs_override_struct(gp);
|
||||
printf("retval %d max %d\n", retval, gp.max_cpus);
|
||||
} else if (!strcmp(cmd, "--test4")) {
|
||||
GLOBAL_PREFS p;
|
||||
GLOBAL_PREFS gp;
|
||||
GLOBAL_PREFS_MASK m;
|
||||
p.max_cpus = 2;
|
||||
gp.max_cpus = 2;
|
||||
m.max_cpus = true;
|
||||
retval = rpc.set_global_prefs_override_struct(p, m);
|
||||
retval = rpc.set_global_prefs_override_struct(gp, m);
|
||||
printf("retval %d\n", retval);
|
||||
} else if (!strcmp(cmd, "--quit")) {
|
||||
retval = rpc.quit();
|
||||
|
|
12
lib/parse.C
12
lib/parse.C
|
@ -500,7 +500,7 @@ bool XML_PARSER::get(char* buf, int len, bool& is_tag) {
|
|||
// and return true.
|
||||
//
|
||||
bool XML_PARSER::parse_str(
|
||||
char* parsed_tag, char* start_tag, char* buf, int len
|
||||
char* parsed_tag, const char* start_tag, char* buf, int len
|
||||
) {
|
||||
bool is_tag, eof;
|
||||
char end_tag[256], tag[256], tmp[64000];
|
||||
|
@ -546,7 +546,7 @@ bool XML_PARSER::parse_str(
|
|||
}
|
||||
|
||||
bool XML_PARSER::parse_string(
|
||||
char* parsed_tag, char* start_tag, string& str
|
||||
char* parsed_tag, const char* start_tag, string& str
|
||||
) {
|
||||
char buf[8192];
|
||||
bool flag = parse_str(parsed_tag, start_tag, buf, sizeof(buf));
|
||||
|
@ -557,7 +557,7 @@ bool XML_PARSER::parse_string(
|
|||
|
||||
// Same, for integers
|
||||
//
|
||||
bool XML_PARSER::parse_int(char* parsed_tag, char* start_tag, int& i) {
|
||||
bool XML_PARSER::parse_int(char* parsed_tag, const char* start_tag, int& i) {
|
||||
char buf[256], *end;
|
||||
bool is_tag, eof;
|
||||
char end_tag[256], tag[256];
|
||||
|
@ -581,7 +581,7 @@ bool XML_PARSER::parse_int(char* parsed_tag, char* start_tag, int& i) {
|
|||
|
||||
// Same, for doubles
|
||||
//
|
||||
bool XML_PARSER::parse_double(char* parsed_tag, char* start_tag, double& x) {
|
||||
bool XML_PARSER::parse_double(char* parsed_tag, const char* start_tag, double& x) {
|
||||
char buf[256], *end;
|
||||
bool is_tag, eof;
|
||||
char end_tag[256], tag[256];
|
||||
|
@ -605,7 +605,7 @@ bool XML_PARSER::parse_double(char* parsed_tag, char* start_tag, double& x) {
|
|||
|
||||
// Same, for bools
|
||||
//
|
||||
bool XML_PARSER::parse_bool(char* parsed_tag, char* start_tag, bool& b) {
|
||||
bool XML_PARSER::parse_bool(char* parsed_tag, const char* start_tag, bool& b) {
|
||||
char buf[256], *end;
|
||||
bool is_tag, eof;
|
||||
char end_tag[256], tag[256];
|
||||
|
@ -640,7 +640,7 @@ bool XML_PARSER::parse_bool(char* parsed_tag, char* start_tag, bool& b) {
|
|||
|
||||
// parse a start tag (optionally preceded by <?xml>)
|
||||
//
|
||||
bool XML_PARSER::parse_start(char* start_tag) {
|
||||
bool XML_PARSER::parse_start(const char* start_tag) {
|
||||
char tag[256];
|
||||
bool eof, is_tag;
|
||||
|
||||
|
|
12
lib/parse.h
12
lib/parse.h
|
@ -43,12 +43,12 @@ class XML_PARSER {
|
|||
public:
|
||||
XML_PARSER(MIOFILE*);
|
||||
bool get(char*, int, bool&);
|
||||
bool parse_start(char*);
|
||||
bool parse_str(char*, char*, char*, int);
|
||||
bool parse_string(char*, char*, std::string&);
|
||||
bool parse_int(char*, char*, int&);
|
||||
bool parse_double(char*, char*, double&);
|
||||
bool parse_bool(char*, char*, bool&);
|
||||
bool parse_start(const char*);
|
||||
bool parse_str(char*, const char*, char*, int);
|
||||
bool parse_string(char*, const char*, std::string&);
|
||||
bool parse_int(char*, const char*, int&);
|
||||
bool parse_double(char*, const char*, double&);
|
||||
bool parse_bool(char*, const char*, bool&);
|
||||
int element_contents(const char*, char*, int);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue