{"id":13629205,"url":"https://github.com/compuphase/pawn","last_synced_at":"2025-04-17T04:33:21.972Z","repository":{"id":45970641,"uuid":"43642131","full_name":"compuphase/pawn","owner":"compuphase","description":"Pawn is a quick and small scripting language that requires few resources.","archived":false,"fork":false,"pushed_at":"2024-09-14T12:52:29.000Z","size":25579,"stargazers_count":498,"open_issues_count":28,"forks_count":80,"subscribers_count":32,"default_branch":"main","last_synced_at":"2024-11-08T19:43:28.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.compuphase.com/pawn/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/compuphase.png","metadata":{"files":{"readme":"readme.md","changelog":"history.txt","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":"2015-10-04T16:01:21.000Z","updated_at":"2024-11-05T10:37:51.000Z","dependencies_parsed_at":"2022-09-14T17:11:11.677Z","dependency_job_id":"25cf83ad-99fa-42fc-bd54-cfb6496a0220","html_url":"https://github.com/compuphase/pawn","commit_stats":{"total_commits":98,"total_committers":13,"mean_commits":7.538461538461538,"dds":0.6326530612244898,"last_synced_commit":"f4c3a2ed24f707f1bcb7280c86a0bd098b2caf25"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compuphase%2Fpawn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compuphase%2Fpawn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compuphase%2Fpawn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/compuphase%2Fpawn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/compuphase","download_url":"https://codeload.github.com/compuphase/pawn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249316061,"owners_count":21249886,"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":[],"created_at":"2024-08-01T22:01:04.505Z","updated_at":"2025-04-17T04:33:18.431Z","avatar_url":"https://github.com/compuphase.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# The Pawn embedded scripting language\n\nPawn is a simple, typeless, 32-bit extension language with a C-like syntax.\nThe Pawn compiler outputs P-code (or bytecode) that subsequently runs on an\nabstract machine. Execution speed, stability, simplicity and a small footprint\nwere essential design criterions for both the language and the abstract\nmachine.\n\nThrough the evolution of the Pawn toolkit, this README had steadily been\ngrowing, as more and more components were added and the project was ported\nto diverse environments. Detailed instructions how to port, build and/or\nembed Pawn can be found in a separate document entitled \"The Pawn booklet:\nImplementer's Guide\". To get the Pawn toolkit working on your system, please\n(also) consult that document. To learn about the Pawn language, read the\ndocument \"The Pawn booklet: The Language\". If you grabbed the \"zip\" or \"tgz\" \nfile from the [Releases](https://github.com/compuphase/pawn/releases), you\nhave these documents already. Otherwise, you can obtain both these documents\nfrom the \"doc\" folder in the code archive, or on the web page devoted to Pawn:\nhttps://www.compuphase.com/pawn/\n\n## Acknowledgements\nSee the \"NOTICES\" file for acknowledgments for parts of Pawn not written by\nCompuPhase.\n\n\n# Getting started\nThe first question is: what do you need? If you are using Microsoft Windows,\ndownload the Pawn toolkit as a self-extracting setup file (see https://www.compuphase.com/pawn/); \nthis gives everything that you need to get started:\n*  binaries for Win32\n*  full source of all tools/libraries\n*  documentation (Adobe Acrobat format)\n\nUsers of other operating systems should download either the \"pawnkit.zip\"\nfile or the \"pawnkit.tgz\" file (\"Pawn toolkit\" archives), because it\ncontains the full source code. The difference between the \"ZIP\" file and the\n\"TGZ\" file is, apart from the different archiving tool used, that the source\nfile in the ZIP file has DOS/Windows line endings (CR/LF) and the \"TGZ\" file\nhas Unix line endings (LF only). When \"unpacking\" these archives, make sure\nthat the directory structure in the ZIP/TGZ files is retained. Otherwise, the\nPawn compiler will not be able to find its \"include\" files, for example.\n\nYou should also download the two documentation files \"Pawn_Language_Guide.pdf\" and\n\"Pawn_Implementor_Guide.pdf\" \u0026mdash; the \"Language guide\" and the \"Implementer's guide\"\nrespectively. You may need to build the compiler and abstract machine, and\nthe \"Implementer's guide\" is likely to give you precise guidelines (or at\nleast, it will point you in the right direction). There are a few guidelines\nfor building the system with CMake in the section \"Building with CMake\", below.\n\nAssuming that you have obtained an executable version of the Pawn compiler \nand the Pawn run-time (by building it, or by downloading a pre-built release),\nyou should put it in a directory. However, the Pawn compiler also needs to locate \n\"include files\". On many operating systems, the Pawn compiler is able to automatically\nread these header files from the directory \"include\" that is below the directory\nthat the compiler is in itself. Thus, if the Pawn compiler (the executable file) is \nin directory \"`C:\\WhatEver\\Pawn\\bin`\", I suggest that you create either the directory\n\"`C:\\WhatEver\\Pawn\\include`\" or \"`C:\\WhatEver\\Pawn\\bin\\include`\" and copy the\n\".inc\" files there. If your operating system is not compatible with Win32 or\nLinux, the Pawn compiler may not know how to locate the \"include\" directory\nand you have to specify it yourself with the \"`-i`\" command line option (when\nrunning the compiler).\n\nThat behind your back, locate one of the example scripts (e.g. \"hello.p\") and\ncompile it with:\n```\n        pawncc hello\n```\nThis should produce \"hello.amx\", which you can then run with:\n```\n        pawnrun hello.amx\n```\nMany applications that use Pawn, run the Pawn compiler as a child process;\ni.e. the Pawn compiler is often a separate, self-contained program. The\nabstract machine, however, is almost never a separate process: typically you\nwant the abstract machine to be integrated in the application so that scripts\ncan call into the application. In other words, you might be using \"pawncc\" as\nis, but you won't be using \"pawnrun\" as is. This is why pawnrun is kept short\nand dump, \"pawnrun\" is a program that is mostly developed in the Pawn manual to\nshow you what you should do at a minimum to embed Pawn into a program.\n\n\n# Building with CMake\nCMake is a cross-platform, open-source make system, which generates \"makefile's\"\nor project files for diverse compilers and platforms. See https://www.cmake.org/\nfor more information on CMake plus a freely downloadable copy.\n\nThe Pawn toolkit comes with a CMake project file that builds the compiler, a\nsimple run-time program that embeds the abstract machine, and a simple console\ndebugger. The CMake project file is in the \"source\" subdirectory of where the\nPawn toolkit is installed, when you installed the self-extracting \"setup\" for\nMicrosoft Windows. When unpacking the Pawn source code from a \"ZIP\" or \"TGZ\"\narchive, the CMake project file is in the main directory where you unpacked\nthe archive into.\n\n## Using CMake\n1. Run cmake-gui.\n\n2. Select for the source code directory, the \"source\" subdirectory in the\n   directory tree for the toolkit.\n\n   For example, if you installed the toolkit in C:\\Pawn, the source directory\n   is C:\\Pawn\\source.\n\n3. Select as destination the \"bin\" subdirectory, or any other directory of your\n   choice. The makefile (or project files) will be generated in the destination\n   directory.\n\n4. Select the compiler to use, as well. On Microsoft Windows, CMake supports\n   Microsoft, Borland, OpenWatcom and GNU compilers. Under Linux, CMake supports\n   GNU compilers by default, but allows you to set up specific (cross) compilers.\n\n5. Click on the \"Configure\" button. After an initial configuration, you may\n   have items displayed in red.  By this, CMake indicates that these items\n   may need adjustment, but in the case of Pawn, this is rarely needed. Click\n   \"Configure\" once more for the final configuration.\n\n6. Click on the \"Generate\" button, to create the makefiles or project files.\n   In older versions of CMake, there is an \"OK\" button instead of \"Generate\".\n\n7. Build the program in the usual way. For Microsoft Visual C/C++, CMake has\n   created a Visual Studio project and \"Workspace\" file; for other compilers\n   CMake builds a makefile.\n\n\n## Using the AMX DLL\nThe 32-bit AMX DLL (file AMX32.DLL) uses `__stdcall` calling convention, which\nis the most common calling convention for Win32 DLLs. If your compiler defaults\nto a different calling convention (most do), you must specify the `__stdcall`\ncalling convention explicitly. This can be done in two ways:\n1. a command line option for the C/C++ compiler (look up the manual)\n2. setting the macros AMX_NATIVE_CALL and AMXAPI to `__stdcall` before including\n   AMX.H. The macros AMX_NATIVE_CALL and AMXAPI are explained earlier in this\n   README.\n\nThe 32-bit AMX DLL comes with import libraries for various Win32 compilers:\n*  for Microsoft Visual C/C++ version 4.0 and above, use AMX32M.LIB\n*  for Borland C++ version 5.0 and for Borland C++ Builder, use AMX32B.LIB\n*  for Watcom C/C++ version 10.6 and 11.0, use AMX32W.LIB\n\nThe AMX DLL already includes \"core\" and \"console\" functions, which are the\nequivalents of the C files AMXCORE.C and AMXCONS.C. Console output goes to a\ntext window (with 30 lines of 80 characters per line) that the DLL creates.\nThe core and console functions are automatically registered to any Pawn\nprogram by amx_Init().\n\n   Microsoft Visual C/C++ version 5.0 or 6.0, 32-bit:\n```\n        cl -DAMXAPI=__stdcall prun-dll.c amx32m.lib\n```\n        (Note: the \"prun-dll\" example does not register additional native\n        functions. Therefore, AMX_NATIVE_CALL does not need to be defined.)\n\n   Watcom C/C++ version 11.0, 32-bit:\n```\n        wcl386 /l=nt_win /dAMXAPI=__stdcall prun-dll.c amx32w.lib\n```\n        (Note: the \"prun-dll\" example does not register additional native\n        functions. Therefore, AMX_NATIVE_CALL does not need to be defined.)\n\n   Borland C++ version 3.1, 16-bit:\n```\n        bcc -DAMXAPI=__cdecl -W -ml prun-dll.c amx16.lib\n```\n        (Note: the program must be compiled as a Win16 application, because\n        only Windows programs can use DLLs (option -W). Using large memory\n        model, option -ml, is not strictly required, but it is the most\n        convenient. Finally, note that the 16-bit DLL uses `__cdecl` calling\n        convention for its exported functions, for reasons explained below.)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompuphase%2Fpawn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcompuphase%2Fpawn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcompuphase%2Fpawn/lists"}