My Project
Loading...
Searching...
No Matches
Data Structures | Functions
countedref.cc File Reference
#include "kernel/mod2.h"
#include "ipid.h"
#include "countedref.h"
#include "blackbox.h"
#include "newstruct.h"
#include "ipshell.h"

Go to the source code of this file.

Data Structures

class  CountedRefData
 This class stores a reference counter as well as a Singular interpreter object. More...
 
class  CountedRef
 
class  CountedRefShared
 

Functions

void CountedRefPtr_kill (ring r)
 Overloading ring destruction.
 
void CountedRefPtr_kill (CountedRefData *data)
 Supporting smart pointer CountedRefPtr.
 
void * countedref_Init (blackbox *)
 blackbox support - initialization
 
BOOLEAN countedref_CheckAssign (blackbox *, leftv, leftv)
 We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv), see the latter for details.
 
void countedref_Print (blackbox *, void *ptr)
 blackbox support - convert to string representation
 
char * countedref_String (blackbox *, void *ptr)
 blackbox support - convert to string representation
 
void * countedref_Copy (blackbox *, void *ptr)
 blackbox support - copy element
 
BOOLEAN countedref_Assign (leftv result, leftv arg)
 blackbox support - assign element
 
BOOLEAN countedref_CheckInit (leftv res, leftv arg)
 
BOOLEAN countedref_Op1 (int op, leftv res, leftv head)
 blackbox support - unary operations
 
static BOOLEAN countedref_Op2_ (int op, leftv res, leftv head, leftv arg)
 blackbox support - binary operations (resolve seocnd argument)
 
BOOLEAN countedref_Op2 (int op, leftv res, leftv head, leftv arg)
 
static BOOLEAN countedref_Op3__ (int op, leftv res, leftv head, leftv arg1, leftv arg2)
 
static BOOLEAN countedref_Op3_ (int op, leftv res, leftv head, leftv arg1, leftv arg2)
 
BOOLEAN countedref_Op3 (int op, leftv res, leftv head, leftv arg1, leftv arg2)
 blackbox support - ternary operations
 
void countedref_destroy (blackbox *, void *ptr)
 blackbox support - destruction
 
void * countedref_InitShared (blackbox *)
 Blackbox support - generate initialized, but all-zero - shared data.
 
BOOLEAN countedref_Op1Shared (int op, leftv res, leftv head)
 Blackbox support - unary operation for shared data.
 
BOOLEAN countedref_Op2Shared (int op, leftv res, leftv head, leftv arg)
 blackbox support - binary operations
 
BOOLEAN countedref_OpM (int op, leftv res, leftv args)
 blackbox support - n-ary operations
 
BOOLEAN countedref_AssignShared (leftv result, leftv arg)
 blackbox support - assign element
 
void countedref_destroyShared (blackbox *, void *ptr)
 blackbox support - destruction
 
BOOLEAN countedref_serialize (blackbox *, void *d, si_link f)
 
BOOLEAN countedref_deserialize (blackbox **, void **d, si_link f)
 
void countedref_reference_load ()
 Initialize blackbox types 'reference' and 'shared', or both.
 
void countedref_shared_load ()
 

Detailed Description

Author
Alexander Dreyer
Date
2012-08-15

This file defines reference countes interpreter objects and adds the blackbox operations for high-level types 'reference' and 'shared'.

Note
This works was supported by the "Industrial Algebra" project.
Copyright:
(c) 2012 by The Singular Team, see LICENSE file

Definition in file countedref.cc.

Function Documentation

◆ countedref_Assign()

BOOLEAN countedref_Assign ( leftv  result,
leftv  arg 
)

blackbox support - assign element

Definition at line 382 of file countedref.cc.

