lib: move some examples/* into specific subdirectories of their lib
authorJean Privat <jean@pryen.org>
Tue, 30 Sep 2014 20:01:08 +0000 (16:01 -0400)
committerJean Privat <jean@pryen.org>
Tue, 30 Sep 2014 23:51:02 +0000 (19:51 -0400)
examples/ starts to become a mess.
So move the simple examples of lib into an `example` subdirectory of the lib.

Signed-off-by: Jean Privat <jean@pryen.org>

20 files changed:
lib/ai/examples/examples.nit [new file with mode: 0644]
lib/bcm2835/examples/blink.nit [moved from examples/rpi/blink.nit with 100% similarity]
lib/bcm2835/examples/examples.nit [new file with mode: 0644]
lib/bcm2835/examples/input.nit [moved from examples/rpi/input.nit with 100% similarity]
lib/curl/examples/curl_http.nit [moved from examples/curl_http.nit with 100% similarity]
lib/curl/examples/curl_mail.nit [moved from examples/curl_mail.nit with 100% similarity]
lib/curl/examples/examples.nit [new file with mode: 0644]
lib/glesv2/examples/examples.nit [new file with mode: 0644]
lib/glesv2/examples/opengles2_hello_triangle.nit [moved from examples/opengles2_hello_triangle.nit with 96% similarity]
lib/html/examples/examples.nit [new file with mode: 0644]
lib/html/examples/html_page.nit [moved from examples/html_page.nit with 100% similarity]
lib/privileges/examples/drop_privileges.nit [moved from examples/drop_privileges.nit with 100% similarity]
lib/privileges/examples/examples.nit [new file with mode: 0644]
lib/socket/examples/examples.nit [new file with mode: 0644]
lib/socket/examples/socket_client.nit [moved from examples/socket_client.nit with 100% similarity]
lib/socket/examples/socket_server.nit [moved from examples/socket_server.nit with 99% similarity]
lib/template/examples/examples.nit [new file with mode: 0644]
lib/template/examples/tmpl_composer.nit [moved from examples/tmpl_composer.nit with 100% similarity]
lib/websocket/examples/examples.nit [new file with mode: 0644]
lib/websocket/examples/websocket_server.nit [moved from examples/websocket_server.nit with 99% similarity]

diff --git a/lib/ai/examples/examples.nit b/lib/ai/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/bcm2835/examples/examples.nit b/lib/bcm2835/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/curl/examples/examples.nit b/lib/curl/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/glesv2/examples/examples.nit b/lib/glesv2/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
similarity index 96%
rename from examples/opengles2_hello_triangle.nit
rename to lib/glesv2/examples/opengles2_hello_triangle.nit
index 2b39b1b..32663d0 100644 (file)
@@ -17,7 +17,7 @@
 # Basic example of OpenGL ES 2.0 usage from the book OpenGL ES 2.0 Programming Guide.
 #
 # Code reference:
-# https://code.google.com/p/opengles-book-samples/source/browse/trunk/LinuxX11/Chapter_2/Hello_Triangle/Hello_Triangle.c 
+# https://code.google.com/p/opengles-book-samples/source/browse/trunk/LinuxX11/Chapter_2/Hello_Triangle/Hello_Triangle.c
 module opengles2_hello_triangle
 
 import glesv2
@@ -127,10 +127,10 @@ assert_no_gl_error
 var vertex_shader = new GLVertexShader
 assert vertex_shader.is_ok else print "Vertex shader is not ok: {gl_error}"
 vertex_shader.source = """
-attribute vec4 vPosition;   
-void main()                 
-{                           
-  gl_Position = vPosition;  
+attribute vec4 vPosition;
+void main()
+{
+  gl_Position = vPosition;
 }                           """
 vertex_shader.compile
 assert vertex_shader.is_compiled else print "Vertex shader compilation failed with: {vertex_shader.info_log} {program.info_log}"
diff --git a/lib/html/examples/examples.nit b/lib/html/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/privileges/examples/examples.nit b/lib/privileges/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/socket/examples/examples.nit b/lib/socket/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
similarity index 99%
rename from examples/socket_server.nit
rename to lib/socket/examples/socket_server.nit
index aa77a75..c435320 100644 (file)
@@ -49,4 +49,3 @@ loop
                ns.close
        end
 end
-
diff --git a/lib/template/examples/examples.nit b/lib/template/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/lib/websocket/examples/examples.nit b/lib/websocket/examples/examples.nit
new file mode 100644 (file)
index 0000000..e69de29
similarity index 99%
rename from examples/websocket_server.nit
rename to lib/websocket/examples/websocket_server.nit
index 38029c3..aa1124a 100644 (file)
@@ -43,4 +43,3 @@ while not sock.listener.eof do
                if msg != "" then print msg
        end
 end
-