{"id":27261349,"url":"https://github.com/datkt/c-pointer-example","last_synced_at":"2026-04-30T09:36:49.114Z","repository":{"id":143746828,"uuid":"155604636","full_name":"datkt/c-pointer-example","owner":"datkt","description":"A simple example demonstrating the use of C pointers in Kotlin/Native","archived":false,"fork":false,"pushed_at":"2018-10-31T20:51:31.000Z","size":3,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T05:37:38.435Z","etag":null,"topics":["c","example","konanc","kotlin","native","pointer"],"latest_commit_sha":null,"homepage":null,"language":"Makefile","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/datkt.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,"zenodo":null}},"created_at":"2018-10-31T18:21:46.000Z","updated_at":"2024-11-03T16:03:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"d45aae12-4e50-4e76-8d1e-fb6dbcddccf5","html_url":"https://github.com/datkt/c-pointer-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/datkt/c-pointer-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datkt%2Fc-pointer-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datkt%2Fc-pointer-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datkt%2Fc-pointer-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datkt%2Fc-pointer-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datkt","download_url":"https://codeload.github.com/datkt/c-pointer-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datkt%2Fc-pointer-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","example","konanc","kotlin","native","pointer"],"created_at":"2025-04-11T05:29:41.645Z","updated_at":"2026-04-30T09:36:49.109Z","avatar_url":"https://github.com/datkt.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"c-pointer-example\n=================\n\nA simple example demonstrating the use of C pointers in Kotlin/Native.\n\n## Background\n\nThe files needed to build this example can be built by running the\n`make` (or `make build`) command. This will build the `pointer.klib` and\n`main.kexe` files by using the `cinterop` command on `pointer.def` to generate\nthe Kotlin source, compiled binary, and the resulting `klib` file from\n`pointer.h`. The `konanc` command then compiles the `main.kt` file that\nlinks `pointer.klib` to a Kotlin executable `main.kexe`. The program is\nthen executable by invoking `./main.kexe`. This should print the\nfollowing output.\n\n```\n(int) 1234\n(string) hello\n```\n\n## Building\n\nTo build the entire program, run `make build` which results in a\n`main.kexe` program executable. The `Makefile` targets for various files\nare documented below.\n\n### `make build`\n\nBuilds everything.\n\n### `make pointer.klib`\n\nBuilds the Kotlin library `pointer.klib` that can be linked in the\n`konanc` command.\n\n### `make main.kexe`\n\nBuilds the Kotlin program executable `main.kexe`. Depends on\n`main pointer.klib`.\n\n## See Also\n\n* https://github.com/JetBrains/kotlin-native\n* https://kotlinlang.org/docs/reference/native-overview.html\n* https://rosettacode.org/wiki/Pointers_and_references#Kotlin\n* https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/index.html\n* https://kotlinlang.org/api/latest/jvm/stdlib/kotlinx.cinterop/mem-scoped.html\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatkt%2Fc-pointer-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatkt%2Fc-pointer-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatkt%2Fc-pointer-example/lists"}