383{
384 // Case: replace assignment behind reference
385 if (result->Data() != NULL) {
387 return CountedRef::resolve(arg) || ref.assign(result, arg);
388 }
389
390 // Case: copy reference
391 if (result->Typ() == arg->Typ()) {
392 CountedRef ref = CountedRef::cast(arg);
393 return ref.outcast(result);
394 }
395
396 // Case: new reference
397 if ((arg->rtyp == IDHDL) || CountedRef::is_ref(arg)) {
398 CountedRef ref(arg);
399 return ref.outcast(result);
400 }
401
402 WerrorS("Can only take reference from identifier");
403 return TRUE;
404}
#define TRUE
Definition: auxiliary.h:100
static BOOLEAN resolve(leftv arg)
If necessary dereference.
Definition: countedref.cc:325
BOOLEAN outcast(leftv res, int typ)
Construct reference data object marked by given identifier number.
Definition: countedref.cc:247
BOOLEAN assign(leftv result, leftv arg)
Definition: countedref.cc:239
static BOOLEAN is_ref(leftv arg)
Check whether argument is already a reference type.
Definition: countedref.cc:216
static self cast(void *data)
Recover the actual object from raw Singular data.
Definition: countedref.cc:312
int Typ()
Definition: subexpr.cc:1011
int rtyp
Definition: subexpr.h:91
return result
Definition: facAbsBiFact.cc:75
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define NULL
Definition: omList.c:12
#define IDHDL
Definition: tok.h:31

◆ countedref_AssignShared()

BOOLEAN countedref_AssignShared ( leftv  result,
leftv  arg 
)

blackbox support - assign element

Case: replace assignment behind reference

Case: new reference to already shared data

Case: new shared data

Definition at line 661 of file countedref.cc.

662{
663 /// Case: replace assignment behind reference
664 if ((result->Data() != NULL) && !CountedRefShared::cast(result).unassigned()) {
666 return CountedRef::resolve(arg) || ref.assign(result, arg);
667 }
668
669 /// Case: new reference to already shared data
670 if (result->Typ() == arg->Typ())
671 {
672 if (result->Data() != NULL) {
674 ref.destruct();
675 }
677 return ref.outcast(result);
678 }
679 if(CountedRefShared::cast(result).unassigned())
680 {
682 return ref.assign(result, arg);
683 }
684
685 /// Case: new shared data
686 CountedRefShared ref(arg);
687 return ref.outcast(result);
688}
static self cast(leftv arg)
Recovering outcasted CountedRefShared object from interpreter object.
Definition: countedref.cc:533
BOOLEAN unassigned() const
Check whether (shared) data was initialized but not assigned yet.
Definition: countedref.cc:285
void destruct()
Kills a link to the referenced object.
Definition: countedref.cc:268

◆ countedref_CheckAssign()

BOOLEAN countedref_CheckAssign ( blackbox *  ,
leftv  ,
leftv   
)

We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv), see the latter for details.

Definition at line 193 of file countedref.cc.

194{
195 return FALSE;
196}
#define FALSE
Definition: auxiliary.h:96

◆ countedref_CheckInit()

BOOLEAN countedref_CheckInit ( leftv  res,
leftv  arg 
)

Definition at line 406 of file countedref.cc.

407{
408 if (arg->Data() != NULL) return FALSE;
409 res->rtyp = NONE;
410 WerrorS("Noninitialized access");
411 return TRUE;
412}
void * Data()
Definition: subexpr.cc:1154
CanonicalForm res
Definition: facAbsFact.cc:60
#define NONE
Definition: tok.h:221

◆ countedref_Copy()

void * countedref_Copy ( blackbox *  ,
void *  ptr 
)

blackbox support - copy element

Definition at line 374 of file countedref.cc.

375{
376 if (!ptr) return NULL;
377 CountedRef ref = CountedRef::cast(ptr);
378 return ref.outcast();
379}

◆ countedref_deserialize()

BOOLEAN countedref_deserialize ( blackbox **  ,
void **  d,
si_link  f 
)

Definition at line 712 of file countedref.cc.

713{
714 // rtyp must be set correctly (to the blackbox id) by routine calling
715 leftv data=f->m->Read(f);
716 CountedRefShared sh(data);
717 *d = sh.outcast();
718 return FALSE;
719}
FILE * f
Definition: checklibs.c:9
Class used for (list of) interpreter objects.
Definition: subexpr.h:83

◆ countedref_destroy()

void countedref_destroy ( blackbox *  ,
void *  ptr 
)

blackbox support - destruction

Definition at line 493 of file countedref.cc.

494{
495 if (ptr) {
496 CountedRef ref = CountedRef::cast(ptr);
497 ref.destruct();
498 }
499}

◆ countedref_destroyShared()

void countedref_destroyShared ( blackbox *  ,
void *  ptr 
)

blackbox support - destruction

