{"id":15646531,"url":"https://github.com/cirocosta/observer-c","last_synced_at":"2025-04-30T12:23:23.136Z","repository":{"id":73883874,"uuid":"20601361","full_name":"cirocosta/observer-c","owner":"cirocosta","description":"A pure C implementation of the Observer Pattern","archived":false,"fork":false,"pushed_at":"2019-01-04T18:54:28.000Z","size":168,"stargazers_count":58,"open_issues_count":4,"forks_count":18,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-25T07:45:17.498Z","etag":null,"topics":["c"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cirocosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2014-06-07T19:47:45.000Z","updated_at":"2025-01-25T05:42:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"300e00dc-b0eb-4705-9065-b5e793872c8b","html_url":"https://github.com/cirocosta/observer-c","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/cirocosta%2Fobserver-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fobserver-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fobserver-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fobserver-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirocosta","download_url":"https://codeload.github.com/cirocosta/observer-c/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242650897,"owners_count":20163610,"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"],"created_at":"2024-10-03T12:13:12.300Z","updated_at":"2025-03-09T05:30:43.966Z","avatar_url":"https://github.com/cirocosta.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# observer-c\n\n\u003e A pure C implementation of the Observer Pattern\n\n## Using\n\n\n1.\tCreate something to be observed and other thing to be observing the first one;\n\n2.\tThe observable (subject) includes `observer.h` and `subject.h`. The observer only includes `'observer.h`.\n\n3.\tThe subject needs to implement at least the subject's interface and two methods: `registerObserver` and `unregisterObserver`.\n\n4. The observers then implement the observer interface and the `notify` method, which is called when an event it is watching is triggered.\n\n\nCheck out the example for a better explanation on this.\n\n## The Example\n\nIn our example we have some animals, each of them defining a method that will be triggered when a cat meow.\n\nAs the animals act in a different manner, they'll, then, behave differently :neckbeard:\n\nIn technical terms, we have the **CAT** as the **Subject** (that object that the others wants to listen to) and the other **ANIMALS** as **Observers** (they implement a particular method to be triggered when the subject fires it).\n\n\n## Building and Testing\n\n\n### LICENSE\n\nThe MIT License (MIT)\n\nCopyright (c) \u003c2014\u003e \u003cCiro S. Costa\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fobserver-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirocosta%2Fobserver-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fobserver-c/lists"}