| 1 | #/* | ||
| 2 | # Copyright 2015-2016 Alexander Borisov | ||
| 3 | # | ||
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 5 | # you may not use this file except in compliance with the License. | ||
| 6 | # You may obtain a copy of the License at | ||
| 7 | # | ||
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 9 | # | ||
| 10 | # Unless required by applicable law or agreed to in writing, software | ||
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 13 | # See the License for the specific language governing permissions and | ||
| 14 | # limitations under the License. | ||
| 15 | # | ||
| 16 | # Author: lex.borisov@gmail.com (Alexander Borisov) | ||
| 17 | #*/ | ||
| 18 | |||
| 19 | MODULE = HTML::MyHTML::Tree::Attr PACKAGE = HTML::MyHTML::Tree::Attr | ||
| 20 | PROTOTYPES: DISABLE | ||
| 21 | |||
| 22 | SV* | ||
| 23 | info(attr) | ||
| 24 | HTML::MyHTML::Tree::Attr attr; | ||
| 25 | |||
| 26 | CODE: | ||
| 27 | 0 | RETVAL = newRV_noinc((SV *)sm_get_attr_info(attr)); | |
| 28 | OUTPUT: | ||
| 29 | RETVAL | ||
| 30 | |||
| 31 | HTML::MyHTML::Tree::Attr | ||
| 32 | next(attr) | ||
| 33 | HTML::MyHTML::Tree::Attr attr; | ||
| 34 | |||
| 35 | CODE: | ||
| 36 | 0 | RETVAL = myhtml_attribute_next(attr); | |
| 37 | OUTPUT: | ||
| 38 | RETVAL | ||
| 39 | |||
| 40 | HTML::MyHTML::Tree::Attr | ||
| 41 | prev(attr) | ||
| 42 | HTML::MyHTML::Tree::Attr attr; | ||
| 43 | |||
| 44 | CODE: | ||
| 45 | 0 | RETVAL = myhtml_attribute_prev(attr); | |
| 46 | OUTPUT: | ||
| 47 | RETVAL | ||
| 48 | |||
| 49 | enum myhtml_namespace | ||
| 50 | namespace(attr) | ||
| 51 | HTML::MyHTML::Tree::Attr attr; | ||
| 52 | |||
| 53 | CODE: | ||
| 54 | 0 | RETVAL = myhtml_attribute_namespace(attr); | |
| 55 | OUTPUT: | ||
| 56 | RETVAL | ||
| 57 | |||
| 58 | SV* | ||
| 59 | name(attr) | ||
| 60 | HTML::MyHTML::Tree::Attr attr; | ||
| 61 | |||
| 62 | CODE: | ||
| 63 | size_t length; | ||
| 64 | 0 | const char* name = myhtml_attribute_name(attr, &length); | |
| 65 | 0 | RETVAL = newSVpv(name, length); | |
| 66 | OUTPUT: | ||
| 67 | RETVAL | ||
| 68 | |||
| 69 | SV* | ||
| 70 | value(attr) | ||
| 71 | HTML::MyHTML::Tree::Attr attr; | ||
| 72 | |||
| 73 | CODE: | ||
| 74 | size_t length; | ||
| 75 | 0 | const char* value = myhtml_attribute_value(attr, &length); | |
| 76 | 0 | RETVAL = newSVpv(value, length); | |
| 77 | OUTPUT: | ||
| 78 | RETVAL | ||
| 79 | |||
| 80 | HTML::MyHTML::Tree::Attr | ||
| 81 | remove(attr, node) | ||
| 82 | myhtml_tree_attr_t *attr; | ||
| 83 | myhtml_tree_node_t *node; | ||
| 84 | |||
| 85 | CODE: | ||
| 86 | 0 | RETVAL = myhtml_attribute_remove(node, attr); | |
| 87 | OUTPUT: | ||
| 88 | RETVAL | ||
| 89 | |||
| 90 | void | ||
| 91 | delete(attr, tree, node) | ||
| 92 | myhtml_tree_attr_t *attr; | ||
| 93 | myhtml_tree_t *tree; | ||
| 94 | myhtml_tree_node_t *node; | ||
| 95 | |||
| 96 | CODE: | ||
| 97 | 0 | myhtml_attribute_delete(tree, node, attr); | |
| 98 | |||
| 99 | void | ||
| 100 | free(attr, tree) | ||
| 101 | myhtml_tree_attr_t *attr; | ||
| 102 | myhtml_tree_t *tree; | ||
| 103 | |||
| 104 | CODE: | ||
| 105 | 0 | myhtml_attribute_free(tree, attr); | |
| 106 | |||
| 107 | |||
| 108 |