diff options
-rw-r--r-- | dev/c/datatypes.html | 44 | ||||
-rw-r--r-- | dev/c/debugging.html | 32 | ||||
-rw-r--r-- | dev/c/elements.html | 19 | ||||
-rw-r--r-- | dev/c/index.html | 44 | ||||
-rw-r--r-- | dev/c/lib.html | 167 | ||||
-rw-r--r-- | dev/index.html | 324 |
6 files changed, 419 insertions, 211 deletions
diff --git a/dev/c/datatypes.html b/dev/c/datatypes.html index a149c24..35b6ca4 100644 --- a/dev/c/datatypes.html +++ b/dev/c/datatypes.html @@ -9,6 +9,22 @@ <h1>Datatypes</h1> + <h2 id="types">Types</h2> + + <dl> + <dt>char</dt> + <dd>Integer, one byte.</dd> + <dt>int</dt> + <dd>Integer.</dd> + <dt>float</dt> + <dd>Single precision floating point.</dd> + <dt>double</dt> + <dd>Double precision floating point.</dd> + <dt>void</dt> + <dd>Absence of type.</dd> + </dl> + + <h2 id="datatypes">Data types</h2> <h2 id="int">Integer</h2> @@ -128,13 +144,35 @@ <h2 id="tq">Type qualifiers</h2> <h2 id="st">Storage class</h2> - <a href="../index.html">Development Index</a> + <h2 id="format">Format Type Specifiers</h2> - <p> - This is part of the c9-doc Manual. + <dl> + <dt>%c</dt> + <dd>Character</dd> + <dt>%s</dt> + <dd>String of characters</dd> + <dt>%d</dt> + <dd>Decimal integer</dd> + <dt>%f</dt> + <dd>Decimal floating point</dd> + <dt>%llu</dt> + <dd>unsigned long long</dd> + <dt>%o</dt> + <dd>Signed octal</dd> + <dt>%u</dt> + <dd>Unsigned decimal integer</dd> + <dt>%x</dt> + <dd>Unsigned hexadecimal integer</dd> + <dt>%p</dt> + <dd>Pointer address</dd> + </dl> + + <a href="../index.html">Development Index</a> + <p>This is part of the c9 Manual. Copyright (C) 2018 c9 team. See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a> for copying conditions.</p> + </body> </html> diff --git a/dev/c/debugging.html b/dev/c/debugging.html index d1f425b..4e5931f 100644 --- a/dev/c/debugging.html +++ b/dev/c/debugging.html @@ -15,10 +15,42 @@ (gdb)set args -parameter1 -parameter2 </pre> + <p>To start gdb in TUI mode press;</p> + + <dl> + <dt>Ctrl-x A</dt> + <dd>Enter or leave TUI.</dd> + <dt>Ctrl-x 0</dt> + <dd>TUI with only one window.</dd> + <dt>Ctrl-x 2</dt> + <dd>TUI with more than two windows.</dd> + <dt>Ctrl-x o</dt> + <dd>Change active window.</dd> + <dt>Ctrl-x s</dt> + <dd>TUI single key mode.</dd> + <dt>Ctrl-L s</dt> + <dd>Refresh screen.</dd> + <dt>Up</dt> + <dd>Scroll</dd> + <dt>Down</dt> + <dd>Scroll</dd> + <dt>Left</dt> + <dd>Scroll</dd> + <dt>Right</dt> + <dd>Scroll</dd> + </dl> + + <pre> + (gdb) info win + (gdb) fs next + (gdb) fs SRC + </pre> + <pre> b - backtrace info locals + display print x catch syscall open diff --git a/dev/c/elements.html b/dev/c/elements.html index d6950d2..c5eb87e 100644 --- a/dev/c/elements.html +++ b/dev/c/elements.html @@ -2,27 +2,12 @@ <html dir="ltr" lang="en"> <head> <meta charset='utf-8'> - <title>Types & Elements</title> + <title>Elements</title> </head> <body> <a href="../index.html">Development Index</a> - <h1>Types & Elements</h1> - - <h2 id="types">Types</h2> - - <dl> - <dt>char</dt> - <dd>Integer, one byte.</dd> - <dt>int</dt> - <dd>Integer.</dd> - <dt>float</dt> - <dd>Single precision floating point.</dd> - <dt>double</dt> - <dd>Double precision floating point.</dd> - <dt>void</dt> - <dd>Absence of type.</dd> - </dl> + <h1>Elements</h1> <h2 id="ident">Identifiers</h2> diff --git a/dev/c/index.html b/dev/c/index.html index 3e8651f..aeff035 100644 --- a/dev/c/index.html +++ b/dev/c/index.html @@ -135,39 +135,7 @@ (gdb) s </pre> - <p>Execute next line;</p> - - <pre> - (gdb) n - </pre> - - <p>To start gdb in TUI mode press;</p> - - <dl> - <dt>Ctrl-x A</dt> - <dd>Enter or leave TUI.</dd> - <dt>Ctrl-x 1</dt> - <dd>TUI with only one window.</dd> - <dt>Ctrl-x 2</dt> - <dd>TUI with more than two windows.</dd> - <dt>Ctrl-x o</dt> - <dd>Change active window.</dd> - <dt>Ctrl-x s</dt> - <dd>TUI single key mode.</dd> - <dt>Ctrl-L s</dt> - <dd>Refresh screen.</dd> - <dt>Up</dt> - <dd>Scroll</dd> - <dt>Down</dt> - <dd>Scroll</dd> - <dt>Left</dt> - <dd>Scroll</dd> - <dt>Right</dt> - <dd>Scroll</dd> - </dl> - - <p>Run again and step in hello function, to print - variable "name" value and type;</p> + <p>Print variable "name" value;</p> <pre> (gdb) print name @@ -175,7 +143,7 @@ (gdb) </pre> - <p>Print variable name type;</p> + <p>Print variable "name" type;</p> <pre> (gdb) ptype name @@ -183,8 +151,12 @@ (gdb) </pre> - <p>Variable is a <a href="elements.html#const">string constant</a>, - continue reading <a href="elements.html">Elements</a>.</p> + <p>Variable is a <a href="elements.html#const">string constant</a>. + Execute next line to end;</p> + + <pre> + (gdb) n + </pre> <a href="../index.html">Development Index</a> <p> diff --git a/dev/c/lib.html b/dev/c/lib.html new file mode 100644 index 0000000..d1c9c28 --- /dev/null +++ b/dev/c/lib.html @@ -0,0 +1,167 @@ +<!DOCTYPE html> +<html dir="ltr" lang="en"> + <head> + <meta charset='utf-8'> + <title>Libraries</title> + </head> + <body> + <a href="../index.html">Development Index</a> + + + <h1>Libraries</h1> + + <h2>Basic</h2> + + <dl> + <dt>include <unistd.h></dt> + <dd>fork, pipe and I/O primitives (read, write, close, etc.) + + primitve types like uid_t, pid_t etc</dd> + + <dt>#include <stdlib.h></dt> + <dd>Standard lib, contains primitves for number conversion + and memory allocation</dd> + <dt>#include <stdio.h></dt> + <dd>Basic i/o lib: printf etc</dd> + + <dt>#include <string.h></dt> + <dd>String manipulations</dd> + + <dt>#include <time.h></dt> + <dd>Time related functions</dd> + + <dt>#include <signal.h></dt> + <dd>Signal handling</dd> + + <dt>#include <stdbool.h></dt> + <dd>Boolean type</dd> + + <dt>#include <math.h></dt> + <dd>Math functions</dd> + </dl> + + <h2>Advanced</h2> + <dl> + <dt>#include <sys/socket.h></dt> + <dd> socket connections</dd> + <dt>#include <sys/types.h></dt> + <dd> primitive types like uid_t, pid_t etc</dd> + + <dt>#include <netinet/in.h></dt> + <dd> internet address family</dd> + + <dt>#include <arpa/inet.h></dt> + <dd> definitions for internet operations</dd> + + <dt>#include <pthread.h></dt> + <dd> threads</dd> + + <dt>#include <stdatomic.h></dt> + <dd> mutual exclusion locks</dd> + + </dl> + + <h2>Stdio</h2> + + <h3>File Modes</h3> + + <pre> + mode Description + "r" Opens a file for reading. The file must exist. + "w" Creates an empty file for writing. If a file with the same name already exists, its content is erased and the file is considered as a new empty file. + "a" Appends to a file. Writing operations, append data at the end of the file. The file is created if it does not exist. + "r" Opens a file to update both reading and writing. The file must exist. + "w" Creates an empty file for both reading and writing. + "a" Opens a file for reading and appending. + </pre> + + <pre> + // ERROR: result == NULL (also when EOF is reached) + char *fgets(char *str, int strlen, FILE *stream); + + // ERROR: result == NULL + FILE *fopen(const char *filename, const char *mode); + + // result == EOF when finished reading the stream + // SUCCESS: number of matched items on success + int fscanf(FILE *stream, const char *format, ...); + + // ERROR: result == EOF + // SUCCESS: result == 0 + int fclose(FILE *stream); + + // ERROR: result == -1 + // SUCCESS: number of bytes written + ssize_t write(int fildes, const void *buf, size_t nbyte); + + // ERROR: result == -1 + // EOF when finished reading + // SUCCESS: number of bytes read + ssize_t read(int fildes, void *buf, size_t nbyte); + + // SUCCESS: result > 0 + // ERROR: result == EOF + int fputs(const char *restrict s, FILE *restrict stream); + </pre> + + <h2>Strings</h2> + + <pre> + // SUCCESS: pointer to destination string + char *strcpy(char *dest, const char *src); + + // result == 0 -> strings are equal + // result < 0 -> str1 less than str2 + // result > 0 -> str2 less than str1 + int strcmp(const char *str1, const char *str2);; + + + // result == NULL -> no tokens left to retrieve + // else: pointer to last token found + char *strtok(char *str, const char *delim); + + // NULL if no match + // else: pointer to first occurence in string + char *strstr(const char *string, const char *substring); + + // ERROR: result == 0 + int atoi(const char *str); + </pre> + + <h2>Networking</h2> + + <pre> + // ERROR: result == -1 + // example: sock = socket(AF_INET, SOCK_STREAM, 0); + int socket(int domain, int type, int protocol); + + // sockaddr_in struct (man ip 4) + struct sockaddr_in server; + server.sin_family = PF_INET; + server.sin_addr.s_addr = INADDR_ANY; + server.sin_port = htons(8080); + + // ERROR: result < 0 + // SUCCESS: result == 0 + // example: bind(sock, (struct sockaddr *) &server, sizeof(server)) + int bind(int sockfd, const struct sockaddr *my_addr, socklen_t addrlen); + + // ERROR: result < 0 + // SUCCESS: filedeskriptor for accepted socket + // example: fd = accept(sock, (struct sockaddr *) &client, &client_len); + int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); + + // SUCCESS: result == 0 + // ERROR: result == -1 + int listen(int socket, int backlog); + </pre> + + <a href="../index.html">Development Index</a> + + <p> + This is part of the c9-doc Manual. + Copyright (C) 2018 + c9 team. + See the file <a href="../../fdl-1.3-standalone.html">Gnu Free Documentation License</a> + for copying conditions.</p> + </body> +</html> diff --git a/dev/index.html b/dev/index.html index afd147e..ab00a3e 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,164 +1,178 @@ <!DOCTYPE html> <html dir="ltr" lang="en"> <head> - <meta charset='utf-8'> - <title>Development</title> + <meta charset='utf-8'> + <title>Development</title> </head> <body> - <a href="../index.html">Documentation Index</a> - <h1>Development</h1> - - <p>Tools for development and debugging</p> - - <h2>Git</h2> - - <p>Git is a distributed version control system, this document is meant to be distributed using git.</p> - - <ul> - <li><a href="git/index.html#teamwork">1. Team workflow</a> - <ul> - <li><a href="git/index.html#feature">1.1. Feature</a></li> - <li><a href="git/index.html#release">1.2. Release</a></li> - <li><a href="git/index.html#tags">1.3. Tags</a></li> - <li><a href="git/index.html#hotfix">1.4. Hotfix</a></li> - </ul> - </li> - <li><a href="git/index.html#local">2. Local Workflow</a> - <ul> - <li><a href="git/index.html#working">2.1. Working area</a></li> - <li><a href="git/index.html#logdiff">2.2. Logs and commits</a></li> - <li><a href="git/index.html#remote">2.3. Working with remotes</a></li> - </ul> - </li> - </ul> - - <h2 id="c">C & GDB</h2> - - <p>C is functional compiled language created by Dennis Ritchie. BSD, Linux and Minix kernels use this language - as primary language.</p> - - <ul> - <li><a href="c/index.html">Hello World</a> - <ul> - <li><a href="c/index.html#sources">Multiple sources</a></li> - <li><a href="c/index.html#makefile">Makefile</a></li> - <li><a href="c/index.html#debug">Debug</a></li> - </ul> - </li> - <li><a href="c/elements.html">Types & Elements</a> - <ul> - <li><a href="c/elements.html#types">Types</a></li> - <li><a href="c/elements.html#ident">Identifiers</a></li> - <li><a href="c/elements.html#keywords">Keywords</a></li> - <li><a href="c/elements.html#const">Constants</a></li> - <li><a href="c/elements.html#op">Operators</a></li> - <li><a href="c/elements.html#sep">Separators</a></li> - <li><a href="c/elements.html#white">White space</a></li> - </ul> - </li> - <li><a href="c/datatypes.html">Datatypes</a> - <ul> - <li><a href="c/datatypes.html#int">Integer</a></li> - <li><a href="c/datatypes.html#double">Real number</a></li> - <li><a href="c/datatypes.html#complex">Complex number</a></li> - <li><a href="c/datatypes.html#enum">Enumeration</a></li> - <li><a href="c/datatypes.html#union">Unions</a></li> - <li><a href="c/datatypes.html#struct">Structures</a></li> - <li><a href="c/datatypes.html#array">Arrays</a></li> - <li><a href="c/datatypes.html#pointer">Pointers</a></li> - <li><a href="c/datatypes.html#it">Incomplete types</a></li> - <li><a href="c/datatypes.html#tq">Type qualifiers</a></li> - <li><a href="c/datatypes.html#st">Storage class</a></li> - </ul> - </li> - - <li><a href="">Operators & Expressions</a></li> - <li><a href="">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="">Input & Output</a></li> - <li><a href="c/debugging.html">Debugging</a></li> - <li><a href="c/system.html">System Development</a></li> - </ul> - - <ul> - <li><a href="http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html">Autotools</a></li> - </ul> - - <h2>Shell Script</h2> - - <p>Script files that start with "#!/bin/sh" use dash (in crux), - /bin/sh is a link to dash, while files that start with "#!/bin/bash" - use bash;</p> - - <ul> - <li><a href="shell/dash.html">Dash - Scripting</a> - <ul> - <li><a href="shell/dash.html#hello">Hello World</a></li> - <li><a href="shell/dash.html#var">Types & Variables</a></li> - <li><a href="">Operators & Expressions</a></li> - <li><a href="shell/dash.html#if">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="shell/dash.html#io">Input & Output</a></li> - </ul> - </li> - </ul> - - <h2>Python</h2> - <ul> - <li><a href="python/index.html">Hello World</a></li> - <li><a href="">Types & Variables</a></li> - <li><a href="">Operators & Expressions</a></li> - <li><a href="">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="">Input & Output</a></li> - </ul> - - <h2>Perl</h2> - <ul> - <li><a href="perl/index.html">Hello World</a></li> - <li><a href="">Types & Variables</a></li> - <li><a href="">Operators & Expressions</a></li> - <li><a href="">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="">Input & Output</a></li> - </ul> - - - <h2>JavaScript</h2> - <ul> - <li><a href="js/index.html">Hello World</a></li> - <li><a href="">Types & Variables</a></li> - <li><a href="">Operators & Expressions</a></li> - <li><a href="">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="">Input & Output</a></li> - </ul> - - <h2>PHP</h2> - <ul> - <li><a href="php/index.html">Hello World</a></li> - <li><a href="">Types & Variables</a></li> - <li><a href="">Operators & Expressions</a></li> - <li><a href="">Control Flow</a></li> - <li><a href="">Functions</a></li> - <li><a href="">Input & Output</a></li> - </ul> - - <ul> - <li><a href="php/laravel.html">Laravel Framework</a></li> - <li>PHP Unit</li> - </ul> - - <a href="../index.html">Documentation Index</a> - <p> - This is part of the c9-doc Manual. - Copyright (C) 2017 - c9 team. - See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> - for copying conditions.</p> - - + <a href="../index.html">Documentation Index</a> + <h1>Development</h1> + + <p>Tools for development and debugging</p> + + <h2>Git</h2> + + <p>Git is a distributed version control system, this document is meant to be distributed using git.</p> + + <ul> + <li><a href="git/index.html#teamwork">1. Team workflow</a> + <ul> + <li><a href="git/index.html#feature">1.1. Feature</a></li> + <li><a href="git/index.html#release">1.2. Release</a></li> + <li><a href="git/index.html#tags">1.3. Tags</a></li> + <li><a href="git/index.html#hotfix">1.4. Hotfix</a></li> + </ul> + </li> + <li><a href="git/index.html#local">2. Local Workflow</a> + <ul> + <li><a href="git/index.html#working">2.1. Working area</a></li> + <li><a href="git/index.html#logdiff">2.2. Logs and commits</a></li> + <li><a href="git/index.html#remote">2.3. Working with remotes</a></li> + </ul> + </li> + </ul> + + <h2 id="c">C & GDB</h2> + + <p>C is functional compiled language created by Dennis Ritchie. BSD, Linux and Minix kernels use this language + as primary language.</p> + + <ul> + <li><a href="c/index.html">Hello World</a> + <ul> + <li><a href="c/index.html#sources">Multiple sources</a></li> + <li><a href="c/index.html#makefile">Makefile</a></li> + <li><a href="c/index.html#debug">Debug</a></li> + </ul> + </li> + <li><a href="c/elements.html">Elements</a> + <ul> + <li><a href="c/elements.html#ident">Identifiers</a></li> + <li><a href="c/elements.html#keywords">Keywords</a></li> + <li><a href="c/elements.html#const">Constants</a></li> + <li><a href="c/elements.html#op">Operators</a></li> + <li><a href="c/elements.html#sep">Separators</a></li> + <li><a href="c/elements.html#white">White space</a></li> + </ul> + </li> + <li><a href="c/datatypes.html">Datatypes</a> + <ul> + <li><a href="c/datatypes.html#types">Types</a></li> + <li><a href="c/datatypes.html#int">Integer</a></li> + <li><a href="c/datatypes.html#double">Real number</a></li> + <li><a href="c/datatypes.html#complex">Complex number</a></li> + <li><a href="c/datatypes.html#enum">Enumeration</a></li> + <li><a href="c/datatypes.html#union">Unions</a></li> + <li><a href="c/datatypes.html#struct">Structures</a></li> + <li><a href="c/datatypes.html#array">Arrays</a></li> + <li><a href="c/datatypes.html#pointer">Pointers</a></li> + <li><a href="c/datatypes.html#it">Incomplete types</a></li> + <li><a href="c/datatypes.html#tq">Type qualifiers</a></li> + <li><a href="c/datatypes.html#st">Storage class</a></li> + <li><a href="c/datatypes.html#format">Format type specifiers</a></li> + </ul> + </li> + + <li><a href="">Operators & Expressions</a></li> + <li><a href="">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="">Input & Output</a></li> + <li><a href="c/lib.html">Libraries</a> + <ul> + <li><a href="c/lib.html#random-numbers">Random Numbers</a></li> + <li><a href="c/lib.html#signals">Signals</a></li> + <li><a href="c/lib.html#sorting">Sorting</a></li> + <li><a href="c/lib.html#strings">Strings</a></li> + <li><a href="c/lib.html#inter-process-communication">Inter Process Communication</a></li> + <li><a href="c/lib.html#file-io">File IO</a></li> + <li><a href="c/lib.html#shared-memory">Shared Memory</a></li> + <li><a href="c/lib.html#networking">Networking</a></li> + <li><a href="c/lib.html#threads">Threads</a></li> + </ul> + + + </li> + <li><a href="c/debugging.html">Debugging</a></li> + <li><a href="c/system.html">System Development</a></li> + </ul> + + <ul> + <li><a href="http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html">Autotools</a></li> + </ul> + + <h2>Shell Script</h2> + + <p>Script files that start with "#!/bin/sh" use dash (in crux), + /bin/sh is a link to dash, while files that start with "#!/bin/bash" + use bash;</p> + + <ul> + <li><a href="shell/dash.html">Dash - Scripting</a> + <ul> + <li><a href="shell/dash.html#hello">Hello World</a></li> + <li><a href="shell/dash.html#var">Types & Variables</a></li> + <li><a href="">Operators & Expressions</a></li> + <li><a href="shell/dash.html#if">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="shell/dash.html#io">Input & Output</a></li> + </ul> + </li> + </ul> + + <h2>Python</h2> + <ul> + <li><a href="python/index.html">Hello World</a></li> + <li><a href="">Types & Variables</a></li> + <li><a href="">Operators & Expressions</a></li> + <li><a href="">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="">Input & Output</a></li> + </ul> + + <h2>Perl</h2> + <ul> + <li><a href="perl/index.html">Hello World</a></li> + <li><a href="">Types & Variables</a></li> + <li><a href="">Operators & Expressions</a></li> + <li><a href="">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="">Input & Output</a></li> + </ul> + + + <h2>JavaScript</h2> + <ul> + <li><a href="js/index.html">Hello World</a></li> + <li><a href="">Types & Variables</a></li> + <li><a href="">Operators & Expressions</a></li> + <li><a href="">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="">Input & Output</a></li> + </ul> + + <h2>PHP</h2> + <ul> + <li><a href="php/index.html">Hello World</a></li> + <li><a href="">Types & Variables</a></li> + <li><a href="">Operators & Expressions</a></li> + <li><a href="">Control Flow</a></li> + <li><a href="">Functions</a></li> + <li><a href="">Input & Output</a></li> + </ul> + + <ul> + <li><a href="php/laravel.html">Laravel Framework</a></li> + <li>PHP Unit</li> + </ul> + + <a href="../index.html">Documentation Index</a> + <p> + This is part of the c9-doc Manual. + Copyright (C) 2017 + c9 team. + See the file <a href="../fdl-1.3-standalone.html">Gnu Free Documentation License</a> + for copying conditions.</p> </body> </html> |