Login
Diff
Login

Differences From Artifact [bdadcebb4d]:

To Artifact [38e41fd09b]:


513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
  if(parent.B.uuid){
    rc = fsl_deck_B_set(&deck, parent.B.uuid);
  }

  rc = fsl_deck_D_set(&deck, opt->mtime>0 ? opt->mtime : fsl_db_julian_now(db));
  if(rc) goto end;

  {
    /*
      "Copy" all the F-cards by simply taking ownership of parent's
      list...

      If we ever implement deck caching via fsl_deck_load_rid() then
      this will eventually backfire horribly.

      And... queue the backfire on parent.content caching.
    */
#if 0
    deck.F.list = parent.F.list;
    parent.F.list = fsl_list_empty;
#else
    fsl_size_t i;
    for( i = 0; i < parent.F.list.used; ++i){
      fsl_card_F const * fc = (fsl_card_F const *)parent.F.list.list[i];
      rc = fsl_deck_F_add(&deck, fc->name, fc->uuid, fc->perm, fc->priorName);
      if(rc) goto end;
    }
#endif
  }

  rc = fsl_deck_U_set(&deck, user);
  if(rc) goto end;

  rc = fsl_deck_P_add(&deck, parent.uuid);
  if(rc) goto end;







<
|
<
<
|
<
<
|
|
|
<
<
<
<
<
|
|
|

<
<







513
514
515
516
517
518
519

520


521


522
523
524





525
526
527
528


529
530
531
532
533
534
535
  if(parent.B.uuid){
    rc = fsl_deck_B_set(&deck, parent.B.uuid);
  }

  rc = fsl_deck_D_set(&deck, opt->mtime>0 ? opt->mtime : fsl_db_julian_now(db));
  if(rc) goto end;


  /*


    We cannot simply transfer the list of F-cards from parent to deck


    because their content pointers (when the deck is parsed using fsl_deck_parse2())
    points to memory in parent.content;
  */





  for( fsl_size_t i = 0; i < parent.F.used; ++i){
    fsl_card_F const * fc = &parent.F.list[i];
    rc = fsl_deck_F_add(&deck, fc->name, fc->uuid, fc->perm, fc->priorName);
      if(rc) goto end;


  }

  rc = fsl_deck_U_set(&deck, user);
  if(rc) goto end;

  rc = fsl_deck_P_add(&deck, parent.uuid);
  if(rc) goto end;