Definition at line 691 of file countedref.cc.

692{
693 if (ptr) {
695 ref.destruct();
696 }
697}

◆ countedref_Init()

void * countedref_Init ( blackbox *  )

blackbox support - initialization

Definition at line 186 of file countedref.cc.

187{
188 return NULL;
189}

◆ countedref_InitShared()

void * countedref_InitShared ( blackbox *  )

Blackbox support - generate initialized, but all-zero - shared data.

Definition at line 552 of file countedref.cc.

553{
554 auto ref = CountedRefShared();
555 return ref.outcast();
556}

◆ countedref_Op1()

BOOLEAN countedref_Op1 ( int  op,
leftv  res,
leftv  head 
)

blackbox support - unary operations

Definition at line 415 of file countedref.cc.

416{
417 if(op == TYPEOF_CMD)
418 return blackboxDefaultOp1(op, res, head);
419
420 if (countedref_CheckInit(res, head)) return TRUE;
421
422 if ((op == DEF_CMD) || (op == head->Typ()))
423 {
424 res->rtyp = head->Typ();
425 return iiAssign(res, head);
426 }
427
429 return ref.dereference(head) ||
430 iiExprArith1(res, head, op == LINK_CMD? head->Typ(): op);
431}
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
Definition: blackbox.cc:78
CanonicalForm head(const CanonicalForm &f)
BOOLEAN dereference(leftv arg)
Replaces argument by a shallow copy of the references data.
Definition: countedref.cc:274
BOOLEAN countedref_CheckInit(leftv res, leftv arg)
Definition: countedref.cc:406
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition: iparith.cc:9091
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1963
@ DEF_CMD
Definition: tok.h:58
@ LINK_CMD
Definition: tok.h:117
@ TYPEOF_CMD
Definition: tok.h:194

◆ countedref_Op1Shared()

BOOLEAN countedref_Op1Shared ( int  op,
leftv  res,
leftv  head 
)

Blackbox support - unary operation for shared data.

Definition at line 559 of file countedref.cc.

560{
561 if(op == TYPEOF_CMD)
562 return blackboxDefaultOp1(op, res, head);
563
564 if (countedref_CheckInit(res, head)) return TRUE;
565
566 if ((op == DEF_CMD) || (op == head->Typ()))
567 {
568 res->rtyp = head->Typ();
569 return iiAssign(res, head);
570 }
571
573
574 if (op == LINK_CMD)
575 {
576 if (ref.dereference(head)) return TRUE;
577 res->Copy(head);
578 return (res->Typ() == NONE);
579 }
580
581 CountedRefShared wrap = ref.wrapid();
582 int typ = head->Typ();
583 return wrap.dereference(head) || iiExprArith1(res, head, op) ||
584 wrap.retrieve(res, typ);
585}
BOOLEAN retrieve(leftv res, int typ)
Recover more information (e.g. subexpression data) from computed result.
Definition: countedref.cc:545
self wrapid()
Temporarily wrap with identifier for '[' and '.' operation.
Definition: countedref.cc:539

◆ countedref_Op2()

BOOLEAN countedref_Op2 ( int  op,
leftv  res,
leftv  head,
leftv  arg 
)

Definition at line 446 of file countedref.cc.

