1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
 SAF_Basis *
 saf_declare_basis(SAF_ParMode pmode,
                   SAF_Db *db,
                   const char *name,                     /* Name of the basis type */
                   const char *url,                      /* An optional URL to the basis documentation */
                   SAF_Basis *basis                      /* [OUT] Optional basis handle to initialize (and return). */
                   )
 {
     SAF_ENTER(saf_declare_basis, NULL);
     ss_scope_t          topscope;

     if (!_saf_is_participating_proc(pmode)) SAF_RETURN(NULL);
     ss_file_topscope(db, &topscope);
     basis = (ss_basis_t*)ss_pers_new(&topscope, SS_MAGIC(ss_basis_t), NULL, SAF_ALL==pmode?SS_ALLSAME:0U, (ss_pers_t*)basis, NULL);

     if (SAF_EACH==pmode) SS_PERS_UNIQUE(basis);
     ss_string_set(SS_BASIS_P(basis,name), name);
     ss_string_set(SS_BASIS_P(basis,url), url);

     SAF_LEAVE(basis);
 }