PageRenderTime 106ms CodeModel.GetById 61ms app.highlight 10ms RepoModel.GetById 30ms app.codeStats 0ms

/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/*
26 * History:
27 * ================================================================
28 * 2010-03-19 MinPengli <MinPengli@gmail.com> created
29 *
30 */
31
32#ifndef FTK_UCOS_SIM_H
33#define FTK_UCOS_SIM_H
34
35#ifdef WIN32
36#include <io.h>
37#include <time.h>
38#include <stdio.h>
39#include <windows.h>
40#include <sys/stat.h>
41#include <sys/types.h>
42
43#ifdef UCOS_SIM
44#include <ucos_pipe.h>
45#endif
46
47#define HAVE_BOOLEAN
48#define inline 
49
50char* ftk_get_root_dir(void);
51char* ftk_get_data_dir(void);
52char* ftk_get_testdata_dir(void);
53
54#define __func__       __FILE__
55#define FTK_ROOT_DIR   ftk_get_root_dir()
56#define FTK_FONT       "\\gb2312.fnt"
57#define DATA_DIR       ftk_get_root_dir()
58#define LOCAL_DATA_DIR ftk_get_root_dir()
59#define FTK_DATA_ROOT  ftk_get_data_dir()
60#define TESTDATA_DIR   ftk_get_testdata_dir()
61
62#define _CRT_SECURE_NO_WARNINGS 1
63
64#define usleep			Sleep
65#define ftk_getcwd		_getcwd
66#define ftk_sscanf    sscanf
67#define strcasecmp stricmp
68#define _S_ISDIR(a) 0
69char* ftk_strncpy(char *dest, const char *src, size_t n);
70int   ftk_snprintf(char *str, size_t size, const char *format, ...);
71int   ftk_vsnprintf(char *str, size_t size, const char *format, va_list ap);
72
73size_t ftk_get_relative_time(void);
74
75#define ftk_pipe_pair(fds)				ucos_pipe_create(fds)
76#define ftk_pipe_recv(fd, buf, c, x)	ucos_pipe_read(fd, buf, c)
77#define ftk_pipe_send(fd, buf, c, x)	ucos_pipe_write(fd, buf, c)
78#define ftk_pipe_close(fd)				ucos_pipe_close(fd);
79
80#define ftk_select(n, fdset, tv)		ucos_fd_select(fdset, tv)
81#define ftk_fd_isset(fd, fdset)			ucos_fd_isset(fd, fdset)
82#define ftk_delay(t)					OSTimeDly(t>>1)
83
84#define FTK_PATH_DELIM '/'
85#define USE_FTK_MAIN 1
86
87#endif
88
89#endif/* FTK_UCOS_SIM_H */
90