[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2021-06-14 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=0c15b20c036db846654c37f32cf2d14743f22166

commit 0c15b20c036db846654c37f32cf2d14743f22166
Author: Raster 
Date:   Mon Jun 14 09:15:23 2021 -0700

Wiki page start changed with summary [] by Raster
---
 pages/start.txt | 1 -
 1 file changed, 1 deletion(-)

diff --git a/pages/start.txt b/pages/start.txt
index 2d2f4a9b1..28658b6b6 100644
--- a/pages/start.txt
+++ b/pages/start.txt
@@ -71,4 +71,3 @@ Many of our **Enlightenment Developer Days** events have been 
sponsored and paid
 [[https://www.gandi.net|{{:thanks-gandi.svg|Gandi}}]]
 [[https://www.samsung.com|{{:thanks-samsung.svg|Samsung}}]]
 [[https://openwide.fr|{{:thanks-openwide.svg|Openwide}}]]
-

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-07-02 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=b562d6d4f6bcb35b884de7dfee2d7ba01c6c5446

commit b562d6d4f6bcb35b884de7dfee2d7ba01c6c5446
Author: Raster ras...@rasterman.com
Date:   Thu Jul 2 19:34:54 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/start.txt b/pages/start.txt
index fc3fec6..800b2d2 100644
--- a/pages/start.txt
+++ b/pages/start.txt
@@ -1,7 +1,7 @@
 ~~Title: Enlightenment Main~~
 
+{{pagestart-shortcuts}}
 {{pagestart-event}}
-
 {{pagestart-release}}
 
 {{ :e-logo-title.png?nolink150 |}}

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-06-22 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=5d37fa32552ac582783f15c3324c8a9a295bac16

commit 5d37fa32552ac582783f15c3324c8a9a295bac16
Author: Raster ras...@rasterman.com
Date:   Sun Jun 21 23:51:29 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 0e35c45..1e1e80f 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -596,6 +596,25 @@ A good 
[[http://man7.org/linux/man-pages/man2/syscalls.2.html|list of system cal
 
 
  Endianess 
+
+Memory is really a sequence of bytes from the view of a CPU, but when you 
access data types like ''short''s or ''int''s etc. that consume multiple bytes, 
the order that they are read from in memory and assigned to slots from the LSB 
(Least Significant Byte) to the MSB (Most Significant byte). There are 2 
commonly referred to ways of accessing these bytes in multi-byte types, called 
**Big Endian** and **Little Endian**. 
[[http://en.wikipedia.org/wiki/Endianness|Endianess]] these days is m [...]
+
+^Architecture ^Endianess ^
+^x86  |Little|
+|x86_64   |Little|
+|ARM  |Little|
+|PowerPC  |Big   |
+|MIPS |Big   |
+|SPARC|Big   |
+|Alpha|Big   |
+
+That means that the majority of people will find themselves programming for a 
little endian environment. This does not mean you can assume it everywhere. 
Many file formats store data in a big endian fashion, as do many network 
protocols, so when you deal with memory and have to save and load it or 
transmit it across a network, you need to be very careful about endianess and 
have to convert as necessary. Also be aware that alignment also matters.
+
+In memory, in order from lowest memory address to highest, endianess looks as 
follows for an 4 byte ''int'' type:
+
+^Decimal^Hex  ^Big endian   ^Little endian^
+|1393589900 |''53107e8c'' |''53107e8c'' |''8c7e1053'' |
+
  Function pointers 
  Callbacks 
  Threads 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-06-18 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=b90686bce9b87684bdf3148d81cb6522ec05af54

commit b90686bce9b87684bdf3148d81cb6522ec05af54
Author: Raster ras...@rasterman.com
Date:   Wed Jun 17 23:03:30 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 7456794..6f7d398 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -495,7 +495,7 @@ Generally you allocate memory with functions such as 
''malloc()'', ''calloc()'',
 
 The memory of your process, other than memory used to store the 
code/instructions loaded from disk, is primarily made up of 2 elements. The 
[[http://en.wikipedia.org/wiki/Call_stack|stack]] and the 
[[http://en.wikipedia.org/wiki/Memory_management|heap]]. Your memory space will 
generally look something as follows, often with the stack high up in memory (at 
high addresses) and pieces of code from the process and libraries mapped in 
from disk, as well as heap space being allocated there too [...]
 
-{{ memstackheap.svg?nolink |Complete memory space diagram }}
+{{ memheapstack.svg?nolink |Complete memory space diagram }}
 
 The stack is managed for you mostly by the compiler and runtime. As the 
application runs, every time a function is called, a new blob of memory is 
pushed at the top of the stack (conceptually stacks grow.. thus the top is 
where the newest item(s) are on the stack, but often the stack grows down in 
memory, so to push you subtract values from the top of the stack and to pop, 
you add again). This memory contains the parameters passed to each function, 
and will contain return values from [...]
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-06-17 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=f00f4bf554a61df54745ad374c5f687620bea97d

commit f00f4bf554a61df54745ad374c5f687620bea97d
Author: Raster ras...@rasterman.com
Date:   Wed Jun 17 02:20:00 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 89af214..233243b 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -503,13 +503,13 @@ The heap is where more permanent memory is stored, and 
data here remains until e
 
 A shared library is simple a large bit of code you can load when your 
application (or library) is loaded, where the code in it is shared with other 
users on the system. It mostly is provided by another group of developers, and 
thus may change its internals without your application or library needing to be 
re-compiled. If there is a bug in the library it may be fixed later on by an 
update to the library. Everyone who installs the update gets the fix. Same for 
new features. Libraries hav [...]
 
-If you want to do something privileged, or hide data, it needs to cross a 
process boundary. Normally you're speak some form of IPC to a privileged root 
process for example. Of course all of this we share everything with libraries 
also means that code in your application could corrupt/mess/destroy data the 
library is maintaining, as well as vice-versa. There is no protection between a 
library, another library and your process. This lack of protection means 
performance is very good and [...]
+If you want to do something privileged, or hide data, it needs to cross a 
process boundary. Normally you'll speak some form of IPC to a privileged root 
process for example. Of course all of this we share everything with libraries 
also means that code in your application could corrupt/mess/destroy data the 
library is maintaining, as well as vice-versa. There is no protection between a 
library, another library and your process. This lack of protection means 
performance is very good and [...]
 
 The benefit of a shared library is to avoid needing a re-compile to get 
improvements, save writing all the code the library shares with you, and to 
share the memory the code in the shared library would consume. As it is a 
//SHARED// library, the code from that library is loaded only once on the 
system. It may add to the virtual size of the process, but this space is shared 
across every process using that library, so the cost is paid just once.
 
-Generally a library exposes an API (a set of functions to call). It will 
provide header files you #include in your application (or library). you would 
link to the library and thus, at runtime, the runtime linker (ld.so often), 
will glue in the function symbols in your code to the library you link to. This 
is all done at the start of process startup before the main() function is 
called. There is a cost to this, but it is generally worth paying for the 
benefits. your code will then be ab [...]
+Generally a library exposes an API (a set of functions to call). It will 
provide header files you #include in your application (or library). You would 
link to the library and thus, at runtime, the runtime linker (ld.so often), 
will glue in the function symbols in your code to the library you link to. This 
also is done for global variables exposed by the library as well. This is all 
done at the start of process startup before the main() function is called. 
There is a cost to this, but i [...]
 
-You generally would compile your code to link to a library as follows, 
assuming the source for your application is ''hello.c'', the binary you wish to 
output is ''hello'' and the libray you want to link to is ''eina'' (often the 
file on disk will be ''libeina.so'' for the development environment).
+You generally would compile your code to link to a library as follows, 
assuming the source for your application is ''hello.c'', the binary you wish to 
output is ''hello'' and the library you want to link to is ''eina'' (often the 
file on disk will be ''libeina.so'' for the development environment).
 
cc hello.c -o hello -leina
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-28 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=68fb006d729468afb5f8bc2b37c81f82e6e5c91b

commit 68fb006d729468afb5f8bc2b37c81f82e6e5c91b
Author: Raster ras...@rasterman.com
Date:   Thu May 28 04:17:48 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 0a67536..d5eb355 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -95,7 +95,7 @@ An example:
 
 CPUs will do arithmetic, logic operations, change what it is they execute, and 
read from or write to memory to deal with data. In the end, everything to a CPU 
is effectively a number, somewhere to store it to or load it from and some 
operation you do to it.
 
-To computers, numbers are a string of bits. A bit can be on or off. Just 
like you may be used to numbers, with each digit having 10 values (0 through to 
9), A computer sees numbers more simply. It is 0, or it is 1. Just like you can 
have a bigger number by adding a digit (1 digit can encode 10 values, 2 digits 
can encode 100 values, 3 can encode 1000 values etc.), So too with the binary 
(0 or 1) numbering system computers use. Every binary digit you add doubles the 
number of values you [...]
+To computers, numbers are a string of bits. A bit can be on or off. Just 
like you may be used to numbers, with each digit having 10 values (0 through to 
9), A computer sees numbers more simply. It is 0, or it is 1. Just like you can 
have a bigger number by adding a digit (1 digit can encode 10 values, 2 digits 
can encode 100 values, 3 can encode 1000 values etc.), So too with the binary 
(0 or 1) numbering system computers use. Every binary digit you add doubles the 
number of values you [...]
 
 ^Binary   ^Hexadecimal ^Decimal ^
 |101  |d   |14  |
@@ -434,7 +434,7 @@ So only compile the active code in when enabled in the 
compilation process.
 
  Memory 
 
-Reality is that languages like C are really a slightly more convenient and 
portable interface to the actual machine you have. That means the CPU, it's 
instructions and processing as well as memory that the CPU will access one way 
or another. Let's visualize just some of this. Imagine memory as simply a 
series of boxes than can contain a number that has a value from 0 to 255 (if 
unsigned). To do signed values we just interpret values differently. We can 
have from -128 to 127 as values. Wh [...]
+Reality is that languages like C are really a slightly more convenient and 
portable interface to the actual machine you have. That means the CPU, it's 
instructions and processing as well as memory that the CPU will access one way 
or another. Let's visualize just some of this. Imagine memory as simply a 
series of boxes than can contain a number that has a value from 0 to 255 (if 
unsigned). To do signed values we just interpret values differently. We can 
have from -128 to 127 as values. Wh [...]
 
 ^Byte ^Value ^
 |0|01|
@@ -493,7 +493,7 @@ Generally you allocate memory with functions such as 
''malloc()'', ''calloc()'',
 
  Stack and heap ===
 
-The memory of your process, other than memory used to store the 
code/instructions loaded from disk, is primarily made up of 2 elements. The 
[[stack|http://en.wikipedia.org/wiki/Call_stack]] and the 
[[heap|http://en.wikipedia.org/wiki/Memory_management]].
+The memory of your process, other than memory used to store the 
code/instructions loaded from disk, is primarily made up of 2 elements. The 
[[http://en.wikipedia.org/wiki/Call_stack|stack]] and the 
[[http://en.wikipedia.org/wiki/Memory_management|heap]].
 
 The stack is managed for you mostly by the compiler and runtime. As the 
application runs, every time a function is called, a new blob of memory is 
pushed at the top of the stack. This memory contains the parameters passed 
to the function, and will contain return values from the function as well as a 
return address to go back (to read instructions from) to when this function 
returns. It is a very simple structure, and yet incredibly useful. Note that 
stack often have limited sizes (so [...]
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-28 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=822ceef964ef295835af817c6191d97ae8745fb6

commit 822ceef964ef295835af817c6191d97ae8745fb6
Author: Raster ras...@rasterman.com
Date:   Thu May 28 04:39:07 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 32 ++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index d5eb355..89af214 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -508,17 +508,45 @@ If you want to do something privileged, or hide data, it 
needs to cross a proces
 The benefit of a shared library is to avoid needing a re-compile to get 
improvements, save writing all the code the library shares with you, and to 
share the memory the code in the shared library would consume. As it is a 
//SHARED// library, the code from that library is loaded only once on the 
system. It may add to the virtual size of the process, but this space is shared 
across every process using that library, so the cost is paid just once.
 
 Generally a library exposes an API (a set of functions to call). It will 
provide header files you #include in your application (or library). you would 
link to the library and thus, at runtime, the runtime linker (ld.so often), 
will glue in the function symbols in your code to the library you link to. This 
is all done at the start of process startup before the main() function is 
called. There is a cost to this, but it is generally worth paying for the 
benefits. your code will then be ab [...]
- 
+
+You generally would compile your code to link to a library as follows, 
assuming the source for your application is ''hello.c'', the binary you wish to 
output is ''hello'' and the libray you want to link to is ''eina'' (often the 
file on disk will be ''libeina.so'' for the development environment).
+
+   cc hello.c -o hello -leina
+
+This assumes the library is in a standard directory the compiler always looks 
in. This would be ''/lib'' and ''/usr/lib''. If the library is not there, you 
need to tell the compiler of a new location to look at with the ''-L'' option 
such as the following if the eina library you wish to link to is located in 
''/usr/local/lib'':
+
+  cc hello.c -o hello -leina -L/usr/local/lib
+
+Of course that is just the linking. The include files may also require an 
option to tell the compiler to look somewhere other than ''/usr/include''. That 
option is the ''-I'' option as follows if the include files needed are in 
''/usr/local/include/eina-1'':
+
+  cc hello.c -o hello -leina -L/usr/local/lib -I/usr/local/include/eina-1
+
+This of course is rather painful, and that is why a modern system called 
[[http://en.wikipedia.org/wiki/Pkg-config|Pkg-config]] was created, and it is 
far easier to use. The above would become a simpler:
+
+  cc hello.c -o hello `pkg-config --cflags --libs eina`
+
+In this case ''pkg-config'' will provide the compiler flags needed to link to 
eina. If you want to use multiple libraries, just list them as follows:
+
+  cc hello.c -o hello `pkg-config --cflags --libs eina ecore embryo`
+
+Pkg-config relies on setting your ''PKG_CONFIG_PATH'' environment variable to 
indicate where to look for the ''.pc'' files that contain the include and 
linking information. You may want to do a one-time setup of this environment 
variable in your shell setup like:
+
+  export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
+
+Add as many directories as you like with a '':'' character between them. They 
will be searched in order from the first to last, until a matching ''.pc'' file 
is found.
+
  API calls 
  System calls 
 
 
- Alignment 
+
  Endianess 
  Function pointers 
  Callbacks 
  Threads 
 
+
+
 === Also See ===
 
 Now you have read our less-than-perfect primer on C for those wanting to get 
into developing on EFL or using it from the C APIs we have, you may also want 
to look at the following list of pages and pick up some more information or 
fill in the gaps we do not cover here //(feel free to link to more articles 
that are good for teaching C from new developers through to advanced)//.

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-18 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=9655a54122269407190f13fc45ba931d1f15dcb0

commit 9655a54122269407190f13fc45ba931d1f15dcb0
Author: Raster ras...@rasterman.com
Date:   Mon May 18 02:21:29 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/efl/advanced/start.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/pages/docs/efl/advanced/start.txt 
b/pages/docs/efl/advanced/start.txt
index 0fb493e..b5a58fc 100644
--- a/pages/docs/efl/advanced/start.txt
+++ b/pages/docs/efl/advanced/start.txt
@@ -1,8 +1,6 @@
 ~~Title: Advanced EFL Topics~~
 ~~CODE-c~~
 
-{{pageindex}}
-
  Advanced topics with more detail 
 
 These are some more advanced topics for developers, once they have gotten up 
to speed with the [[/docs/efl/start|getting started]] documentation.

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-16 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=1a1b048958033cc9a3ee98fe4720d99f9a25c72d

commit 1a1b048958033cc9a3ee98fe4720d99f9a25c72d
Author: Raster ras...@rasterman.com
Date:   Sat May 16 22:21:54 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 85 ++
 1 file changed, 85 insertions(+)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index e1b25b3..2b382f4 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -343,6 +343,91 @@ The ''do while'' loop is just like ''while'' But the test 
statement is executed
 
  Pre-processor and Macros 
 
+You already had your first encounter with the C pre-processor with the 
''#include'' line in the first Hello world example above. The pre-processor 
is executed during compilation before the code is actually parsed by the C 
compiler proper. The job of the pre-processor in general is to generate more 
code. This mechanism is used to save a lot of repetitive typing, copy  
pasting, conditional compilation (compile section of code A instead of code B 
based on compile-time information), a [...]
+
+== System include headers ==
+code c
+#include Eina.h
+/code
+
+These headers define functions, types and even other pre-processor macros for 
use in your code. These headers are generally provided by system libraries 
(such as libc or EFL etc.) and you generally would place such include lines at 
the top of your C source files to indicate you are including the content of 
that file. Remember that this file is also passed through the pre-processor and 
thus can recurse, including more files than can include more files and so on. 
All the content of these [...]
+
+== Local headers ==
+code c
+#include myheader.h
+/code
+
+Once your projects get a bit larger, you will divide your application or 
library up into many .c and .h files. The headers (.h files) will define things 
from other parts of your source code base. you likely will use a Makefile or 
some similar mechanism to compile your project file by file and then link it 
together. You will compile the .c files, and include .h files along the way. 
The  quotes as opposed to the  is that this here searches in the 
same directory as the source fil [...]
+
+== Defined values ==
+code c
+#define NUM_ITEMS 100
+
+int x = NUM_ITEMS;
+/code
+
+It is useful to avoid magic numbers in your code to define them in a central 
place (at the top of your .c files or in a shared common .h file) and give them 
a name. If you need to change them later, you change them in one place only. 
This also helps document the purpose of this magic value as it gives it a 
descriptive name, improving maintainability. Note that you can also undefine 
a value with an ''#undef NUM_ITEMS'' for example. This will remove the 
definition from that point on in [...]
+
+code c
+#define MY_TITLE Hello world
+
+printf(This is: %n, MY_TITLE);
+/code
+
+You can define anything. It literally is a string replacement system, so it 
will replace the defined toke with what you define it as. This works with 
numbers, strings, functions and whole sections of text. You can even define a 
definition with other definitions inside of it:
+
+code c
+#define NUM_ITEMS 100
+#define MY_STRING Hello, NUM_ITEMS
+
+printf(This string: %s has %i items\n, MY_STRING);
+/code
+
+== More complex macros ==
+code c
+#define SIMPLE_FUNC(x, y) complex_func(100, 200, x, hello, 4.8, y)
+
+int x = rand();
+SIMPLE_FUNC(Boo, 10 * x);
+/code
+
+You can define macros that take parameters. They will produce the code that 
you specify exactly as given, replacing instances of the tokens given as 
parameters as they are passed into the macro. This is extremely useful in being 
able to simplify and make code more concise. The tokens passed in don't have to 
even have to be simple single values. They can be entire expressions going on 
and on, even entire snippets of code. Such macros are very powerful, and a 
common convention in C is to m [...]
+
+== Conditional compilation ==
+code c
+int
+myfunc(void)
+  {
+#ifdef _WIN32
+// windows specific code here
+#else
+// generic code here
+#endif
+  }
+/code
+
+Another very common use of the pre-processor is to compile only some pieces of 
code in specific circumstances. A common use-case is for portability (but you 
can also use this along with #includes, macros etc. to use the pre-processor as 
a code-generation tool to save a lot of re-typing of almost the same bits of 
code). On one platform you may have to have some pieces of code work in a 
specific way that differs from other platforms. This commonly happens with 
Windows vs Linux vs BSD etc.  [...]
+
+You can use this also to compile your code with features enabled or not. You 
can define pre-processor values on the command line with ''-D'' with most 
compilers, such as 

[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-16 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=74daf0482cb1a1a70dfd4fc9a1ac6a6e9105b719

commit 74daf0482cb1a1a70dfd4fc9a1ac6a6e9105b719
Author: Raster ras...@rasterman.com
Date:   Sat May 16 22:29:11 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 2b382f4..485c7d0 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -447,6 +447,11 @@ So only compile the active code in when enabled in the 
compilation process.
 Now you have read our less-than-perfect primer on C for those wanting to get 
into developing on EFL or using it from the C APIs we have, you may also want 
to look at the following list of pages and pick up some more information or 
fill in the gaps we do not cover here //(feel free to link to more articles 
that are good for teaching C from new developers through to advanced)//.
 
   * [[http://www.cprogramming.com/tutorial/c-tutorial.html|C tutorial]]
+  * [[http://www.le.ac.uk/users/rjm1/cotter|Introduction to C]]
+  * [[http://www.tutorialspoint.com/cprogramming|C tutorial]]
+  * [[http://www.cac.cornell.edu/VW/Cintro|C Intro]]
+  * [[http://www.ntu.edu.sg/home/ehchua/programming/cpp/c0_Introduction.html|C 
programming tutorial]]
+  * [[http://en.wikipedia.org/wiki/C_(programming_language)|Wikipedia C 
language page]]
 
 
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-14 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=32cadc8c1c1408a5563ba4d150c071a469f9b10f

commit 32cadc8c1c1408a5563ba4d150c071a469f9b10f
Author: Raster ras...@rasterman.com
Date:   Thu May 14 07:55:24 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index e5feabc..e1b25b3 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -341,6 +341,8 @@ The ''while'' loop simple checks the statement in the 
braces following the while
 
 The ''do while'' loop is just like ''while'' But the test statement is 
executed at the end of each loop, not at the start, so you are guaranteed that 
the inner scope code of the loop will execute at least once before a test.
 
+ Pre-processor and Macros 
+
 
 
  Memory 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-12 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=253322e9058a4b3ea4bee53a32345af7f6bd0911

commit 253322e9058a4b3ea4bee53a32345af7f6bd0911
Author: Raster ras...@rasterman.com
Date:   Tue May 12 04:03:23 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index cd41d8e..2886999 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -194,6 +194,8 @@ make_sandwich(enum filling *fillings, int num_fillings)
 
 sandwich = malloc(sizeof(struct sandwich));
 if (!sandwich) return NULL;
+get_bread_top((sandwich-top));
+get_bread_bottom((sandwich-bottom));
 sandwich-fillings = malloc(sizeof(enum filling) * num_fillings);
 if (!sandwich-fillings)
   {
@@ -211,11 +213,19 @@ I may call the function as follows:
 
 code c
 struct sandwich *sandwich;
-struct filling my_fillings[3] = {FILLING_HAM, CHEESE, BUTTER};
+struct filling my_fillings[3] = {FILLING_HAM, FILLING_CHEESE, FILLING_BUTTER};
 
 sandwich = make_sandwich(my_fillings, 3);
 /code
 
+You will notice we used little markers such at * to indicate the variable is a 
//POINTER// to that type of variable. This also is used for return types of 
functions. This level of indirection (to return something that points to the 
the real thing) is very common, because it is very efficient (returning only 4 
or 8 bytes of data) and keeping the original data exactly where it is without 
needing any copies. It means we can modify the same object from many locations 
by passing around a poin [...]
+
+We also use the  operator to get the pointer //TO// that element in 
memory. This is a great way of passing in please do something to THIS THING 
HERE that i have. In the above case, we call an imaginary function that we 
haven't specified above to get a bread slice and place it into the top and 
bottom elements of the sandwich.
+
+So back to functions, They exist mostly to hide complexity. Many simple things 
you will see are actually rather complex, and are many detailed steps to get it 
right. Functions encapsulate this and hide it at a higher level. They are 
basically ways of summarizing this bit of code here with a defined set of 
input parameters (0 or more) and a return value (or no return) when the 
function is done. When a function is called, execution waits for it to finish 
before resuming in the current scope.
+
+In C (and on a machine) everything lives in memory somewhere, and so functions 
can even have pointers. This is a very useful mechanism to say call this thing 
here, when this other things happens. What this thing here is can be 
modified at runtime to point to any function you like. These are often referred 
to as Callbacks. See below for more details on these.
+
  Types 
  Arithmetic 
  Logic 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-08 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=d9d9bf0ab781d7d0b88108e6c3aacbb192e522b2

commit d9d9bf0ab781d7d0b88108e6c3aacbb192e522b2
Author: Raster ras...@rasterman.com
Date:   Fri May 8 20:08:06 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 61 +-
 1 file changed, 56 insertions(+), 5 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index bc70b0c..cd41d8e 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -59,19 +59,19 @@ The next thing that happens is for the code to call a 
function ''printf()'' with
 printf(Hello world!\n);
 /code
 
-Now finally we return from the main function with the value 0. The ''main()'' 
function of an application is special. It always returns an integer that 
indicates the success of the application. This is used by the shell executing 
the process to determine success. A return of ''0'' indicates the process ran 
successfully.
+Now finally we return from the main function with the value 0. The ''main()'' 
function of an application is special. It always returns an integer that 
indicates the success of the application. This is used by the shell executing 
the process to determine success. A return of ''0'' indicates the process ran 
successfully. Any other return value is an indicator of failure.
 
 code c
 return 0;
 /code
 
-You will notice a few things. First lines starting with ''#'' are commands, 
but don't have a '';''. This is normal because these lines are processed by the 
pre-processor. All code in C goes through the C pre-processor and this 
basically generates more code. Other lines that are not starting a function, 
ending it or defining control end every statement in C with a '';'' character. 
If you don't do this, the statement continues until a '';'' is found, even if 
it goes across multiple lines.
+You will notice a few things. First lines starting with ''#'' are commands, 
but don't have a '';''. This is normal because these lines are processed by the 
pre-processor. All code in C goes through the C pre-processor and this 
basically generates more code for the compiler to actually deal with. Other 
lines that are not starting a function, ending it or defining control end every 
statement in C with a '';'' character. If you don't do this, the statement 
continues until a '';'' is found,  [...]
 
 If we look at how the application is compiled, We execute the C compiler, give 
it 1 or more source files to compile and the with ''-o'' tell it what output 
file to produce (the executable)
 
   cc hello.c -o hello
 
-Often ''cc'' will be replaced with things like ''gcc'' or maybe ''clang'' or 
whatever compiler you prefer.
+Often ''cc'' will be replaced with things like ''gcc'' or maybe ''clang'' or 
whatever compiler you prefer. A compiler will run the source through the 
pre-processor and then convert your source code into a binary form that your 
CPU and Os can actually understand and run.
 
 Now let's take a detour back to the machine that is running your very first C 
application.
 
@@ -147,7 +147,7 @@ You can even tell the compiler to make sure it has an 
initial value. If you don'
 int bob = 42;
 /code
 
-Once you have declared a variable, you can now use it. You can group values 
together in repeating sequences using arrays or in mixed groups called 
structs.
+Once you have declared a variable, you can now use it. You can group values 
together in repeating sequences using //arrays// or in mixed groups called 
//structs// that contain a sequence of variables structured as indicated. Order 
is important and is maintained in memory. You can at times take advantage of 
this ordering for doing things like inheritance. Arrays also have strict 
ordering in memory, so you can later on use pointers and simple arithmetic to 
walk up and down an array to ac [...]
 
 code c
 int bobs[100];
@@ -158,13 +158,64 @@ double things[200];
 struct mydata
   {
  int count;
- double items[100]
+ double items[100];
   };
 
 struct mydata bob;
 /code
 
+Structs (structured data) are very important and allow C to become rather 
complex and powerful when it comes to data storage, and don't forget you can 
embed structs inside structs, have arrays of structs, structs with arrays and 
use pointers to indirect from one struct to another, arrays of pointers to 
structs and so on.
+
  Functions 
+
+A function is a basic unit of execution. Conceptually a function hides an 
implementation of how to do something and exposes this as a higher level 
command. Go make me a sandwich, using butter, cheese and ham could be seen as 
calling the make me a sandwich function, with the input parameters (or 
arguments) being butter, cheese and ham, and the function returns a sandwich 
(for example). In C we might express this as follows:
+
+code c
+struct sandwich
+ 

[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-05-02 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=e259945c0ea20ecf8bbc8bf0b1dd90fab8396d68

commit e259945c0ea20ecf8bbc8bf0b1dd90fab8396d68
Author: Raster ras...@rasterman.com
Date:   Sat May 2 08:15:53 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 136 +++--
 1 file changed, 109 insertions(+), 27 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 8bdfd03..bc70b0c 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -3,35 +3,129 @@
 
  Preface 
 
-//This is not a theoretical C language specifications document. It is a 
practical primer for the vast majority of real life cases of C usage that are 
relevant to EFL. It covers application executables and shared library concepts 
and is written from a Linux/UNIX perspective where you would have your code 
running with an OS doing memory mappings and probably protection for you. It 
really is fundamentally not much different on Android, iOS, OSX or even 
Windows.//
+//This is not a theoretical C language specifications document. It is a 
practical primer for the vast majority of real life cases of C usage that are 
relevant to EFL on todays common architectures. It covers application 
executables and shared library concepts and is written from a Linux/UNIX 
perspective where you would have your code running with an OS doing memory 
mappings and probably protection for you. It really is fundamentally not much 
different on Android, iOS, OSX or even Windows.//
 
-//It won't cover esoteric details of strange architectures which may, in 
theory exist, but in real life are long dead, never existed, or are so rare 
that you won't need to know. It pretty much thinks of C as a high level 
assembly language that is portable across a range of modern architectures.//
+//It won't cover esoteric details of strange architectures. It pretty much 
covers C as a high level assembly language that is portable across a range of 
modern architectures.//
 
-//Keep this in mind when reading, and know that some facets of C have been 
adapted to take this view of things. It simply makes everything easier and more 
practical to learn, along with actually being relevant day-to-day in usage of 
C.//
+ Your first program 
+
+Let's start with the traditional Hello world C application. This is about as 
simple as it gets for an application that does something you can see.
+
+code c hello.c
+#include stdio.h
+
+int
+main(int argc, char **argv)
+{
+   printf(Hello world!\n);
+   return 0;
+}
+/code
+
+You would compile this on a command-line as follows:
+
+  cc hello.c -o hello
+
+Run the application with:
+
+  ./hello
+
+You should then see this output:
+
+  Hello world!
+
+So what has happened here? Let's first look at the code itself. The first line:
+
+code c
+#include stdio.h
+/code
+
+This tells the compiler to literally include the **stdio.h** file into your 
application. The compiler will find this file in the standard locations to look 
for include files and literally paste it there where the include line is. 
This file provides some standard I/O features, such as ''printf()''.
+
+The next thing is something every application will have - a ''main()'' 
function. This function must exist only once in the application because this is 
the function that is run //AS// the application. When this function exits, the 
application does.
+
+code c
+int
+main(int argc, char **argv)
+{
+}
+/code
+
+The ''main()'' function always returns an ''integer'' value, and is given 2 
parameters on start. Those are an integer ''argc'' and then an array of 
strings. In C an array is generally just a pointer to the first element. A 
String is generally a pointer to a series of bytes (chars) which ends in a byte 
value of 0 to indicate the end of the string. We'll come back to this later, 
but as we don't use these, just ignore this for now.
+
+The next thing that happens is for the code to call a function ''printf()'' 
with a string Hello world!\n. Why the \n at the end? This is an escape. A 
way of indicating a special character. In this case this is the //newline// 
character. Strings in C can contain some special characters like this, and \ 
is used to begin the escaped string.
+
+code c
+printf(Hello world!\n);
+/code
+
+Now finally we return from the main function with the value 0. The ''main()'' 
function of an application is special. It always returns an integer that 
indicates the success of the application. This is used by the shell executing 
the process to determine success. A return of ''0'' indicates the process ran 
successfully.
+
+code c
+return 0;
+/code
+
+You will notice a few things. First lines starting with ''#'' are commands, 
but don't have a '';''. This is normal because these lines are processed by the 
pre-processor. All code in C goes through the C 

[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-04-30 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=3170e7d2d9cd620533a4f411c191021c9c28a84e

commit 3170e7d2d9cd620533a4f411c191021c9c28a84e
Author: Raster ras...@rasterman.com
Date:   Thu Apr 30 01:40:46 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/efl/start.txt | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/pages/docs/efl/start.txt b/pages/docs/efl/start.txt
index 3e1c876..33ab758 100644
--- a/pages/docs/efl/start.txt
+++ b/pages/docs/efl/start.txt
@@ -39,9 +39,7 @@ Emotion, Ecore_Con, Ecore_IPC, Eio, Eldbus, Elocation, 
Ecore_Audio,
 Ecore_File and Efreet.
 
 We will make an assumption that you have a reasonable grasp of the C
-programming language here. Perhaps you might want to read
-[[http://www.cprogramming.com/tutorial/c-tutorial.html|this C introduction 
tutorial]]
-if you are new to C, or need a refresher.
+programming language here. Perhaps you might want to read the [[docs/c/start]] 
if you are new to C, or need a refresher.
 
 
 

-- 




[EGIT] [website/www-content] master 01/01: Wiki page start changed with summary [] by Raster

2015-04-30 Thread Raster
WWW-www.enlightenment.org pushed a commit to branch master.

http://git.enlightenment.org/website/www-content.git/commit/?id=9809d441a74ab40da351a2e065fb4d71bbe4cee8

commit 9809d441a74ab40da351a2e065fb4d71bbe4cee8
Author: Raster ras...@rasterman.com
Date:   Thu Apr 30 03:15:28 2015 -0700

Wiki page start changed with summary [] by Raster
---
 pages/docs/c/start.txt | 100 -
 1 file changed, 98 insertions(+), 2 deletions(-)

diff --git a/pages/docs/c/start.txt b/pages/docs/c/start.txt
index 0aaa79a..8bdfd03 100644
--- a/pages/docs/c/start.txt
+++ b/pages/docs/c/start.txt
@@ -1,9 +1,105 @@
 ~~Title: C Primer~~
 ~~CODE-c~~
 
-{{pageindex}}
+ Preface 
 
- Also See 
+//This is not a theoretical C language specifications document. It is a 
practical primer for the vast majority of real life cases of C usage that are 
relevant to EFL. It covers application executables and shared library concepts 
and is written from a Linux/UNIX perspective where you would have your code 
running with an OS doing memory mappings and probably protection for you. It 
really is fundamentally not much different on Android, iOS, OSX or even 
Windows.//
+
+//It won't cover esoteric details of strange architectures which may, in 
theory exist, but in real life are long dead, never existed, or are so rare 
that you won't need to know. It pretty much thinks of C as a high level 
assembly language that is portable across a range of modern architectures.//
+
+//Keep this in mind when reading, and know that some facets of C have been 
adapted to take this view of things. It simply makes everything easier and more 
practical to learn, along with actually being relevant day-to-day in usage of 
C.//
+
+ The machine 
+
+Reality is that you are dealing with a machine. It's real. It has its 
personality and ways of working thanks to the people who designed the CPU and 
its components. Most machines are fairly similar these days, of course with 
their variations on personality, size etc.
+
+All machines have at least a single processor to execute a series of 
instructions. If you write an application (a common case) this is the model you 
will see right in front of you. An applications begins by executing a list of 
instructions at the CPU level.
+
+The C compiler takes the C code files you write and converts them into 
machine code (which is really just a series of numbers that end up stored in 
memory, and these numbers have meanings like 0 is do nothing, 1 is add 
the next 2 numbers together and store the result. 2 is compare result with 
next number, store comparison in result, 3 is if result is 'equal to' then 
start executing instructions at the memory location in the next number etc.). 
Somewhere these numbers are [...]
+
+CPUs will do arithmetic, logic operations, change what it is they execute, and 
read from or write to memory to deal with data. In the end, everything to a CPU 
is effectively a number, and some operation you do to it.
+
+To computers, numbers are a string of bits. A bit can be on or off. Just 
like you may be used to numbers, with each digit having 10 values (0 through to 
9), A computer sees numbers more simply. It is 0, or it is 1. Just like you can 
have a bigger number by adding a digit (1 digit can encode 10 values, 2 digits 
can encode 100 values, 3 can encode 1000 values etc.), So too with the binary 
(0 or 1) numbering system computers use. Every binary digit you add doubles the 
number of values you [...]
+
+Numbers to a computer normally come in sizes that indicate how many bits they 
use. The sizes that really matter are bytes (8 bits), shorts (16 bits), 
integers (32 bits), long integers (32 or 64 bits), long long integers (64 
bits), floats (32 bits) doubles (64 bits) and pointers (32 or 64 bits).  The 
terms here are those similar to what C uses for clarity and ease of 
explanation. The sizes here are the **COMMON SIZES** found across real life 
architectures today. //(This does gloss over so [...]
+
+Bytes (chars) can encode numbers from 0 through to 255. Shorts can do 0 
through to 65535, integers can do 0 through to about 4 billion, long integers 
if 64 bit or long long integers can encode values up to about 18 qunitillion (a 
very big number). Pointers are also just integers. Either 32 or 64 bits. Floats 
and doubles can encode numbers with a decimal place. Like  3.14159. Thus both 
floats and doubles consist of a mantissa and exponent. The mantissa determines 
the digits of the numbe [...]
+
+When we want signed numbers, we center our ranges AROUND 0. So bytes (chars) 
can go from -128 to 127, shorts from -32768 to 32767, integers from around -2 
billion to 2 billion, and the long long integers and 64 bit versions of 
integers can go from about -9 quintillion to about 9 quinitillion. By default 
all of the types are signed (except pointers) UNLESS you put an unsigned in 
front of them. You can also place signed in front to