libgeda

scheme_attrib.c File Reference

Scheme API attribute manipulation procedures. More...

#include <config.h>
#include "libgeda_priv.h"
#include "libgedaguile_priv.h"
#include "scheme_attrib.x"
Include dependency graph for scheme_attrib.c:

Go to the source code of this file.

Functions

 SCM_SYMBOL (attribute_format_sym,"attribute-format")
 SCM_DEFINE (parse_attrib,"%parse-attrib", 1, 0, 0,(SCM text_s),"Parse attribute name and value from text object.")
 Parse an attribute text object into name and value strings.
 SCM_DEFINE (object_attribs,"%object-attribs", 1, 0, 0,(SCM obj_s),"Get an object's attributes.")
 Get a list of an object's attributes.
 SCM_DEFINE (attrib_attachment,"%attrib-attachment", 1, 0, 0,(SCM attrib_s),"Get the object that an attribute is attached to.")
 Get the object that an attribute is attached to.
 SCM_DEFINE (attach_attrib_x,"%attach-attrib!", 2, 0, 0,(SCM obj_s, SCM attrib_s),"Attach an attribute to an object.")
 Attach an attribute to an object.
 SCM_DEFINE (detach_attrib_x,"%detach-attrib!", 2, 0, 0,(SCM obj_s, SCM attrib_s),"Detach an attribute to an object.")
 Detach an attribute from an object.
 SCM_DEFINE (promotable_attribs,"%promotable-attribs", 1, 0, 0,(SCM complex_s),"Get a component's promotable attributes")
 Get a complex object's promotable attribs.
static void init_module_geda_core_attrib ()
 Create the (geda core attrib) Scheme module.
void edascm_init_attrib ()
 Initialise the basic gEDA attribute manipulation procedures.

Detailed Description

Definition in file scheme_attrib.c.


Function Documentation

SCM_SYMBOL ( attribute_format_sym  ,
"attribute-format"   
)
SCM_DEFINE ( parse_attrib  ,
"%parse-attrib ,
,
,
,
(SCM text_s)  ,
"Parse attribute name and value from text object."   
)
Function Description
Tries to parse the underlying string of the text object text_s into name and value strings. If successful, returns a pair of the form (name . value). Otherwise, raises an attribute-format error.
Note:
Scheme API: Implements the attrib-parse procedure of the (geda core attrib) module.
Parameters:
text_stext object to attempt to split.
Returns:
name/value pair, or SCM_BOOL_F.

Definition at line 45 of file scheme_attrib.c.

Here is the call graph for this function:

SCM_DEFINE ( object_attribs  ,
"%object-attribs"  ,
,
,
,
(SCM obj_s)  ,
"Get an object's attributes."   
)
Function Description
Retrieves the attributes of the smob obj_s as a Scheme list of OBJECT smobs.
Note:
Scheme API: Implements the object-attribs procedure of the (geda core attrib) module.
Parameters:
obj_sobject to get attributes for.
Returns:
a list of OBJECT smobs.

Definition at line 88 of file scheme_attrib.c.

Here is the call graph for this function:

SCM_DEFINE ( attrib_attachment  ,
"%attrib-attachment"  ,
,
,
,
(SCM attrib_s)  ,
"Get the object that an attribute is attached to."   
)
Function Description
Returns the OBJECT smob that attrib_s is attached to. If attrib_s is not attached as an attribute, returns SCM_BOOL_F.
Note:
Scheme API: Implements the attrib-attachment procedure of the (geda core attrib) module.
Parameters:
attrib_sthe object to get attribute attachment for.
Returns:
the object to which attrib_s is attached, or SCM_BOOL_F.

Definition at line 111 of file scheme_attrib.c.

Here is the call graph for this function:

SCM_DEFINE ( attach_attrib_x  ,
"%attach-attrib!"  ,
,
,
,
(SCM obj_s, SCM attrib_s)  ,
"Attach an attribute to an object."   
)
Function Description
Attach attrib_s to obj_s. The following conditions must be satisfied:
  • Neither obj_s nor attrib_s may be already attached as an attribute.
  • Both obj_s and attrib_s must be part of the same page and/or complex object. (They can't be "loose" objects).
  • attrib_s must be a text object.

These restrictions are intentionally harsher than those of the C API, and are required in order to ensure that the Scheme API is safe.

If attrib_s is already attached to obj_s, does nothing successfully.

Note:
Scheme API: Implements the attach-attrib! procedure of the (geda core attrib) module.
Parameters:
obj_sthe object to which to attach an attribute.
attrib_sthe attribute to attach.
Returns:
obj_s.

Definition at line 152 of file scheme_attrib.c.

Here is the call graph for this function:

SCM_DEFINE ( detach_attrib_x  ,
"%detach-attrib!"  ,
,
,
,
(SCM obj_s, SCM attrib_s)  ,
"Detach an attribute to an object."   
)
Function Description
Detach attrib_s from obj_s. If attrib_s is not attached as an attribute, does nothing silently. If attrib_s is attached as an attribute of an object other than obj_s, throws a Scheme error.
Note:
Scheme API: Implements the detach-attrib! procedure of the (geda core attrib) module.
Parameters:
obj_sthe object from which to detach an attribute.
attrib_sthe attribute to detach.
Returns:
attrib_s.

Definition at line 213 of file scheme_attrib.c.

Here is the call graph for this function:

SCM_DEFINE ( promotable_attribs  ,
"%promotable-attribs"  ,
,
,
,
(SCM complex_s)  ,
"Get a component's promotable attributes"   
)
Function Description
Returns the promotable attributes of complex_s, according to the current gEDA configuration.
Parameters:
complex_sthe complex object for which to get promotable attributes.
Returns:
a list of promotable attributes.

Definition at line 258 of file scheme_attrib.c.

Here is the call graph for this function:

static void init_module_geda_core_attrib ( ) [static]
Function Description
Defines procedures in the (geda core attrib) module. The module can be accessed using (use-modules (geda core attrib)).

Definition at line 280 of file scheme_attrib.c.

void edascm_init_attrib ( )
Function Description
Registers some Scheme procedures for working with attributes. Should only be called by scheme_api_init().

Definition at line 299 of file scheme_attrib.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines