Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e258b183e56afc958390d1a0ed10cadcfac1b5c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * (c) Copyright QNX Software Systems Ltd. 2002, 2003.
 * All Rights Reserved.
 */
/********
 * This is a sample C file that will be used in testing the TranslationUnit
 * class.  It has a specific structure that will be looked for within the 
 * test case.
 * This file is only ment to contain various C elements, and may not compile
 * into a running application (but should be valid C)
 */
 
#include <stdio.h>
#include <unistd.h>

/* A function prototype */
int func2p(void); 

/* A global variable */
int globalvar;

/* A enumeration */
enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4};

/* A structure. This also includes a typedef around the strcture def
 * which at the time of writing was not picked up.
 */
typedef struct mystruct {
	int a;
	char b;
	long c;
} mystruct_t; 

/* A union */
union myunion {
	int x;
	char y;
	long z;
};

/* A typedef */
typedef struct mystruct mytype;


/* A couple functions */
 
void * func1(void)
{
	return(NULL);
}


int func2(void)
{
	return(0);
}
 
int main(int argc, char ** argv)
{
	int var1;
	printf("Hello world\n");
}


void func3()
{
	printf("This is not really here\n");
}


Back to the top