|
Graphviz 14.0.3~dev.20251028.0232
|
reference-counted strings More...
Functions | |
| char * | agstrdup (Agraph_t *, const char *) |
| returns a pointer to a reference-counted copy of the argument string, creating one if necessary | |
| char * | agstrdup_text (Agraph_t *, const char *) |
| returns a pointer to a reference-counted regular text copy of the argument string, creating one if necessary | |
| char * | agstrdup_html (Agraph_t *, const char *) |
| returns a pointer to a reference-counted HTML-like copy of the argument string, creating one if necessary | |
| int | aghtmlstr (const char *) |
| char * | agstrbind (Agraph_t *g, const char *) |
| char * | agstrbind_text (Agraph_t *g, const char *) |
| char * | agstrbind_html (Agraph_t *g, const char *) |
| int | agstrfree (Agraph_t *, const char *, bool is_html) |
| char * | agstrcanon (char *, char *) |
Storage management of strings as reference-counted strings. The caller does not need to dynamically allocate storage.
All uses of cgraph strings need to be freed using agstrfree in order to correctly maintain the reference count.
| int aghtmlstr | ( | const char * | s | ) |
query if a string is an ordinary string or an HTML-like string
Definition at line 438 of file refstr.c.
References refstr_t::is_html, and NULL.
Referenced by addattr(), agattr(), agcopyattr(), agcopydict(), agmakeattrs(), agsafeset(), agset(), agstrcanon(), agxset(), agxset_(), applyattrs(), applyattrs(), attrstmt(), attrstmt(), cloneAttrs(), cloneDfltAttrs(), cloneGraph(), common_init_edge(), common_init_node(), copyAttr(), copyAttr(), delete_items(), delete_items(), do_graph_label(), freeattr(), freesym(), getval(), myagxget(), setattr(), unviewsubgraphsattr(), write_port(), and writeNondefaultAttr().
| char * agstrbind | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
returns a pointer to a reference-counted string if it exists, or NULL if not
Definition at line 339 of file refstr.c.
References agstrbind_html(), agstrbind_text(), NULL, refdict(), refstr_t::s, and strdict_find().
Referenced by aginternalmaplookup(), idmap(), and myiddisc_map().
| char * agstrbind_html | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
returns a pointer to a reference-counted HTML-like string if it exists, or NULL if not
Definition at line 354 of file refstr.c.
References refdict(), and refstrbind().
Referenced by agattr(), agsafeset(), agset(), agstrbind(), and agxset().
| char * agstrbind_text | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
returns a pointer to a reference-counted regular text string if it exists, or NULL if not
Definition at line 358 of file refstr.c.
References refdict(), and refstrbind().
Referenced by agstrbind().
| char * agstrcanon | ( | char * | arg, |
| char * | buf | ||
| ) |
canonicalize a string for printing. Unsafe if buffer is not large enough.
Definition at line 219 of file write.c.
References _agstrcanon(), agcanonhtmlstr(), and aghtmlstr().
Referenced by _write_canonstr(), canon(), canon(), write_plain(), and writenodeandport().
| char * agstrdup | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
Use of this function should be avoided where possible. It is not possible to explicitly indicate whether the caller is trying to create a regular text string or an HTML-like string. It is better to be explicit with your intent and instead call either agstrdup_text or agstrdup_html.
Definition at line 399 of file refstr.c.
References agstrdup_html(), agstrdup_text(), NULL, refdict(), refstr_t::s, and strdict_find().
Referenced by addattr(), agbindrec(), aginternalmapinsert(), agmakeattrs(), agnewsym(), agxset_(), canon(), concat(), concat(), concatPort(), concatPort(), endstr(), gvusershape_open(), idmap(), myiddisc_map(), setattr(), and write_canonstr().
| char * agstrdup_html | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
Definition at line 395 of file refstr.c.
References agstrdup_internal().
Referenced by addattr(), agmakeattrs(), agnewsym(), agstrdup(), agxset_(), cloneAttrs(), copyAttr(), endstr_html(), myagxset(), myagxset(), setattr(), and toHtml().
| char * agstrdup_text | ( | Agraph_t * | g, |
| const char * | s | ||
| ) |
Definition at line 391 of file refstr.c.
References agstrdup_internal().
Referenced by agstrdup().
| int agstrfree | ( | Agraph_t * | g, |
| const char * | s, | ||
| bool | is_html | ||
| ) |
| is_html | Is the string being freed an HTML-like string? |
Definition at line 415 of file refstr.c.
References FAILURE, NULL, refstr_t::refcnt, refdict(), refstr_t::s, strdict_find(), strdict_remove(), and SUCCESS.
Referenced by agdelrec(), aginternalmapdelete(), agrecclose(), agxset_(), appendnode(), appendnode(), bindattrs(), bindattrs(), canon(), cloneAttrs(), concat(), concat(), concatPort(), concatPort(), copyAttr(), delete_items(), delete_items(), freeattr(), freesym(), freeUsershape(), idfree(), myiddisc_free(), opensubg(), opensubg(), setattr(), startgraph(), startgraph(), and write_canonstr().