fork download
  1. #include <stdio.h>
  2.  
  3. struct ubus_args {
  4. char *key;
  5. char *val;
  6. };
  7.  
  8. int ubus_call(char *obj, char *method, struct ubus_args u_args[], int size_args) {
  9. printf("%s\n", obj);
  10. printf("%s\n", method);
  11. printf("%s %s\n", u_args->key, u_args->val);
  12. return 0;
  13. }
  14.  
  15. int main (void)
  16. {
  17. ubus_call("router", "client", (struct ubus_args[]){{"network", "lan"}, {"dhcp", "true"}}, 2);
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
router
client
network  lan