447{
448 if (countedref_CheckInit(res, head)) return TRUE;
450 {
452 return ref.dereference(head) || countedref_Op2_(op, res, head, arg);
453 }
454 return countedref_Op2_(op, res, head, arg);
455}
static BOOLEAN countedref_Op2_(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations (resolve seocnd argument)
Definition: countedref.cc:436

◆ countedref_Op2_()

static BOOLEAN countedref_Op2_ ( int  op,
leftv  res,
leftv  head,
leftv  arg 
)
static

blackbox support - binary operations (resolve seocnd argument)

Definition at line 436 of file countedref.cc.

437{
438 if (CountedRef::is_ref(arg))
439 {
440 CountedRef ref = CountedRef::cast(arg);
441 return ref.dereference(arg) || iiExprArith2(res, head, op, arg);
442 }
443 return iiExprArith2(res, head, op, arg);
444}
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition: iparith.cc:8902

◆ countedref_Op2Shared()

BOOLEAN countedref_Op2Shared ( int  op,
leftv  res,
leftv  head,
leftv  arg 
)

blackbox support - binary operations

Definition at line 589 of file countedref.cc.

590{
591 if (countedref_CheckInit(res, head)) return TRUE;
592
594 {
596 int typ = head->Typ();
597 return wrap.dereference(head) || countedref_Op2_(op, res, head, arg) ||
598 wrap.retrieve(res, typ);
599 }
600
601 return countedref_Op2_(op, res, head, arg);
602}

◆ countedref_Op3()

BOOLEAN countedref_Op3 ( int  op,
leftv  res,
leftv  head,
leftv  arg1,
leftv  arg2 
)

blackbox support - ternary operations

Definition at line 480 of file countedref.cc.

481{
482 if (countedref_CheckInit(res, head)) return TRUE;
484 {
486 return ref.dereference(head) || countedref_Op3_(op, res, head, arg1, arg2);
487 }
488 return countedref_Op3_(op, res, head, arg1, arg2);
489}
static BOOLEAN countedref_Op3_(int op, leftv res, leftv head, leftv arg1, leftv arg2)
Definition: countedref.cc:468

◆ countedref_Op3_()

static BOOLEAN countedref_Op3_ ( int  op,
leftv  res,
leftv  head,
leftv  arg1,
leftv  arg2 
)
static

Definition at line 468 of file countedref.cc.

469{
470 if (CountedRef::is_ref(arg1))
471 {
472 CountedRef ref = CountedRef::cast(arg1);
473 return ref.dereference(arg1) || countedref_Op3__(op, res, head, arg1, arg2);
474 }
475 return countedref_Op3__(op, res, head, arg1, arg2);
476}
static BOOLEAN countedref_Op3__(int op, leftv res, leftv head, leftv arg1, leftv arg2)
Definition: countedref.cc:457

◆ countedref_Op3__()

static BOOLEAN countedref_Op3__ ( int  op,
leftv  res,
leftv  head,
leftv  arg1,
leftv  arg2 
)
static

Definition at line 457 of file countedref.cc.

458{
459
460 if (CountedRef::is_ref(arg2))
461 {
462 CountedRef ref = CountedRef::cast(arg2);
463 return ref.dereference(arg2) || iiExprArith3(res, op, head, arg1, arg2);
464 }
465 return iiExprArith3(res, op, head, arg1, arg2);
466}
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition: iparith.cc:9301

◆ countedref_OpM()

BOOLEAN countedref_OpM ( int  op,
leftv  res,
leftv  args 
)

blackbox support - n-ary operations

Definition at line 605 of file countedref.cc.

606{
607 if (args->Data() == NULL) return FALSE;
608
609 if(op == SYSTEM_CMD)
610 {
611 if (args->next)
612 {
613 leftv next = args->next;
614 args->next = NULL;
615
616 char* name = (next->Typ() == STRING_CMD?
617 (char*) next->Data(): (char*)next->Name());
618 next = next->next;
619
620 if (strcmp(name, "help") == 0)
621 {
622 PrintS("system(<ref>, ...): extended functionality for reference/shared data <ref>\n");
623 PrintS(" system(<ref>, count) - number of references pointing to <ref>\n");
624 PrintS(" system(<ref>, enumerate) - unique number for identifying <ref>\n");
625 PrintS(" system(<ref>, undefined) - checks whether <ref> had been assigned\n");
626 PrintS(" system(<ref>, \"help\") - prints this information message\n");
627 PrintS(" system(<ref>, \"typeof\") - actual type referenced by <ref>\n");
628 PrintS(" system(<ref1>, same, <ref2>) - tests for identic reference objects\n");
630 }
631 if (strncmp(name, "undef", 5) == 0)
632 {
633 return CountedRef::construct(res, args->Data()?
634 (CountedRef::cast(args).unassigned()? 1: 2): 0);
635 }
636
637 CountedRef obj = CountedRef::cast(args);
638 if (next)
639 {
640 if (strcmp(name, "same") == 0) return obj.same(res, next);
641 // likewise may be hard to interprete, so we not not document it above
642 if (strncmp(name, "like", 4) == 0) return obj.likewise(res, next);
643 }
644 if (strncmp(name, "count", 5) == 0) return obj.count(res);
645 if (strncmp(name, "enum", 4) == 0) return obj.enumerate(res);
646 if (strcmp(name, "name") == 0) return obj.name(res); // undecumented
647 if (strncmp(name, "typ", 3) == 0) return obj.type(res);
648 }
649 return TRUE;
650 }
651 if (op == LIST_CMD)
652 {
653 res->rtyp = op;
654 return jjLIST_PL(res, args);
655 }
656 CountedRef ref = CountedRef::cast(args);
657 return ref.dereference(args) || iiExprArithM(res, args, op);
658}
BOOLEAN type(leftv res)
Get type of references data.
Definition: countedref.cc:304
BOOLEAN likewise(leftv res, leftv arg)
Check for likewise identifiers.
Definition: countedref.cc:294
BOOLEAN enumerate(leftv res)
Definition: countedref.cc:291
BOOLEAN same(leftv res, leftv arg)
Check for identical reference objects.
Definition: countedref.cc:299
static BOOLEAN construct(leftv res, long data)
Construct integer value.
Definition: countedref.cc:335
BOOLEAN name(leftv res)
Get (possibly) internal identifier name.
Definition: countedref.cc:309
BOOLEAN count(leftv res)
Get number of references pointing here, too.
Definition: countedref.cc:288
leftv next
Definition: subexpr.h:86
char name(const Variable &v)
Definition: factory.h:189
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition: iparith.cc:9392
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition: iparith.cc:7976
ListNode * next
Definition: janet.h:31
void PrintS(const char *s)
Definition: reporter.cc:284
@ LIST_CMD
Definition: tok.h:118
@ STRING_CMD
Definition: tok.h:185
@ SYSTEM_CMD
Definition: tok.h:187

◆ countedref_Print()

void countedref_Print ( blackbox *  ,
void *  ptr 
)

blackbox support - convert to string representation

Definition at line 360 of file countedref.cc.

361{
362 if (ptr) (*CountedRef::cast(ptr))->Print();
363 else PrintS("<unassigned reference or shared memory>");
364}
#define Print
Definition: emacs.cc:80

◆ countedref_reference_load()

void countedref_reference_load ( )

Initialize blackbox types 'reference' and 'shared', or both.

Definition at line 721 of file countedref.cc.

722{
723 int tok;
724 if (blackboxIsCmd("reference", tok) == ROOT_DECL)
725 return;
726
727 blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
728 bbx->blackbox_CheckAssign = countedref_CheckAssign;
729 bbx->blackbox_destroy = countedref_destroy;
730 bbx->blackbox_String = countedref_String;
731 bbx->blackbox_Print = countedref_Print;
732 bbx->blackbox_Init = countedref_Init;
733 bbx->blackbox_Copy = countedref_Copy;
734 bbx->blackbox_Assign = countedref_Assign;
735 bbx->blackbox_Op1 = countedref_Op1;
736 bbx->blackbox_Op2 = countedref_Op2;
737 bbx->blackbox_Op3 = countedref_Op3;
738 bbx->blackbox_OpM = countedref_OpM;
739 bbx->blackbox_serialize = countedref_serialize;
740 bbx->blackbox_deserialize = countedref_deserialize;
741 bbx->data = omAlloc0(newstruct_desc_size());
742 setBlackboxStuff(bbx, "reference");
743}
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition: blackbox.cc:142
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition: blackbox.cc:218
char * countedref_String(blackbox *, void *ptr)
blackbox support - convert to string representation
Definition: countedref.cc:367
BOOLEAN countedref_serialize(blackbox *, void *d, si_link f)
Definition: countedref.cc:700
void countedref_Print(blackbox *, void *ptr)
blackbox support - convert to string representation
Definition: countedref.cc:360
BOOLEAN countedref_deserialize(blackbox **, void **d, si_link f)
Definition: countedref.cc:712
BOOLEAN countedref_OpM(int op, leftv res, leftv args)
blackbox support - n-ary operations
Definition: countedref.cc:605
BOOLEAN countedref_Op3(int op, leftv res, leftv head, leftv arg1, leftv arg2)
blackbox support - ternary operations
Definition: countedref.cc:480
BOOLEAN countedref_Assign(leftv result, leftv arg)
blackbox support - assign element
Definition: countedref.cc:382
BOOLEAN countedref_Op2(int op, leftv res, leftv head, leftv arg)
Definition: countedref.cc:446
void * countedref_Init(blackbox *)
blackbox support - initialization
Definition: countedref.cc:186
void countedref_destroy(blackbox *, void *ptr)
blackbox support - destruction
Definition: countedref.cc:493
BOOLEAN countedref_Op1(int op, leftv res, leftv head)
blackbox support - unary operations
Definition: countedref.cc:415
BOOLEAN countedref_CheckAssign(blackbox *, leftv, leftv)
We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv),...
Definition: countedref.cc:193
void * countedref_Copy(blackbox *, void *ptr)
blackbox support - copy element
Definition: countedref.cc:374
@ ROOT_DECL
Definition: grammar.cc:319
int newstruct_desc_size()
Definition: newstruct.cc:42
#define omAlloc0(size)
Definition: omAllocDecl.h:211

