diff --git a/db/boinc_db.cpp b/db/boinc_db.cpp index 69ddc9ab38..70af8133cd 100644 --- a/db/boinc_db.cpp +++ b/db/boinc_db.cpp @@ -112,6 +112,7 @@ void BADGE_USER::clear() {memset(this, 0, sizeof(*this));} void BADGE_TEAM::clear() {memset(this, 0, sizeof(*this));} void CREDIT_USER::clear() {memset(this, 0, sizeof(*this));} void CREDIT_TEAM::clear() {memset(this, 0, sizeof(*this));} +void CONSENT_TYPE::clear() {memset(this, 0, sizeof(*this));} DB_PLATFORM::DB_PLATFORM(DB_CONN* dc) : DB_BASE("platform", dc?dc:&boinc_db){} @@ -2865,4 +2866,33 @@ void DB_CREDIT_TEAM::db_parse(MYSQL_ROW &r) { credit_type = atoi(r[i++]); } +void DB_CONSENT_TYPE::db_print(char *buf) { + sprintf(buf, + "id=%lu, " + "shortname='%s', " + "description='%s', " + "enabled=%d, " + "protected=%d, " + "privacypref=%d, ", + id, + shortname, + description, + enabled, + protectedct, + privacypref + ); +} + +void DB_CONSENT_TYPE::db_parse(MYSQL_ROW &r) { + int i=0; + clear(); + id = atol(r[i++]); + strcpy2(shortname, r[i++]); + strcpy2(description, r[i++]); + enabled = atoi(r[i++]); + protectedct = atoi(r[i++]); + privacypref = atoi(r[i++]); +} + + const char *BOINC_RCSID_ac374386c8 = "$Id$"; diff --git a/db/boinc_db.h b/db/boinc_db.h index 1f62ed1356..606081f341 100644 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -568,4 +568,12 @@ struct DB_CREDIT_TEAM : public DB_BASE, public CREDIT_TEAM { void db_parse(MYSQL_ROW&); }; +struct DB_CONSENT_TYPE : public DB_BASE, public CONSENT_TYPE { + DB_CONSENT_TYPE(DB_CONN* p=0); + DB_ID_TYPE get_id(); + void db_print(char *); + void db_parse(MYSQL_ROW &row); +}; + + #endif diff --git a/db/boinc_db_types.h b/db/boinc_db_types.h index 30e7ffdc94..3572d3c7d8 100644 --- a/db/boinc_db_types.h +++ b/db/boinc_db_types.h @@ -849,4 +849,14 @@ struct CREDIT_TEAM { void clear(); }; +struct CONSENT_TYPE { + DB_ID_TYPE id; + char shortname[256]; + char description[256]; + int enabled; + int protectedct; + int privacypref; + void clear(); +}; + #endif