Ticket #1122: ConstantsForHeaderFiles.patch

File ConstantsForHeaderFiles.patch, 7.6 KB (added by SteffenMoeller, 13 years ago)

Patch against boinc 6.13.1 introducing BOINC_NAME_LENGTH #define

  • db/boinc_db.h

    old new  
    4949// Dummy name for file xfers
    5050#define FILE_MOVER "move_file"
    5151
     52#define BOINC_NAME_LENGTH           256
     53
    5254struct BEST_APP_VERSION;
    5355
    5456// A compilation target, i.e. a architecture/OS combination.
     
    5759struct PLATFORM {
    5860    int id;
    5961    int create_time;
    60     char name[256];                 // i.e. "sparc-sun-solaris"
    61     char user_friendly_name[256];   // i.e. "SPARC Solaris 2.8"
     62    char name[BOINC_NAME_LENGTH];                 // i.e. "sparc-sun-solaris"
     63    char user_friendly_name[BOINC_NAME_LENGTH];   // i.e. "SPARC Solaris 2.8"
    6264    int deprecated;
    6365    void clear();
    6466};
     
    6870struct APP {
    6971    int id;
    7072    int create_time;
    71     char name[256];         // application name, preferably short
    72     int min_version;        // don't use app versions before this
     73    char name[BOINC_NAME_LENGTH];  // application name, preferably short
     74    int min_version;               // don't use app versions before this
    7375    bool deprecated;
    74     char user_friendly_name[256];
     76    char user_friendly_name[BOINC_NAME_LENGTH];
    7577    int homogeneous_redundancy;
    7678    double weight;          // tells the feeder what fraction of results
    7779                            // should come from this app
     
    153155struct USER {
    154156    int id;
    155157    int create_time;
    156     char email_addr[256];
    157     char name[256];
    158     char authenticator[256];
    159     char country[256];
    160     char postal_code[256];
     158    char email_addr[BOINC_NAME_LENGTH];
     159    char name[BOINC_NAME_LENGTH];
     160    char authenticator[BOINC_NAME_LENGTH];
     161    char country[BOINC_NAME_LENGTH];
     162    char postal_code[BOINC_NAME_LENGTH];
    161163    double total_credit;
    162164    double expavg_credit;           // credit per second, recent average
    163165    double expavg_time;             // when the above was computed
     
    179181        //    ...
    180182        // </project_preferences>
    181183    int teamid;                     // team ID if any
    182     char venue[256];                // home/work/school (default)
    183     char url[256];                  // user's web page if any
     184    char venue[BOINC_NAME_LENGTH];  // home/work/school (default)
     185    char url[BOINC_NAME_LENGTH];    // user's web page if any
    184186    bool send_email;
    185187    bool show_hosts;
    186188    int posts;                      // number of messages posted (redundant)
     
    193195    int seti_nresults;              // number of WUs completed
    194196    int seti_last_result_time;      // time of last result (UNIX)
    195197    double seti_total_cpu;          // number of CPU seconds
    196     char signature[256];
     198    char signature[BOINC_NAME_LENGTH];
    197199        // deprecated as of 9/2004 - may be used as temp
    198200    bool has_profile;
    199201    char cross_project_id[256];
     
    217219struct TEAM {
    218220    int id;
    219221    int create_time;
    220     int userid;             // User ID of team founder
    221     char name[256];
    222     char name_lc[256];      // Team name in lowercase (used for searching)
    223     char url[256];
    224     int type;               // Team type (see above)
    225     char name_html[256];
     222    int userid;                          // User ID of team founder
     223    char name[BOINC_NAME_LENGTH];
     224    char name_lc[BOINC_NAME_LENGTH];     // Team name in lowercase (used for searching)
     225    char url[BOINC_NAME_LENGTH];
     226    int type;                            // Team type (see above)
     227    char name_html[BOINC_NAME_LENGTH];
    226228    char description[BLOB_SIZE];
    227     int nusers;             // UNDEFINED BY DEFAULT
    228     char country[256];
     229    int nusers;                          // UNDEFINED BY DEFAULT
     230    char country[BOINC_NAME_LENGTH];
    229231    double total_credit;
    230232    double expavg_credit;
    231233    double expavg_time;
     
    256258    // all remaining items are assigned by the client
    257259    int timezone;           // local STANDARD time at host - UTC time
    258260                            // (in seconds)
    259     char domain_name[256];
     261    char domain_name[BOINC_NAME_LENGTH];
    260262    char serialnum[256];    // textual description of coprocessors
    261263    char last_ip_addr[256]; // internal IP address as of last RPC
    262264    int nsame_ip_addr;      // # of RPCs with same IP address
     
    268270    double duration_correction_factor;
    269271
    270272    int p_ncpus;            // Number of CPUs on host
    271     char p_vendor[256];     // Vendor name of CPU
    272     char p_model[256];      // Model of CPU
     273    char p_vendor[BOINC_NAME_LENGTH];     // Vendor name of CPU
     274    char p_model[BOINC_NAME_LENGTH];      // Model of CPU
    273275    double p_fpops;         // measured floating point ops/sec of CPU
    274276    double p_iops;          // measured integer ops/sec of CPU
    275277    double p_membw;         // measured memory bandwidth (bytes/sec) of CPU
    276278                            // The above are per CPU, not total
    277279
    278     char os_name[256];      // Name of operating system
    279     char os_version[256];   // Version of operating system
     280    char os_name[BOINC_NAME_LENGTH];      // Name of operating system
     281    char os_version[BOINC_NAME_LENGTH];   // Version of operating system
    280282
    281283    double m_nbytes;        // Size of memory in bytes
    282284    double m_cache;         // Size of CPU cache in bytes (L1 or L2?)
     
    314316    double credit_per_cpu_sec;
    315317        // deprecated
    316318
    317     char venue[256];        // home/work/school
     319    char venue[BOINC_NAME_LENGTH];        // home/work/school
    318320    int nresults_today;     // results sent since midnight
    319321    double avg_turnaround;  // recent average result turnaround time
    320322    char host_cpid[256];    // host cross-project ID
     
    376378    int id;
    377379    int create_time;
    378380    int appid;                  // associated app
    379     char name[256];
     381    char name[BOINC_NAME_LENGTH];
    380382    char xml_doc[BLOB_SIZE];
    381383    int batch;
    382384        // projects can use this for any of several purposes:
     
    435437        // which version this job is committed to (0 if none)
    436438
    437439    // the following not used in the DB
    438     char app_name[256];
     440    char app_name[BOINC_NAME_LENGTH];
    439441    void clear();
    440442};
    441443
     
    518520    int report_deadline;            // deadline for receiving result
    519521    int sent_time;                  // when result was sent to host
    520522    int received_time;              // when result was received from host
    521     char name[256];
     523    char name[BOINC_NAME_LENGTH];
    522524    double cpu_time;                // CPU time used to complete result
    523525    char xml_doc_in[BLOB_SIZE];     // descriptions of output files
    524526    char xml_doc_out[BLOB_SIZE];    // MD5s of output files
     
    590592
    591593struct TRANSITIONER_ITEM {
    592594    int id; // WARNING: this is the WU ID
    593     char name[256];
     595    char name[BOINC_NAME_LENGTH];
    594596    int appid;
    595597    int min_quorum;
    596598    bool need_validate;
     
    609611    int batch;
    610612    int app_version_id;
    611613    int res_id; // This is the RESULT ID
    612     char res_name[256];
     614    char res_name[BOINC_NAME_LENGTH];
    613615    int res_report_deadline;
    614616    int res_server_state;
    615617    int res_outcome;
     
    882884// messages if the result is no longer needed.
    883885//
    884886struct IN_PROGRESS_RESULT {
    885         char result_name[256];
     887        char result_name[BOINC_NAME_LENGTH];
    886888        int assimilate_state;
    887889        int error_mask;
    888890        int server_state;
     
    901903// into single SQL queries.
    902904
    903905struct SCHED_RESULT_ITEM {
    904     char queried_name[256];     // name as reported by client
     906    char queried_name[BOINC_NAME_LENGTH];     // name as reported by client
    905907    int id;
    906     char name[256];
     908    char name[BOINC_NAME_LENGTH];
    907909    int workunitid;
    908910    int appid;
    909911    int server_state;