◆ countedref_serialize()

BOOLEAN countedref_serialize ( blackbox *  ,
void *  d,
si_link  f 
)

Definition at line 700 of file countedref.cc.

701{
702 sleftv l;
703 memset(&l,0,sizeof(l));
704 l.rtyp = STRING_CMD;
705 l.data = (void*)omStrDup("shared"); // references are converted
706 f->m->Write(f, &l);
708 f->m->Write(f, &l);
709 return FALSE;
710}
int l
Definition: cfEzgcd.cc:100
#define omStrDup(s)
Definition: omAllocDecl.h:263

◆ countedref_shared_load()

void countedref_shared_load ( )

Definition at line 745 of file countedref.cc.

746{
747 int tok;
748 if (blackboxIsCmd("shared", tok) == ROOT_DECL)
749 return;
750
751 blackbox *bbxshared = (blackbox*)omAlloc0(sizeof(blackbox));
752 bbxshared->blackbox_String = countedref_String;
753 bbxshared->blackbox_Print = countedref_Print;
754 bbxshared->blackbox_Copy = countedref_Copy;
755 bbxshared->blackbox_Op3 = countedref_Op3;
756 bbxshared->blackbox_OpM = countedref_OpM;
757 bbxshared->blackbox_serialize = countedref_serialize;
758 bbxshared->blackbox_deserialize = countedref_deserialize;
759
760 bbxshared->blackbox_CheckAssign = countedref_CheckAssign;
761 bbxshared->blackbox_Assign = countedref_AssignShared;
762 bbxshared->blackbox_destroy = countedref_destroyShared;
763 bbxshared->blackbox_Op1 = countedref_Op1Shared;
764 bbxshared->blackbox_Op2 = countedref_Op2Shared;
765 bbxshared->blackbox_Init = countedref_InitShared;
766 bbxshared->data = omAlloc0(newstruct_desc_size());
767 setBlackboxStuff(bbxshared, "shared");
768}
BOOLEAN countedref_Op2Shared(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations
Definition: countedref.cc:589
void countedref_destroyShared(blackbox *, void *ptr)
blackbox support - destruction
Definition: countedref.cc:691
void * countedref_InitShared(blackbox *)
Blackbox support - generate initialized, but all-zero - shared data.
Definition: countedref.cc:552
BOOLEAN countedref_AssignShared(leftv result, leftv arg)
blackbox support - assign element
Definition: countedref.cc:661
BOOLEAN countedref_Op1Shared(int op, leftv res, leftv head)
Blackbox support - unary operation for shared data.
Definition: countedref.cc:559

◆ countedref_String()

char * countedref_String ( blackbox *  ,
void *  ptr 
)

blackbox support - convert to string representation

Definition at line 367 of file countedref.cc.

368{
369 if (ptr == NULL) return omStrDup(sNoName_fe);
370 return (*CountedRef::cast(ptr))->String();
371}
const char sNoName_fe[]
Definition: fevoices.cc:57

◆ CountedRefPtr_kill() [1/2]

void CountedRefPtr_kill ( CountedRefData data)
inline

Supporting smart pointer CountedRefPtr.

Definition at line 182 of file countedref.cc.

182{ delete data; }

◆ CountedRefPtr_kill() [2/2]

void CountedRefPtr_kill ( ring  r)
inline

Overloading ring destruction.

Definition at line 34 of file countedref.cc.

34{ rKill(r); }
void rKill(ring r)
Definition: ipshell.cc:6170