xref: /xnu-12377.41.6/tests/print_apple_array.c (revision bbb1b6f9e71b8cdde6e5cd6f4841f207dee3d828)
1*bbb1b6f9SApple OSS Distributions /*
2*bbb1b6f9SApple OSS Distributions  * Simple program to dump the apple array contents to stdout for verification.
3*bbb1b6f9SApple OSS Distributions  * Note that libsystem mucks with some of the fields before we can see them.
4*bbb1b6f9SApple OSS Distributions  */
5*bbb1b6f9SApple OSS Distributions 
6*bbb1b6f9SApple OSS Distributions #include <stdio.h>
7*bbb1b6f9SApple OSS Distributions #include <stdbool.h>
8*bbb1b6f9SApple OSS Distributions 
9*bbb1b6f9SApple OSS Distributions int
main(__unused int argc,__unused char ** argv,__unused char ** environ,char ** apple)10*bbb1b6f9SApple OSS Distributions main(
11*bbb1b6f9SApple OSS Distributions 	__unused int argc,
12*bbb1b6f9SApple OSS Distributions 	__unused char **argv,
13*bbb1b6f9SApple OSS Distributions 	__unused  char **environ,
14*bbb1b6f9SApple OSS Distributions 	char **apple)
15*bbb1b6f9SApple OSS Distributions {
16*bbb1b6f9SApple OSS Distributions 	int i = 0;
17*bbb1b6f9SApple OSS Distributions 	while (true) {
18*bbb1b6f9SApple OSS Distributions 		char *curr = apple[i];
19*bbb1b6f9SApple OSS Distributions 		if (curr == NULL) {
20*bbb1b6f9SApple OSS Distributions 			break;
21*bbb1b6f9SApple OSS Distributions 		} else {
22*bbb1b6f9SApple OSS Distributions 			printf("%s\n", curr);
23*bbb1b6f9SApple OSS Distributions 		}
24*bbb1b6f9SApple OSS Distributions 		i++;
25*bbb1b6f9SApple OSS Distributions 	}
26*bbb1b6f9SApple OSS Distributions 	return 0;
27*bbb1b6f9SApple OSS Distributions }
28