XCache is a fast, stable PHP opcode cacher that has been proven and is now running on production servers under high load. https://xcache.lighttpd.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

39 lines
810 B

  1. #define TSRMLS_DC
  2. #define TSRMLS_CC
  3. #define pemalloc(size, p) malloc(size)
  4. #define perealloc(ptr, size, p) realloc(ptr, size)
  5. #define pefree(ptr, p) free(ptr)
  6. #include <stdio.h>
  7. #include "xc_vector.h"
  8. #undef CHECK
  9. #define CHECK(a, msg) do { \
  10. if (!(a)) { \
  11. fprintf(stderr, "%s\n", msg); return -1; \
  12. } \
  13. } while (0)
  14. int main() /* {{{ */
  15. {
  16. xc_vector_t vector = xc_vector_initializer(int, 0);
  17. int t;
  18. t = 1; xc_vector_push_back(&vector, &t);
  19. t = 2; xc_vector_push_back(&vector, &t);
  20. t = 3; xc_vector_push_back(&vector, &t);
  21. xc_vector_reverse(&vector);
  22. t = xc_vector_pop_back(int, &vector);
  23. CHECK(t == 1, "not 1");
  24. t = xc_vector_pop_back(int, &vector);
  25. CHECK(t == 2, "not 2");
  26. t = xc_vector_pop_back(int, &vector);
  27. CHECK(t == 3, "not 3");
  28. xc_vector_destroy(&vector);
  29. return 0;
  30. }
  31. /* }}} */