1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 SAF_Eval *
 saf_declare_evaluation(SAF_ParMode pmode,
                        SAF_Db *db,
                        const char *name,                /* Name of the evaluation type */
                        const char *url,                 /* An optional URL to the evaluation documentation */
                        SAF_Eval *buf                    /* [OUT] Optional buffer to fill in and return */
                        )
 {
     SAF_ENTER(saf_declare_evaluation, NULL);
     ss_scope_t          scope;

     SAF_REQUIRE(_saf_valid_pmode(pmode), SAF_LOW_CHK_COST, NULL,
                 _saf_errmsg("PMODE must be valid"));
     if (!_saf_is_participating_proc(pmode)) SAF_RETURN(NULL);
     ss_file_topscope(db, &scope);
     buf = (ss_evaluation_t*)ss_pers_new(&scope, SS_MAGIC(ss_evaluation_t), NULL, SAF_ALL==pmode?SS_ALLSAME:0U,
                                         (ss_pers_t*)buf, NULL);

     if (SAF_EACH==pmode) SS_PERS_UNIQUE(buf);
     ss_string_set(SS_EVALUATION_P(buf,name), name);
     ss_string_set(SS_EVALUATION_P(buf,url), url);

     SAF_LEAVE(buf);
 }