Skip to content

Commit

Permalink
First commit for github
Browse files Browse the repository at this point in the history
  • Loading branch information
muquit committed Jun 24, 2017
0 parents commit 58924e3
Show file tree
Hide file tree
Showing 19 changed files with 2,905 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .classpath
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
36 changes: 36 additions & 0 deletions .project
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>libsodium-jna</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
8 changes: 8 additions & 0 deletions .settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.7
4 changes: 4 additions & 0 deletions .settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
5 changes: 5 additions & 0 deletions ChangeLog.txt
@@ -0,0 +1,5 @@
# v1.01

* Throw SodiumLibraryException in case of error. Before RuntimeException was thrown for everything.
(Jan-31-2017)

675 changes: 675 additions & 0 deletions README.md

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions misc/Makefile
@@ -0,0 +1,26 @@
rm=/bin/rm -f
CC= cc
DEFS=
PROGNAME= gen_test_vectors
INCLUDES= -I.
LIBS=`pkg-config --libs libsodium`


DEFINES= $(INCLUDES) $(DEFS) -DSYS_UNIX=1
CFLAGS= -g $(DEFINES) `pkg-config --cflags libsodium`

SRCS = gen_test_vectors.c

OBJS = gen_test_vectors.o

.c.o:
$(rm) $@
$(CC) $(CFLAGS) -c $*.c

all: $(PROGNAME)

$(PROGNAME) : $(OBJS)
$(CC) $(CFLAGS) -o $(PROGNAME) $(OBJS) $(LIBS)

clean:
$(rm) $(OBJS) $(PROGNAME) core *~
47 changes: 47 additions & 0 deletions misc/extract_declarations.rb
@@ -0,0 +1,47 @@
#!/usr/bin/env ruby

#
# extract funcition declarations from sodium header files
# muquit@muquit.com
class ExtractFuncs
def initialize
@regex = /^int|^size_t|^const|^unsigned|^long|^char.+$/
end

def doit
ARGV.each do |file|
lines = File.readlines(file)
lines.each_with_index do |val,idx|
line = lines[idx]
line.chomp! if line
next if line.length == 0
if line =~ @regex
if line =~ /;$/
puts line
next
else
puts "#{line}"
idx = idx + 1
line = lines[idx];
while line !~ /\;$/
idx = idx + 1
l = lines[idx];
if l =~ /attribute.+;$/
puts ";"
else
puts "#{l}"
end
if l =~ /\;$/
break
end
end
end
end
end
end
end
end

if __FILE__ == $0
ExtractFuncs.new().doit()
end

0 comments on commit 58924e3

Please sign in to comment.