Changeset f85ca3f in mainline for uspace/app/bithenge/transform.h
- Timestamp:
- 2012-07-28T21:25:49Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 84e8a70
- Parents:
- 32eb01b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bithenge/transform.h
r32eb01b rf85ca3f 52 52 typedef struct { 53 53 /** @privatesection */ 54 int num_params; 54 55 bithenge_node_t **params; 55 int num_params;56 bithenge_node_t *current_node; 56 57 } bithenge_scope_t; 57 58 … … 74 75 static inline void bithenge_scope_init(bithenge_scope_t *scope) 75 76 { 77 scope->num_params = 0; 76 78 scope->params = NULL; 77 scope-> num_params = 0;79 scope->current_node = NULL; 78 80 } 79 81 … … 83 85 static inline void bithenge_scope_destroy(bithenge_scope_t *scope) 84 86 { 87 bithenge_node_dec_ref(scope->current_node); 85 88 for (int i = 0; i < scope->num_params; i++) 86 89 bithenge_node_dec_ref(scope->params[i]); … … 104 107 for (int i = 0; i < out->num_params; i++) 105 108 bithenge_node_inc_ref(out->params[i]); 106 return EOK; 109 out->current_node = scope->current_node; 110 if (out->current_node) 111 bithenge_node_inc_ref(out->current_node); 112 return EOK; 113 } 114 115 /** Set the current node being created. Takes a reference to @a node. 116 * @param scope The scope to set the current node in. 117 * @param node The current node being created. 118 * @return EOK on success or an error code from errno.h. */ 119 static inline void bithenge_scope_set_current_node(bithenge_scope_t *scope, 120 bithenge_node_t *node) 121 { 122 bithenge_node_dec_ref(scope->current_node); 123 scope->current_node = node; 124 } 125 126 /** Get the current node being created, which may be NULL. 127 * @param scope The scope to get the current node from. 128 * @return The node being created, or NULL. */ 129 static inline bithenge_node_t *bithenge_scope_get_current_node( 130 bithenge_scope_t *scope) 131 { 132 if (scope->current_node) 133 bithenge_node_inc_ref(scope->current_node); 134 return scope->current_node; 107 135 } 108 136 109 137 /** Allocate parameters. The parameters must then be set with @a 110 * bithenge_scope_set_param. 138 * bithenge_scope_set_param. This must not be called on a scope that already 139 * has parameters. 111 140 * @param scope The scope in which to allocate parameters. 112 141 * @param num_params The number of parameters to allocate.
Note:
See TracChangeset
for help on using the changeset viewer.