• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

tylerneylon/APIsWithLua: Sample Lua and C code to help you learn how to write Lu ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

tylerneylon/APIsWithLua

开源软件地址(OpenSource Url):

https://github.com/tylerneylon/APIsWithLua

开源编程语言(OpenSource Language):

C 86.5%

开源软件介绍(OpenSource Introduction):

Creating Solid APIs with Lua

Lua and C code examples that illustrate C/Lua integration.

These code samples were written as companions to the O'Reilly book Creating Solid APIs with Lua. The samples are built up chapter-by-chapter, and focus on a particular game called EatyGuy, which looks like this:

This game is text-based in order to enable simple graphics that work across platforms yet don't require any libraries. The code has runs on macOS, Ubuntu, and Windows.

Run make from the root repo directory to build all the examples. The built products are created in each chapter's directory (ch1, ch2, and so on). The game examples can be run by, for example, in ch6, typing the command ./eatyguy10 (each chapter has its own version of the game). Use the arrow keys to move your character around, and press q to quit.

Many more details are provided in the book! :)

Table of Contents

This section outlines the flow of content across the chapters of the book and corresponding subdirectories of this repo. Many of these topics center on learning Lua's C API.

  • Chapter 1 Running a Lua Script from C

    This chapter covers acquiring Lua's source as well as running Lua scripts from C.

  • Chapter 2 Calling C from Lua

    Writing C functions that Lua can call.

  • Chapter 3 Using Lua Values in C

    Manipulating Lua primitives and tables from C.

  • Chapter 4 Making Your API Classy

    A review of Lua classes, and how C works with Lua's userdata type to make safe, class-like objects in Lua.

  • Chapter 5 Detecting Errors

    Working with Lua errors (similar to exceptions) from C; making it easier to notice certain common mistakes.

  • Chapter 6 Sandboxing User Scripts

    Limiting the API and resource access of user scripts, including fine-grained constraints on CPU and memory consumption.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
davidm/lua-digest-crc32lua: CRC-32 checksum implemented in pure Lua发布时间:2022-08-17
下一篇:
ibhagwan/nvim-lua发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap