xref: /openbsd/regress/libexec/ld.so/dlopen/libab/ab.C (revision 73471bf0)
1 /*
2  * Public Domain 2003 Dale Rahn
3  *
4  * $OpenBSD: ab.C,v 1.5 2011/04/03 22:29:50 drahn Exp $
5  */
6 
7 #include <iostream>
8 #include <stdlib.h>
9 #include <string.h>
10 #include "ab.h"
11 
12 char strbuf[512];
13 
14 extern "C" {
15 const char *libname = "libab";
16 };
17 
18 extern "C" char *
19 lib_entry()
20 {
21 	strlcpy(strbuf, libname, sizeof strbuf);
22 	strlcat(strbuf, ":", sizeof strbuf);
23 	strlcat(strbuf, "ab", sizeof strbuf);
24 	return strbuf;
25 	std::cout << "called into ab " << libname << " libname " << "\n";
26 }
27 
28 BB::BB(const char *str)
29 {
30 	_name = str;
31 }
32 
33 BB::~BB()
34 {
35 }
36 BB ab("local");
37