<commit_before># glib usage

## installation

```
sudo apt-get install libglib2.0-dev
```

## Components

- Memory chunks
- Doubly-linked lists
- Singly-linked lists
- Hash tables
- Strings (which can grow dynamically)
- String chunks (groups of strings)
- Arrays (which can grow in size as elements are added)
- Balanced binary trees
- N-ary trees
- Quarks (a two-way association of a string and a unique integer identifier)
- Keyed data lists (lists of data elements accessible by a string or integer id)
- Relations and tuples (tables of data which can be indexed on any number of fields)
- Caches

## Example


```C
#include <stdio.h>
#include <glib.h>
int main(int argc, char** argv) {
  GList* list = NULL;
  list = g_list_append(list, "Hello world!");
  printf("The first item is '%s'\n", (char *)g_list_first(list)->data);
  return 0;
}
```

compilation:

```
gcc test.c `pkg-config --cflags --libs glib-2.0` -o test
```

# reference
1. [GLib Reference Manual](https://developer.gnome.org/glib/stable/)
2. [The GLib/GTK+ Development Platform](https://people.gnome.org/~swilmet/glib-gtk-dev-platform.pdf)
3. [Application Programming Using the GNOME Libraries](http://devernay.free.fr/cours/IHM/GTK/gnome-libs-tutorial.pdf)
4. [The Official GNOME 2 Developer's Guide](https://www.dgsiegel.net/files/tog2dg.pdf)
5. [Glib-C: C as an alternative Object Oriented Environment](http://lore.ua.ac.be/Publications/pdf/Hendrickx2004.pdf)
6. [Object-Oriented Programming in C](https://www.cs.colorado.edu/~kena/classes/5448/f12/presentation-materials/gatchell.pdf)
7. [Manage C data using the GLib collections](https://www6.software.ibm.com/developerworks/education/l-glib/l-glib-pdf.pdf)
8. []()
<commit_msg>Update glib.md<commit_after># glib usage

## installation

```
sudo apt-get install libglib2.0-dev
```

## Components

- Memory chunks
- Doubly-linked lists
- Singly-linked lists
- Hash tables
- Strings (which can grow dynamically)
- String chunks (groups of strings)
- Arrays (which can grow in size as elements are added)
- Balanced binary trees
- N-ary trees
- Quarks (a two-way association of a string and a unique integer identifier)
- Keyed data lists (lists of data elements accessible by a string or integer id)
- Relations and tuples (tables of data which can be indexed on any number of fields)
- Caches

## Example


```C
#include <stdio.h>
#include <glib.h>
int main(int argc, char** argv) {
  GList* list = NULL;
  list = g_list_append(list, "Hello world!");
  printf("The first item is '%s'\n", (char *)g_list_first(list)->data);
  return 0;
}
```

compilation:

```
gcc test.c `pkg-config --cflags --libs glib-2.0` -o test
```

# reference
1. [GLib Reference Manual](https://developer.gnome.org/glib/stable/)
2. [The GLib/GTK+ Development Platform](https://people.gnome.org/~swilmet/glib-gtk-dev-platform.pdf)
3. [Application Programming Using the GNOME Libraries](http://devernay.free.fr/cours/IHM/GTK/gnome-libs-tutorial.pdf)
4. [The Official GNOME 2 Developer's Guide](https://www.dgsiegel.net/files/tog2dg.pdf)
5. [Glib-C: C as an alternative Object Oriented Environment](http://lore.ua.ac.be/Publications/pdf/Hendrickx2004.pdf)
6. [Object-Oriented Programming in C](https://www.cs.colorado.edu/~kena/classes/5448/f12/presentation-materials/gatchell.pdf)
7. [Manage C data using the GLib collections](https://www6.software.ibm.com/developerworks/education/l-glib/l-glib-pdf.pdf)
8. [Compiling GLib Applications](https://developer.gnome.org/glib/stable/glib-compiling.html)

{'fraction_non_alphanumeric': 0.14154989991421218, 'fraction_numerical': 0.01486988847583643, 'mean_word_length': 4.252252252252252, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 11, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4203399', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1183, 'n_words': 338}