File: need.c

package info (click to toggle)
fudgit 2.42-6
  • links: PTS
  • area: non-free
  • in suites: potato, woody
  • size: 2,468 kB
  • ctags: 2,375
  • sloc: ansic: 27,729; makefile: 793; yacc: 724; lex: 102; asm: 29; fortran: 15
file content (25 lines) | stat: -rw-r--r-- 499 bytes parent folder | download
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
/* explicity reference the given symbol, so that the library routine
   defining this symbol will be loaded */

#include <stdio.h>

need (argc, argv)
int argc;
char *argv[];
{
	register int i;

	for (i = 1; i < argc; i++) {
	register int dld_errno;

	printf ("%d: %s", i, argv[i]);
	fflush (stdout);
	if (dld_errno = dld_create_reference (argv[i]))
		printf ("--Error: %d\n", dld_errno);
	else {
		if (dld_get_symbol (argv[i]))
		printf ("--Symbol already defined\n");
		else printf ("\n");
	}
	}
}