sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* A small support DLL for STDLIB test programs
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*
|
sl@0
|
18 |
*/
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifdef __cplusplus
|
sl@0
|
23 |
extern "C" {
|
sl@0
|
24 |
#endif
|
sl@0
|
25 |
#include <_ansi.h>
|
sl@0
|
26 |
|
sl@0
|
27 |
/* STDLIB equivalent of RTest
|
sl@0
|
28 |
*/
|
sl@0
|
29 |
|
sl@0
|
30 |
struct __testdata {
|
sl@0
|
31 |
int iCheck;
|
sl@0
|
32 |
int iSubtest;
|
sl@0
|
33 |
int iErrno;
|
sl@0
|
34 |
};
|
sl@0
|
35 |
|
sl@0
|
36 |
extern struct __testdata __td;
|
sl@0
|
37 |
|
sl@0
|
38 |
IMPORT_C void td_Title(struct __testdata* td, char *title);
|
sl@0
|
39 |
IMPORT_C void td_Next(struct __testdata* td, char *testname);
|
sl@0
|
40 |
IMPORT_C void td_Test(struct __testdata* td, int line, int mustBeTrue);
|
sl@0
|
41 |
IMPORT_C void td_TestErrno(struct __testdata* td, int line, int mustBeTrue, int expectedErrno);
|
sl@0
|
42 |
IMPORT_C void td_Close(void);
|
sl@0
|
43 |
|
sl@0
|
44 |
#define test_Data struct __testdata __td /* declares global variable __td */
|
sl@0
|
45 |
|
sl@0
|
46 |
#define test_Title(title) td_Title(&__td, title)
|
sl@0
|
47 |
#define test_Next(testname) td_Next(&__td, testname)
|
sl@0
|
48 |
#define test_Close() td_Close()
|
sl@0
|
49 |
#define test_Test(line,cond) td_Test(&__td, line, cond)
|
sl@0
|
50 |
#define test_TestErrno(line,cond,expected) td_TestErrno(&__td, line, cond, expected)
|
sl@0
|
51 |
|
sl@0
|
52 |
#define test_Start(x) test_Next(x)
|
sl@0
|
53 |
#define test(f) test_Test(__LINE__, (f)?1:0)
|
sl@0
|
54 |
#define test_ok(f) test_TestErrno(__LINE__, (f)?1:0, errno)
|
sl@0
|
55 |
#define test_errno(f,expected) test_TestErrno(__LINE__, (f)?1:0, expected)
|
sl@0
|
56 |
|
sl@0
|
57 |
|
sl@0
|
58 |
/* Routine to ensure that the Comms server is running
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
IMPORT_C int CommInit(int enhanced);
|
sl@0
|
61 |
|
sl@0
|
62 |
|
sl@0
|
63 |
/* C routine for starting the redirection server
|
sl@0
|
64 |
*/
|
sl@0
|
65 |
|
sl@0
|
66 |
IMPORT_C int start_redirection_server(void);
|
sl@0
|
67 |
|
sl@0
|
68 |
|
sl@0
|
69 |
/* C routines for creating EPOC32 threads
|
sl@0
|
70 |
*/
|
sl@0
|
71 |
|
sl@0
|
72 |
IMPORT_C int start_posix_server(void);
|
sl@0
|
73 |
|
sl@0
|
74 |
IMPORT_C void* create_thread(void (*aFn)(), char* aName);
|
sl@0
|
75 |
IMPORT_C void start_thread(void* aThread);
|
sl@0
|
76 |
IMPORT_C int wait_for_thread(void* aThread);
|
sl@0
|
77 |
|
sl@0
|
78 |
IMPORT_C void* create_process(void (*aFn)(), char* aName, char* mode, int fids[3]);
|
sl@0
|
79 |
IMPORT_C void start_process(void* aThread);
|
sl@0
|
80 |
IMPORT_C int wait_for_process(void* aThread);
|
sl@0
|
81 |
IMPORT_C int wait_for_process_id(void* aProcess, int procid, int opt, int* status);
|
sl@0
|
82 |
IMPORT_C int get_proc_id(void* aProcess);
|
sl@0
|
83 |
/* C-callable routines to access the EPOC32 asynchonous ioctl facilities
|
sl@0
|
84 |
*
|
sl@0
|
85 |
* NB. The int* status parameter stands in for the usual TRequestStatus&
|
sl@0
|
86 |
*/
|
sl@0
|
87 |
IMPORT_C int async_ioctl(int aFid, int aCmd, void* aParam, int* status);
|
sl@0
|
88 |
IMPORT_C int async_ioctl_completion(int aFid, int aCmd, void* aParam, int* status);
|
sl@0
|
89 |
|
sl@0
|
90 |
#ifdef __cplusplus
|
sl@0
|
91 |
}
|
sl@0
|
92 |
#endif
|