xref: /netbsd-src/external/bsd/libevent/dist/test/test-init.c (revision 657871a79c9a2060a6255a242fa1a1ef76b56ec6)
1*657871a7Schristos /*	$NetBSD: test-init.c,v 1.1.1.3 2021/04/07 02:43:15 christos Exp $	*/
26ecf6635Schristos /*
36ecf6635Schristos  * Copyright (c) 2003-2007 Niels Provos <provos@citi.umich.edu>
46ecf6635Schristos  * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
56ecf6635Schristos  *
66ecf6635Schristos  * Redistribution and use in source and binary forms, with or without
76ecf6635Schristos  * modification, are permitted provided that the following conditions
86ecf6635Schristos  * are met:
96ecf6635Schristos  * 1. Redistributions of source code must retain the above copyright
106ecf6635Schristos  *    notice, this list of conditions and the following disclaimer.
116ecf6635Schristos  * 2. Redistributions in binary form must reproduce the above copyright
126ecf6635Schristos  *    notice, this list of conditions and the following disclaimer in the
136ecf6635Schristos  *    documentation and/or other materials provided with the distribution.
146ecf6635Schristos  * 3. The name of the author may not be used to endorse or promote products
156ecf6635Schristos  *    derived from this software without specific prior written permission.
166ecf6635Schristos  *
176ecf6635Schristos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
186ecf6635Schristos  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
196ecf6635Schristos  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
206ecf6635Schristos  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
216ecf6635Schristos  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
226ecf6635Schristos  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
236ecf6635Schristos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
246ecf6635Schristos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
256ecf6635Schristos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
266ecf6635Schristos  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
276ecf6635Schristos  */
286ecf6635Schristos #include "event2/event-config.h"
296ecf6635Schristos #include <sys/cdefs.h>
30*657871a7Schristos __RCSID("$NetBSD: test-init.c,v 1.1.1.3 2021/04/07 02:43:15 christos Exp $");
316ecf6635Schristos 
326ecf6635Schristos #include <sys/types.h>
336ecf6635Schristos #include <sys/stat.h>
34805a1ce9Schristos #ifdef EVENT__HAVE_SYS_TIME_H
356ecf6635Schristos #include <sys/time.h>
366ecf6635Schristos #endif
37805a1ce9Schristos #ifdef EVENT__HAVE_SYS_SOCKET_H
386ecf6635Schristos #include <sys/socket.h>
396ecf6635Schristos #endif
406ecf6635Schristos #include <fcntl.h>
416ecf6635Schristos #include <stdlib.h>
426ecf6635Schristos #include <stdio.h>
436ecf6635Schristos #include <string.h>
44805a1ce9Schristos #ifndef _WIN32
456ecf6635Schristos #include <unistd.h>
466ecf6635Schristos #endif
476ecf6635Schristos #include <errno.h>
486ecf6635Schristos 
496ecf6635Schristos #include <event.h>
506ecf6635Schristos 
516ecf6635Schristos int
main(int argc,char ** argv)526ecf6635Schristos main(int argc, char **argv)
536ecf6635Schristos {
54805a1ce9Schristos #ifdef _WIN32
556ecf6635Schristos 	WORD wVersionRequested;
566ecf6635Schristos 	WSADATA wsaData;
576ecf6635Schristos 
586ecf6635Schristos 	wVersionRequested = MAKEWORD(2, 2);
596ecf6635Schristos 
606ecf6635Schristos 	(void) WSAStartup(wVersionRequested, &wsaData);
616ecf6635Schristos #endif
626ecf6635Schristos 
63*657871a7Schristos 	/* Initialize the event library */
646ecf6635Schristos 	event_init();
656ecf6635Schristos 
666ecf6635Schristos 	return (0);
676ecf6635Schristos }
686ecf6635Schristos 
69