PageRenderTime 27ms CodeModel.GetById 23ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/os/sylixos/ftk_sylixos.h

http://ftk.googlecode.com/
C++ Header | 93 lines | 48 code | 16 blank | 29 comment | 0 complexity | 027b282b3a3e8b7e5ed8426ea1a91545 MD5 | raw file
 1/*
 2 * File: ftk_sylixos.h
 3 * Author:  Han.hui <sylixos@gmail.com>
 4 * Brief:   sylixos specific functions.
 5 *
 6 * Copyright (c) 2009 - 2010  Li XianJing <xianjimli@hotmail.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 * 2011-05-15 Han.hui <sylixos@gmail.com> created
29 *
30 */
31
32#ifndef FTK_SYLIXOS_H

33#define FTK_SYLIXOS_H

34
35#include <fcntl.h>

36#include <dirent.h>

37#include <sys/types.h>

38#include <sys/types.h>

39#include <sys/stat.h>

40#include <unistd.h>

41#include <ctype.h>

42#include <mouse.h>

43#include <keyboard.h>

44#include <sys/select.h>

45#include <sys/time.h>

46#include <sys/types.h>

47#include <sys/socket.h>

48
49#define div_t lib_div_t

50
51#define FTK_ROOT_DIR                    "/ftk"

52#define DATA_DIR                        FTK_ROOT_DIR

53#define LOCAL_DATA_DIR                  FTK_ROOT_DIR

54#define FTK_DATA_ROOT                   FTK_ROOT_DIR"/data"

55#define TESTDATA_DIR                    FTK_ROOT_DIR"/testdata"

56#define FTK_FONT_DIR                    FTK_ROOT_DIR"/data"

57#define APP_DATA_DIR                    FTK_ROOT_DIR"/apps"

58#define APP_LOCAL_DATA_DIR              FTK_ROOT_DIR"/apps"

59
60#define FTK_FONT                        "font.ttf"

61
62#define FTK_CNF                         FTK_ROOT_DIR"/ftk.conf"

63
64#define ftk_strncpy                     strncpy

65#define ftk_snprintf                    snprintf

66#define ftk_vsnprintf                   vsnprintf

67#define ftk_getcwd                      getcwd

68#define ftk_sscanf                      sscanf

69
70#define ftk_pipe_pair(fds)              pipe(fds)

71#define ftk_pipe_close(fd)              close(fd)

72#define ftk_pipe_recv(fd, buf, length)  read(fd, buf, length)

73#define ftk_pipe_send(fd, buf, length)  write(fd, buf, length)

74
75#ifndef __cplusplus

76void ftk_assert(int cond, const char* func, const char* file, int line);
77#undef assert

78#define assert(cond)                    ftk_assert(cond, __func__, __FILE__, __LINE__)

79#endif

80
81#define min(a,b)                        ((a) < (b) ? (a) : (b))

82
83#include "./config_ftk.h"

84
85#define FTK_PATH_DELIM                  '/'

86
87#define FTK_HAS_MAIN                    0

88#define FTK_HAS_DLOPEN                  1

89#define FTK_HAS_LUA                     1

90
91#define FTK_OPTIMIZE_WIDGET_PAINT       0

92
93#endif  /* FTK_SYLIXOS_H */