1/* 2 * Copyright 2017, Data61, CSIRO (ABN 41 687 119 230) 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#include <assert.h> 8#include <camkes.h> 9#include <stdio.h> 10#include <stddef.h> 11#include <stdlib.h> 12#include <string.h> 13 14int run(void) 15{ 16 char *ret; 17 const char *input = "This is a client string."; 18 char *output = NULL; 19 char *joint = malloc(25); 20 strncpy(joint, input, 25); 21 joint[24] = '\0'; 22 23 ret = a_exchange(input, &output, &joint); 24 25 printf("Client output: %s\n", output); 26 printf("Client joint: %s\n", joint); 27 printf("Client ret: %s\n", ret); 28 29 free(output); 30 free(joint); 31 free(ret); 32 return 0; 33} 34