Changes between Version 1 and Version 2 of BasicApi
- Timestamp:
- Apr 23, 2007, 4:46:19 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BasicApi
v1 v2 4 4 The BOINC API is a set of C++ functions. Most of the functions have a C interface, so that they can be used from programs written in C and other languages. Unless otherwise specified, the functions return an integer error code; zero indicates success. 5 5 6 BOINC applications may generate graphics, allowing them to provide a screensaver. This API is described [GraphicsApi here].7 8 BOINC applications may consist of several programs that are executed in sequence; these are called compound applications. This API is described [http://boinc.berkeley.edu/compound_app.php here].6 BOINC applications may generate graphics, allowing them to provide a screensaver. See the [GraphicsApi graphics API]. 7 8 BOINC applications may consist of several programs that are executed in sequence; these are called compound applications. See the [GraphicsApi compound application API]. 9 9 10 10 == Initialization and termination == … … 71 71 == I/O wrappers == 72 72 73 Applications should replace fopen()calls with73 Applications should replace `fopen()` calls with 74 74 75 75 {{{ … … 77 77 }}} 78 78 79 This deals with platform-specific problems. On Windows, where security and indexing programs can briefly lock files, boinc_fopen() does several retries at 1-second intervals. On Unix, where signals can cause fopen() to fail with EINTR, boinc_fopenchecks for this and does a few retries; it also sets the 'close-on-exec' flag.79 This deals with platform-specific problems. On Windows, where security and indexing programs can briefly lock files, `boinc_fopen()` does several retries at 1-second intervals. On Unix, where signals can cause `fopen()` to fail with EINTR, `boinc_fopen` checks for this and does a few retries; it also sets the 'close-on-exec' flag. 80 80 81 81 == Checkpointing == … … 108 108 == Atomic file update == 109 109 110 To facilitate atomic checkpoint, an application can write to output and state files using the MFILEclass.110 To facilitate atomic checkpoint, an application can write to output and state files using the `MFILE` class. 111 111 112 112 {{{ … … 155 155 }}} 156 156 157 returns the last value set, or -1if none has been set (this would typically be called from graphics code).157 returns the last value set, or `-1` if none has been set (this would typically be called from graphics code). 158 158 159 159 The following functions get information from the core client; this information may be useful for graphics. … … 208 208 209 209 ||'''core version'''||The version number of the core client|| 210 ||'''app_name'''||The application name (from the server's DB ||210 ||'''app_name'''||The application name (from the server's DB)|| 211 211 ||'''project_preferences'''||An XML string containing the user's project-specific preferences.|| 212 212 ||'''user_name'''||The user's 'screen name' on this project.|| … … 233 233 == Requesting network connection == 234 234 235 If it appears that there is no physical network connection (e.g. gethostbyname() fails for a valid name) then 235 If it appears that there is no physical network connection (e.g. gethostbyname() fails for a valid name) then: 236 236 237 237 * Call `boinc_need_network()`. This will alert the user that a network connection is needed.