summaryrefslogtreecommitdiffstats
path: root/usr.bin/unifdef/unifdef.h
diff options
context:
space:
mode:
authorfanf <fanf@FreeBSD.org>2013-03-28 20:33:07 +0000
committerfanf <fanf@FreeBSD.org>2013-03-28 20:33:07 +0000
commit8700b245788b30564851967247e796b25f5425cb (patch)
tree344429af2d978e08d2efc077b943d266021429b9 /usr.bin/unifdef/unifdef.h
parent9e7e2d6285a0444ccbaf2b33f9a8467080cd6268 (diff)
downloadFreeBSD-src-8700b245788b30564851967247e796b25f5425cb.zip
FreeBSD-src-8700b245788b30564851967247e796b25f5425cb.tar.gz
Update to upstream version 2.7
The most notable new feature is support for processing multiple files in one invocation. There is also support for more make-friendly exit statuses. The most notable bug fix is #line directives now include the input file name. Obtained from: http://dotat.at/prog/unifdef
Diffstat (limited to 'usr.bin/unifdef/unifdef.h')
-rw-r--r--usr.bin/unifdef/unifdef.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/usr.bin/unifdef/unifdef.h b/usr.bin/unifdef/unifdef.h
new file mode 100644
index 0000000..8837b68
--- /dev/null
+++ b/usr.bin/unifdef/unifdef.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2012 Tony Finch <dot@dotat.at>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/stat.h>
+
+#include <ctype.h>
+#include <err.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* portabiity stubs */
+
+#define fbinmode(fp) (fp)
+
+static FILE *
+mktempmode(char *tmp, int mode)
+{
+ int fd = mkstemp(tmp);
+ if (fd < 0) return (NULL);
+ fchmod(fd, mode & (S_IRWXU|S_IRWXG|S_IRWXO));
+ return (fdopen(fd, "wb"));
+}
OpenPOWER on IntegriCloud