1 /* $OpenBSD: entropy.c,v 1.1 2021/05/27 18:18:41 bluhm Exp $ */ 2 3 /* 4 * Copyright (c) 2021 Alexander Bluhm <bluhm@openbsd.org> 5 * 6 * Permission to use, copy, modify, and distribute this software for any 7 * purpose with or without fee is hereby granted, provided that the above 8 * copyright notice and this permission notice appear in all copies. 9 * 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 */ 18 19 #include <err.h> 20 #include <expat.h> 21 #include <string.h> 22 23 int 24 main(int argc, char *argv[]) 25 { 26 XML_Parser p; 27 enum XML_Status s; 28 29 if (setenv("EXPAT_ENTROPY_DEBUG", "1", 1) != 0) 30 err(1, "setenv EXPAT_ENTROPY_DEBUG"); 31 32 p = XML_ParserCreate(NULL); 33 if (p == NULL) 34 errx(1, "XML_ParserCreate"); 35 s = XML_Parse(p, "", 0, 0); 36 if (s != XML_STATUS_OK) 37 errx(1, "XML_Parse: %d", s); 38 39 return 0; 40 } 41