Enclave1.cpp 510 B

1234567891011121314151617181920212223242526
  1. #include <stdarg.h>
  2. #include <stdio.h> /* vsnprintf */
  3. #include "$(enclaveName).h"
  4. #include "$(enclaveName)_t.h" /* print_string */
  5. /*
  6. * printf:
  7. * Invokes OCALL to display the enclave buffer to the terminal.
  8. */
  9. void printf(const char *fmt, ...)
  10. {
  11. char buf[BUFSIZ] = {'\0'};
  12. va_list ap;
  13. va_start(ap, fmt);
  14. vsnprintf(buf, BUFSIZ, fmt, ap);
  15. va_end(ap);
  16. ocall_$(enclaveName)_sample(buf);
  17. }
  18. int ecall_$(enclaveName)_sample()
  19. {
  20. printf("IN $(ENCLAVENAME)\n");
  21. return 0;
  22. }