Go to the source code of this file.
◆ grn_extract_data
◆ grn_extractor_extract_func
A function that implements extraction feature for an extractor.
If the extractor can extract a content from the data, the extractor must extract a content from the data and return it as a grn_obj that is created by grn_obj_open.
If the extractor can't extract a content from the data, the extractor must return NULL.
- Parameters
-
| ctx | The context object. |
| extractor | The extractor. |
| data | The data to be extracted. |
- Returns
- The extracted value as a grn_obj,
NULL if the extractor doesn't extract anything or has any error.
You must free the returned value by GRN_OBJ_FIN when it's no longer needed.
- Since
- 16.0.1
◆ grn_extract_data_get_index()
Return the index of the target extractor in the table.
- Parameters
-
| ctx | The context object. |
| data | The data. |
- Returns
- The index of the target extractor in the table.
- Since
- 16.0.1
◆ grn_extract_data_get_table()
Return the table that extracts target value belongs to.
- Parameters
-
| ctx | The context object. |
| data | The data. |
- Returns
- The table that extract target value belongs to.
- Since
- 16.0.1
◆ grn_extract_data_get_value()
Return the extract target value.
This is owned by grn_extract_data. You must not free it.
- Parameters
-
| ctx | The context object. |
| data | The data. |
- Returns
- The extract target value.
- Since
- 16.0.1
◆ grn_extractor_create()
Create an extractor.
You must set at least an extract function to the created extractor by grn_extractor_set_extract_func.
- Parameters
-
| ctx | The context object. |
| name | The name of the new extractor. |
| name_length | The byte size of name.You can use -1 if name is a \0-terminated string. |
- Returns
- The next extractor.
- Since
- 16.0.1
◆ grn_extractor_set_extract_func()
Set an extract function to an extractor.
- Parameters
-
| ctx | The context object. |
| extractor | The extractor. |
| extract | The function to extract a content. |
- Returns
- GRN_SUCCESS on success, the appropriate grn_rc on error.
- Since
- 16.0.1