Elia Battiston | ac8d23f | 2022-03-14 17:54:56 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2022-present Open Networking Foundation |
| 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 | |
| 17 | #include <sysrepo.h> |
| 18 | #include <sysrepo/xpath.h> |
| 19 | |
| 20 | //Needed to handle callback functions with a working data type in CGO |
| 21 | typedef void (*function)(); // https://golang.org/issue/19835 |
| 22 | |
| 23 | //Exported by sysrepo.go |
| 24 | void get_data_cb(); |
| 25 | |
| 26 | int get_data_cb_wrapper( |
| 27 | sr_session_ctx_t *session, |
| 28 | uint32_t subscription_id, |
| 29 | const char *module_name, |
| 30 | const char *path, |
| 31 | const char *request_xpath, |
| 32 | uint32_t request_id, |
| 33 | struct lyd_node **parent, |
| 34 | void *private_data) |
| 35 | { |
| 36 | get_data_cb(); |
| 37 | |
| 38 | return SR_ERR_OK; |
| 39 | } |