/src/os/ucos-ii/ftk_ucos_sim.h

http://ftk.googlecode.com/ · C Header · 90 lines · 45 code · 16 blank · 29 comment · 0 complexity · 07a0cb5b8ec199b9a68aa274f512f3c5 MD5 · raw file

  1. /*
  2. * File: ftk_ucos_sim.h
  3. * Author: MinPengli <MinPengli@gmail.com>
  4. * Brief: ucos specific functions.
  5. *
  6. * Copyright (c) 2009 - 2010 MinPengli <MinPengli@gmail.com>
  7. *
  8. * Licensed under the Academic Free License version 2.1
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. */
  24. /*
  25. * History:
  26. * ================================================================
  27. * 2010-03-19 MinPengli <MinPengli@gmail.com> created
  28. *
  29. */
  30. #ifndef FTK_UCOS_SIM_H
  31. #define FTK_UCOS_SIM_H
  32. #ifdef WIN32
  33. #include <io.h>
  34. #include <time.h>
  35. #include <stdio.h>
  36. #include <windows.h>
  37. #include <sys/stat.h>
  38. #include <sys/types.h>
  39. #ifdef UCOS_SIM
  40. #include <ucos_pipe.h>
  41. #endif
  42. #define HAVE_BOOLEAN
  43. #define inline
  44. char* ftk_get_root_dir(void);
  45. char* ftk_get_data_dir(void);
  46. char* ftk_get_testdata_dir(void);
  47. #define __func__ __FILE__
  48. #define FTK_ROOT_DIR ftk_get_root_dir()
  49. #define FTK_FONT "\\gb2312.fnt"
  50. #define DATA_DIR ftk_get_root_dir()
  51. #define LOCAL_DATA_DIR ftk_get_root_dir()
  52. #define FTK_DATA_ROOT ftk_get_data_dir()
  53. #define TESTDATA_DIR ftk_get_testdata_dir()
  54. #define _CRT_SECURE_NO_WARNINGS 1
  55. #define usleep Sleep
  56. #define ftk_getcwd _getcwd
  57. #define ftk_sscanf sscanf
  58. #define strcasecmp stricmp
  59. #define _S_ISDIR(a) 0
  60. char* ftk_strncpy(char *dest, const char *src, size_t n);
  61. int ftk_snprintf(char *str, size_t size, const char *format, ...);
  62. int ftk_vsnprintf(char *str, size_t size, const char *format, va_list ap);
  63. size_t ftk_get_relative_time(void);
  64. #define ftk_pipe_pair(fds) ucos_pipe_create(fds)
  65. #define ftk_pipe_recv(fd, buf, c, x) ucos_pipe_read(fd, buf, c)
  66. #define ftk_pipe_send(fd, buf, c, x) ucos_pipe_write(fd, buf, c)
  67. #define ftk_pipe_close(fd) ucos_pipe_close(fd);
  68. #define ftk_select(n, fdset, tv) ucos_fd_select(fdset, tv)
  69. #define ftk_fd_isset(fd, fdset) ucos_fd_isset(fd, fdset)
  70. #define ftk_delay(t) OSTimeDly(t>>1)
  71. #define FTK_PATH_DELIM '/'
  72. #define USE_FTK_MAIN 1
  73. #endif
  74. #endif/* FTK_UCOS_SIM_H */