This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via cc83288477bc668c5e5705521c816eb595341ec3 (commit)
from c1f95312aa80118993c459e6b7ed8e18a18caa25 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/cc83288477bc668c5e5705521c816eb59534…
commit cc83288477bc668c5e5705521c816eb595341ec3
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 31 21:58:52 2012 +0100
doc: Remove header from examples.
diff --git a/doc/examples.txt b/doc/examples.txt
index 683b9f5..0f6566b 100644
--- a/doc/examples.txt
+++ b/doc/examples.txt
@@ -1,7 +1,3 @@
-GFXprim Code Examples
-=====================
-Cyril Hrubis <metan(a)ucw.cz>
-
Image loaders examples
----------------------
-----------------------------------------------------------------------
Summary of changes:
doc/examples.txt | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via c1f95312aa80118993c459e6b7ed8e18a18caa25 (commit)
from 301969902482047daf10a8d766ddadef816cba8c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/c1f95312aa80118993c459e6b7ed8e18a18c…
commit c1f95312aa80118993c459e6b7ed8e18a18caa25
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 31 21:51:05 2012 +0100
doc: Add favicon do the asciidoc template.
diff --git a/doc/asciidoc.conf b/doc/asciidoc.conf
index bc30e9a..bf03dc0 100644
--- a/doc/asciidoc.conf
+++ b/doc/asciidoc.conf
@@ -11,6 +11,7 @@ icons
<meta name="generator" content="AsciiDoc {asciidoc-version}" />
<meta name="description" content="{description}" />
<meta name="keywords" content="{keywords}" />
+<link rel="icon" type="image/png" href="favicon.png">
<title>{title}</title>
{title%}<title>{doctitle=}</title>
<link rel="stylesheet" href="{stylesdir=.}/{theme=asciidoc}.css" type="text/css" />
-----------------------------------------------------------------------
Summary of changes:
doc/asciidoc.conf | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 10ac58d34771e81c0c00f1e5d6d812427af2c2d8 (commit)
from fd131ab40d827e66825dfe9202e2e02021ba07c1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/10ac58d34771e81c0c00f1e5d6d812427af2…
commit 10ac58d34771e81c0c00f1e5d6d812427af2c2d8
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 31 17:28:54 2012 +0100
doc: backends, coding_style: Typos and fixes.
diff --git a/doc/backends.txt b/doc/backends.txt
index a4fb226..aca70f6 100644
--- a/doc/backends.txt
+++ b/doc/backends.txt
@@ -7,7 +7,8 @@ initialization interface each backend has it's specific function and semantics
but once backend is initialized the backend structure provides unified API for
controlling the drawing.
-So far there are backends for Linux mmaped frame-buffer, libSDL and X11.
+So far there are backends for Linux mmaped 'frame-buffer', 'libSDL' and
+'X Window System'.
TIP: For example usage see backend link:example_backend.html[example].
@@ -220,9 +221,9 @@ WARNING: It's very important to call this functions on application exit. If you
doesn't do so, the state of the display, resolution etc. may not be
reset back to its original state. This includes program crashes and
iterruptions. Also this function may not be signal-async-safe, it's
- better to set signal hanlers that calls it as this usually works and
- not doing so may leave non-working system with black display or
- non-responding keyboard.
+ better to set signal hanlers that calls it on SEGFAULT and SIGBUS
+ as this usually works and not doing so may leave non-working system
+ with black display or non-responding keyboard.
[source,c]
-------------------------------------------------------------------------------
@@ -273,14 +274,16 @@ void GP_BackendWait(GP_Backend *backend);
Blocks until backend event arrives.
-NOTE: Events recieved by backend are not necessarily translated into the input
- events.
+[NOTE]
+Events recieved by backend are not necessarily translated into the input
+events.
-WARNING: Using GP_BackendWait() in multithreaded program will most likely
- cause deadlocks. As the backend data structures and connection is
- guarded by a lock any other backend function (called from different
- thread while GP_BackendWait() is blocking) will lock until
- GP_BackendWait() returns (i.e. event was recieved).
+[WARNING]
+Using GP_BackendWait() in multithreaded program will most likely cause
+deadlocks. As the backend data structures and connection is guarded by a lock
+any other backend function (called from different thread while
+GP_BackendWait() is blocking) will lock until GP_BackendWait() returns (i.e.
+event was recieved).
[source,c]
-------------------------------------------------------------------------------
@@ -326,4 +329,4 @@ multithreaded application where one threads waits for events and others draws
into the buffer so you can stop the drawing threads before the backend context
size change.
-See input link:input.html[input events] for more information.
+TIP: For more information see link:input.html[input events] documentation.
diff --git a/doc/coding_style.txt b/doc/coding_style.txt
index 37bb19e..b4afeaf 100644
--- a/doc/coding_style.txt
+++ b/doc/coding_style.txt
@@ -19,7 +19,7 @@ enligthening reading).
* We use tabs for indentation and tab is eight spaces wide.
-* Lines should be maximally 80 chars long.
+* Lines should be at most 80 chars long.
* No additional whitespaces (other than newline) at the end of line.
@@ -101,26 +101,26 @@ break;
}
----
-TIP: You can use Linux Kernel +scripts/checkpatch.pl+ to check your code.
+TIP: You can use Linux Kernel 'scripts/checkpatch.pl' to check your code.
GFXprim Specific Rules
^^^^^^^^^^^^^^^^^^^^^^
* Library external API uses CamelCase
-** Together with mandatory +GP_+ prefix.
-** For example +GP_PixelType+, +GP_Context+, etc.
+** Together with mandatory 'GP_' prefix.
+** For example 'GP_PixelType', 'GP_Context', etc.
** We will not change that, get over it. (It could have been worse, trust me.)
* Basic library types are typedefed
-** We have +GP_Size+ and +GP_Coord+ integer types to better distinguish
+** We have 'GP_Size' and 'GP_Coord' integer types to better distinguish
roles of function parameters.
-** The basic structures are also typedefed so you can wite +GP_Context+
- instead of +struct GP_Context+.
+** The basic structures are also typedefed so you can wite 'GP_Context'
+ instead of 'struct GP_Context'.
** Other uses of typedef are frowned upon.
-* When you add a externally symbol visible symbol, i.e. new API function
- please add its name into the corresponding file at +build/syms/+. You may
- also run the +buld/check_symbols.sh+ script to check that you haven't
+* When you add an externally visible symbol, i.e. new API function
+ please add its name into the corresponding file at 'build/syms/'. You may
+ also run the 'buld/check_symbols.sh' script to check that you haven't
accidentally exposed intenal only interfaces.
Python Coding Style
-----------------------------------------------------------------------
Summary of changes:
doc/backends.txt | 27 +++++++++++++++------------
doc/coding_style.txt | 20 ++++++++++----------
2 files changed, 25 insertions(+), 22 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via fd131ab40d827e66825dfe9202e2e02021ba07c1 (commit)
from 526d3b35fea6668250aaf0f6a71303bd46adba45 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/fd131ab40d827e66825dfe9202e2e02021ba…
commit fd131ab40d827e66825dfe9202e2e02021ba07c1
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Mon Dec 31 17:08:21 2012 +0100
doc: Add coding style document.
diff --git a/doc/Makefile b/doc/Makefile
index bbb1ab0..23d87e7 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -1,7 +1,7 @@
SOURCES=general.txt context.txt loaders.txt filters.txt basic_types.txt drawing_api.txt backends.txt gamma.txt grabbers.txt environment_variables.txt debug.txt core.txt api.txt input.txt - gen.txt pixels.txt coordinate_system.txt
+ gen.txt pixels.txt coordinate_system.txt coding_style.txt
EXAMPLE_SOURCES=$(wildcard example_*.txt)
diff --git a/doc/api.txt b/doc/api.txt
index 7d4898a..4a75fd4 100644
--- a/doc/api.txt
+++ b/doc/api.txt
@@ -80,3 +80,11 @@ GFXprim Internals
Describes structure and basic usage of the templating engine (C code
generator).
+
+
+Development
+-----------
+
+. link:coding_style.html[Coding Style]
+ +
+ C and Python coding style.
+ +
diff --git a/doc/coding_style.txt b/doc/coding_style.txt
new file mode 100644
index 0000000..37bb19e
--- /dev/null
+++ b/doc/coding_style.txt
@@ -0,0 +1,129 @@
+Coding Style
+------------
+
+This document defines coding style for GFXprim.
+
+C Coding Style
+~~~~~~~~~~~~~~
+
+GFXprim is written in C. There is no C++ code in and I mean it. A few headers
+do contain '#ifndef __cplusplus' so that you can interface GFXprim headers as
+'extern C' without problems. If this doesn't work, let us know.
+
+GFXprim follows mostly Linux Kernel coding style, see
+'Documentation/CodingStyle' in the Linux Kernel source or follow this
+link:http://www.kernel.org/doc/Documentation/CodingStyle[link] (it's funny and
+enligthening reading).
+
+.Indentation and whitespaces
+
+* We use tabs for indentation and tab is eight spaces wide.
+
+* Lines should be maximally 80 chars long.
+
+* No additional whitespaces (other than newline) at the end of line.
+
+* Each file must end with newline (most editors do that automatically, beware
+ of Kate).
+
+.Braces and Spaces
+
+* Avoid tricky expressions if possible ;)
+
+* Do not put multiple statements on a single line.
++
+[source,c]
+----
+/* WRONG */
+if (something) do_work();
+ do_other();
+
+/* RIGHT */
+if (something)
+ do_work();
+
+do_other();
+----
+
+* Each block that has more than one line should be enclosed in
+ curly braces.
++
+Also if one part of if then else is enclosed in
+curly braces the other one should be enclosed too.
++
+[source,c]
+----
+/* WRONG */
+if (something)
+ do_other_thing();
+ else if (something_else)
+ do_thing();
+ else
+ return;
+
+/* RIGHT */
+if (something) {
+ do_other_thing();
+} else {
+ if (something_else)
+ do_thing();
+ else
+ return;
+}
+----
+
+* On the other hand do not use braces unnecesarily.
++
+[source,c]
+----
+/* WRONG */
+if (something) {
+ do_work();
+}
+
+/* RIGHT */
+if (something)
+ do_work();
+----
+
+* The preffered way of writing switch is as follows:
++
+[source,c]
+----
+switch (var) {
+case XYZ:
+ do_something():
+break;
+case ABC:
+ return 1;
+default:
+break;
+}
+----
+
+TIP: You can use Linux Kernel +scripts/checkpatch.pl+ to check your code.
+
+GFXprim Specific Rules
+^^^^^^^^^^^^^^^^^^^^^^
+
+* Library external API uses CamelCase
+** Together with mandatory +GP_+ prefix.
+** For example +GP_PixelType+, +GP_Context+, etc.
+** We will not change that, get over it. (It could have been worse, trust me.)
+
+* Basic library types are typedefed
+** We have +GP_Size+ and +GP_Coord+ integer types to better distinguish
+ roles of function parameters.
+** The basic structures are also typedefed so you can wite +GP_Context+
+ instead of +struct GP_Context+.
+** Other uses of typedef are frowned upon.
+
+* When you add a externally symbol visible symbol, i.e. new API function
+ please add its name into the corresponding file at +build/syms/+. You may
+ also run the +buld/check_symbols.sh+ script to check that you haven't
+ accidentally exposed intenal only interfaces.
+
+Python Coding Style
+~~~~~~~~~~~~~~~~~~~
+
+TODO
-----------------------------------------------------------------------
Summary of changes:
doc/Makefile | 2 +-
doc/api.txt | 8 +++
doc/coding_style.txt | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 138 insertions(+), 1 deletions(-)
create mode 100644 doc/coding_style.txt
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via ee2a7bf0f846b6283b0c3cab6acb7c5afb4ca93b (commit)
from 3d1396ad2aa8763807e048d91cde205e764b237f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/ee2a7bf0f846b6283b0c3cab6acb7c5afb4c…
commit ee2a7bf0f846b6283b0c3cab6acb7c5afb4ca93b
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Dec 29 11:38:51 2012 +0100
loaders: GP_Loader: Fix previous commit.
We need to do access() first then stat().
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c
index 05b1240..c3769a6 100644
--- a/libs/loaders/GP_Loader.c
+++ b/libs/loaders/GP_Loader.c
@@ -234,16 +234,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
{
int saved_errno;
struct stat st;
-
- if (stat(src_path, &st)) {
- GP_WARN("Failed to stat '%s': %s", src_path, strerror(errno));
- } else {
- if (st.st_mode & S_IFDIR) {
- errno = EISDIR;
- return NULL;
- }
- }
-
+
if (access(src_path, R_OK)) {
saved_errno = errno;
@@ -256,6 +247,15 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
return NULL;
}
+ if (stat(src_path, &st)) {
+ GP_WARN("Failed to stat '%s': %s", src_path, strerror(errno));
+ } else {
+ if (st.st_mode & S_IFDIR) {
+ errno = EISDIR;
+ return NULL;
+ }
+ }
+
GP_Context *img;
const GP_Loader *ext_load = NULL, *sig_load;
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_Loader.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project gfxprim.git.
The branch, master has been updated
via 3d1396ad2aa8763807e048d91cde205e764b237f (commit)
from 458bf7bf0abdd984b499c4deadc7551232108c5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/gfxprim.git/commit/3d1396ad2aa8763807e048d91cde205e764b…
commit 3d1396ad2aa8763807e048d91cde205e764b237f
Author: Cyril Hrubis <metan(a)ucw.cz>
Date: Sat Dec 29 00:22:20 2012 +0100
loaders: GP_Load: Add check for directory.
diff --git a/libs/loaders/GP_Loader.c b/libs/loaders/GP_Loader.c
index fdd2641..05b1240 100644
--- a/libs/loaders/GP_Loader.c
+++ b/libs/loaders/GP_Loader.c
@@ -29,6 +29,9 @@
#include <string.h>
#include <unistd.h>
#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include "core/GP_Debug.h"
@@ -230,7 +233,17 @@ static const GP_Loader *loader_by_signature(const char *path)
GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
{
int saved_errno;
-
+ struct stat st;
+
+ if (stat(src_path, &st)) {
+ GP_WARN("Failed to stat '%s': %s", src_path, strerror(errno));
+ } else {
+ if (st.st_mode & S_IFDIR) {
+ errno = EISDIR;
+ return NULL;
+ }
+ }
+
if (access(src_path, R_OK)) {
saved_errno = errno;
@@ -242,7 +255,7 @@ GP_Context *GP_LoadImage(const char *src_path, GP_ProgressCallback *callback)
return NULL;
}
-
+
GP_Context *img;
const GP_Loader *ext_load = NULL, *sig_load;
-----------------------------------------------------------------------
Summary of changes:
libs/loaders/GP_Loader.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
repo.or.cz automatic notification. Contact project admin jiri.bluebear.dluhos(a)gmail.com
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
gfxprim.git ("A simple 2D graphics library with emphasis on correctness and well-defined operation.")