~ubuntu-branches/ubuntu/lucid/boinc/lucid

« back to all changes in this revision

Viewing changes to db/db_base.h

  • Committer: Bazaar Package Importer
  • Author(s): Frank S. Thomas, Frank S. Thomas
  • Date: 2008-05-31 08:02:47 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080531080247-4ce890lp2rc768cr
Tags: 6.2.7-1
[ Frank S. Thomas ]
* New upstream release.
  - BOINC Manager: Redraw disk usage charts immediately after connecting to
    a (different) client. (closes: 463823)
* debian/copyright:
  - Added the instructions from debian/README.Debian-source about how
    repackaged BOINC tarballs can be reproduced because DevRef now
    recommends to put this here instead of in the afore-mentioned file.
  - Updated for the new release.
* Removed the obsolete debian/README.Debian-source.
* For consistency upstream renamed the core client and the command tool
  ("boinc_client" to "boinc" and "boinc_cmd" to "boinccmd"). Done the same
  in all packages and created symlinks with the old names for the binaries
  and man pages. Also added an entry in debian/boinc-client.NEWS explaining
  this change.
* debian/rules: Do not list Makefile.ins in the clean target individually,
  just remove all that can be found.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
// To view the GNU Lesser General Public License visit
16
16
// http://www.gnu.org/copyleft/lesser.html
17
17
// or write to the Free Software Foundation, Inc.,
18
 
// 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
// 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 
20
20
#ifndef _DB_BASE_
21
21
#define _DB_BASE_
22
22
 
 
23
#include <cstdlib>
 
24
#include <string>
23
25
#include <mysql.h>
24
26
 
25
27
// if SQL columns are not 'not null', you must use these safe_atoi, safe_atof
31
33
    return atoi(s);
32
34
}
33
35
 
34
 
inline float safe_atof(const char* s) {
 
36
inline double safe_atof(const char* s) {
35
37
    if (!s) return 0;
36
38
    return atof(s);
37
39
}
78
80
 
79
81
    MYSQL* mysql;
80
82
    int start_transaction();
 
83
    int rollback_transaction();
81
84
    int commit_transaction();
82
85
};
83
86
 
91
94
    int insert();
92
95
    int insert_batch(std::string&);
93
96
    int update();
94
 
    int update_field(const char*);
 
97
    int update_field(const char*, const char* where_clause=NULL);
95
98
    int delete_from_db();
96
99
    int get_field_int(const char*, int&);
97
100
    int get_field_str(const char*, char*, int);
104
107
    int sum(double&, const char* field, const char* clause="");
105
108
    int get_double(const char* query, double&);
106
109
    int get_integer(const char* query, int&);
107
 
    bool is_high_priority;
 
110
    int affected_rows();
108
111
 
109
112
    DB_CONN* db;
110
113
    const char *table_name;