Init.
authorStanislaw Klekot <dozzie@jarowit.net>
Mon, 10 Feb 2014 18:44:14 +0000 (19:44 +0100)
committerStanislaw Klekot <dozzie@jarowit.net>
Mon, 10 Feb 2014 18:44:14 +0000 (19:44 +0100)
.gitignore [new file with mode: 0644]
COPYING [new file with mode: 0644]
Makefile [new file with mode: 0644]
examples/examples.erl [new file with mode: 0644]
examples/file_format.erl [new file with mode: 0644]
examples/sample.eni [new file with mode: 0644]
rebar.config [new file with mode: 0644]
src/eni.app.src [new file with mode: 0644]
src/overview.edoc [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..425f733
--- /dev/null
@@ -0,0 +1,4 @@
+.*.swp
+*.beam
+*.app
+/doc
diff --git a/COPYING b/COPYING
new file mode 100644 (file)
index 0000000..dfb4d09
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,28 @@
+                      3-CLAUSE BSD LICENSE
+
+Copyright (c) Stanislaw Klekot.
+All rights reserved.
+
+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.
+3. Neither the names of the copyright holders nor the names of its
+   contributors may be used to endorse or promote products derived from
+   this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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.
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..84f1d5f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,36 @@
+#!/usr/bin/make
+
+#-----------------------------------------------------------------------------
+
+#DIALYZER_PLT = ~/.dialyzer_plt
+DIALYZER_OPTS = --no_check_plt $(foreach D,$(DIALYZER_PLT),--plt $D)
+
+#-----------------------------------------------------------------------------
+
+.PHONY: all doc edoc compile build dialyzer
+
+all: compile doc
+
+doc edoc:
+       rebar doc
+
+compile build: dialyzer
+       rebar compile
+
+dialyzer:
+       dialyzer $(strip $(DIALYZER_OPTS)) --src src
+
+#-----------------------------------------------------------------------------
+
+#srpm: VERSION=$(shell awk '$$1 == "%define" && $$2 == "_version" {print $$3}' redhat/*.spec)
+#srpm: PKGNAME=erlang-eni
+#srpm:
+#      rm -rf rpm-build
+#      mkdir -p rpm-build/rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
+#      git archive --format=tar --prefix=$(PKGNAME)-$(VERSION)/ HEAD | gzip -9 > rpm-build/rpm/SOURCES/$(PKGNAME)-$(VERSION).tar.gz
+#      rpmbuild --define="%_usrsrc $$PWD/rpm-build" --define="%_topdir %{_usrsrc}/rpm" -bs redhat/*.spec
+#      mv rpm-build/rpm/SRPMS/$(PKGNAME)-*.src.rpm .
+#      rm -r rpm-build
+
+#-----------------------------------------------------------------------------
+# vim:ft=make
diff --git a/examples/examples.erl b/examples/examples.erl
new file mode 100644 (file)
index 0000000..60a5b5b
--- /dev/null
@@ -0,0 +1,7 @@
+%%%---------------------------------------------------------------------------
+%%% @doc
+%%%   Some ENI usage examples.
+%%% @end
+%%%---------------------------------------------------------------------------
+
+-module(examples).
diff --git a/examples/file_format.erl b/examples/file_format.erl
new file mode 100644 (file)
index 0000000..4081315
--- /dev/null
@@ -0,0 +1,9 @@
+%%%---------------------------------------------------------------------------
+%%% @doc
+%%%   ENI file format.
+%%%
+%%%   The format is derived from DOS/Windows INI file.
+%%% @end
+%%%---------------------------------------------------------------------------
+
+-module(file_format).
diff --git a/examples/sample.eni b/examples/sample.eni
new file mode 100644 (file)
index 0000000..c74853c
--- /dev/null
@@ -0,0 +1,17 @@
+; comment
+# also comment
+% and this one
+
+no_section = 100
+
+[sect]
+string = some string
+# may be ended with period, but doesn't need to
+term := [{atom, true}, <<"binary">>]
+
+[s1]
+foo = bar
+fooa := bar
+fooa. := nabla.
+
+# vim:ft=dosini
diff --git a/rebar.config b/rebar.config
new file mode 100644 (file)
index 0000000..b1710a4
--- /dev/null
@@ -0,0 +1,6 @@
+{erl_opts, [debug_info]}.
+{edoc_opts, [
+  {overview, "src/overview.edoc"},
+  {source_path, ["src", "examples"]},
+  todo, private, hidden
+]}.
diff --git a/src/eni.app.src b/src/eni.app.src
new file mode 100644 (file)
index 0000000..940a3f5
--- /dev/null
@@ -0,0 +1,7 @@
+{application, eni, [
+  {description, "INI file parser"},
+  {vsn, "0.0.0"},
+  {registered, []},
+  {applications, [kernel, stdlib]}
+]}.
+% vim:ft=erlang
diff --git a/src/overview.edoc b/src/overview.edoc
new file mode 100644 (file)
index 0000000..97b5b2f
--- /dev/null
@@ -0,0 +1,13 @@
+@author Stanislaw Klekot <dozzie@jarowit.net>
+@version 0.0.0
+@title INI file parser for Erlang.
+@doc
+
+<b>TODO</b>: some description.
+
+== Example usage ==
+
+For usage examples see documentation of {@link examples_client} and
+{@link examples_server} modules.
+
+<!-- vim:set ft=edoc: -->