1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 ss_pers_t *
 ss_pers_copy(ss_pers_t *pers,           /* The object to be copied. */
              ss_scope_t *scope,         /* The destination scope that will own the new object. */
              unsigned flags,            /* Creation flags like SS_ALLSAME (see ss_pers_new()). */
              ss_pers_t *buf,            /* Optional buffer for return value. */
              ss_prop_t *props           /* Additional properties (none defined yet) */
              )
 {
     SS_ENTER(ss_pers_copy, ss_pers_tP);
     ss_pers_t           *retval=NULL;
     unsigned            tableid;
     ss_persobj_t        *persobj=NULL;

     SS_ASSERT_CLASS(pers, ss_pers_t);

     tableid = SS_MAGIC_SEQUENCE(SS_MAGIC_OF(pers));
     if (NULL==(persobj=ss_pers_deref(pers))) SS_ERROR(FAILED);
     if (NULL==(retval=ss_pers_new(scope, tableid, persobj, flags, buf, props))) SS_ERROR(FAILED);

  SS_CLEANUP:
     SS_LEAVE(retval);
 }