{"id":16410220,"url":"https://github.com/perkss/c-programming-examples","last_synced_at":"2026-05-18T19:11:51.230Z","repository":{"id":107100963,"uuid":"118111937","full_name":"perkss/c-programming-examples","owner":"perkss","description":"Some C Programming Examples from the Tutorials on my blog","archived":false,"fork":false,"pushed_at":"2020-11-29T19:40:57.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-06T00:42:05.590Z","etag":null,"topics":["c","cmake","curl","makefile","pointers","programming-pearls"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perkss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-19T10:30:52.000Z","updated_at":"2020-11-29T19:41:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"2f7d28e8-3023-4d58-9b5e-55815f6372cd","html_url":"https://github.com/perkss/c-programming-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perkss%2Fc-programming-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perkss%2Fc-programming-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perkss%2Fc-programming-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perkss%2Fc-programming-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perkss","download_url":"https://codeload.github.com/perkss/c-programming-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240405387,"owners_count":19796182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cmake","curl","makefile","pointers","programming-pearls"],"created_at":"2024-10-11T06:23:32.750Z","updated_at":"2025-09-19T20:05:37.968Z","avatar_url":"https://github.com/perkss.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"#To Compile\n\n# Glib Examples\n\nTo run the GLIB examples you require the Library glib-2.0. \n\nOne of the pain points of C is linking libraries and using them, so how do we \nget glib into our project the simple recommended way is to use `pkg-config` like so\n\n```shell script\ngcc `pkg-config --cflags --libs glib-2.0` -o ex-compile ex-compile.c\n```\n\nTo fully understand getting the library we can link it using the common `-l` approach.\n\nWe can can use `pkg-config` to find the locations and the dependent libraries required to get the library imported.\n\n`pkg-config` will commonly be installed, but on a mac if not use \n\n```shell script\nbrew install pkg-config\n```\n\nThen you can search for the required library paths and header paths to compile your example with the \nrequired `glib-2.0` library. This does the equivalent of the command above specifying the `--cflags --libs` \npart.\n\n```shell script\n$ pkg-config --cflags glib-2.0\n-I/usr/local/Cellar/glib/2.56.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.56.0/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.44/include\n$ pkg-config --libs glib-2.0\n-L/usr/local/Cellar/glib/2.56.0/lib -L/usr/local/opt/gettext/lib -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation\n```\n\nThen the results of these two commands can be used as so\n```shell script\ngcc ex-compile.c -o compile -lglib-2.0 -lintl -I/usr/local/Cellar/glib/2.56.0/include/glib-2.0 -I/usr/local/Cellar/glib/2.56.0/lib/glib-2.0/include\n```\n\n\n# Libcurl Example Against ElasticSearch\nA nice example of very basic interaction with ElasticSearch via Rest and libCurl with C.\n\n# Programming Pearls Examples\nYou will find code examples and solutions for programming pearls in the relevant directories. \n\nTo run:\n```shell script\ngcc \u003cfilename\u003e -o \u003cwanted-name\u003e\n```\n\n# Weak References\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperkss%2Fc-programming-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperkss%2Fc-programming-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperkss%2Fc-programming-examples/lists"}