Listing 4

string_m *str1 = NULL;

if (retValue = strcreate_m(&str1, "test")) {
  fprintf(
     stderr, 
    "Error %d from strcreate_m.\n", 
     retValue
  );
}
else {
  // print actual string
  if (retValue = getstr_m(&cstr, str1)) {
    fprintf(
      stderr, 
        "error %d from getstr_m.\n", 
        retValue
    );
  }
  printf("(%s)\n", cstr);
  free(cstr);  // have to free duplicate string
}