-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add new mojo-libc package Signed-off-by: Manuel Saelices <[email protected]> * Add tests * Add avatar and Mojo image * Fix github link Signed-off-by: Manuel Saelices <[email protected]> * Add the extra section to the recipe.yaml Signed-off-by: Manuel Saelices <[email protected]> * Update libc revision to the one that includes the LICENSE Signed-off-by: Manuel Saelices <[email protected]> * Fix recipe script Signed-off-by: Manuel Saelices <[email protected]> * Fix the paths in the build recipe Signed-off-by: Manuel Saelices <[email protected]> * Pin Max 24.6 version * Add main() function to the tests Signed-off-by: Manuel Saelices <[email protected]> * Fix test file Signed-off-by: Manuel Saelices <[email protected]> * Remove test as it's broken --------- Signed-off-by: Manuel Saelices <[email protected]> Co-authored-by: Caroline Frasca <[email protected]>
- Loading branch information
1 parent
4c0c2c6
commit 7d7d08b
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Mojo's libc | ||
|
||
`mojo-libc` is a library that provides access to the C standard library functions in Mojo. | ||
|
||
## Getting Started | ||
|
||
The only dependency for `libc` is Mojo. | ||
|
||
You can install Mojo following the instructions from the [Modular website](https://www.modular.com/max/mojo). | ||
|
||
Once you have created a Mojo project using the `magic` tool, | ||
|
||
1. Add `libc` as a dependency: | ||
```toml | ||
[dependencies] | ||
libc = ">=0.1.9" | ||
``` | ||
2. Run `magic install` at the root of your project, where `mojoproject.toml` is located | ||
|
||
3. `libc` should now be installed as a dependency. You can import libc functions from the library, e.g: | ||
```mojo | ||
from libc import socket | ||
``` | ||
## Supported Functionality | ||
### Basic socket connections | ||
See the examples in [examples/sockets/](https://github.com/msaelices/mojo-libc/tree/main/examples/sockets) directory. | ||
### Basic file system operations | ||
See the examples in [examples/files/](https://github.com/msaelices/mojo-libc/tree/main/examples/files) directory. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
context: | ||
version: "0.1.9" | ||
|
||
package: | ||
name: "libc" | ||
version: ${{ version }} | ||
|
||
source: | ||
- git: https://github.com/msaelices/mojo-libc.git | ||
rev: 674d0fd35af4e716eb30df18cb1fe25cdddb08cf | ||
|
||
build: | ||
number: 0 | ||
script: | ||
- mojo package src/libc -o ${PREFIX}/lib/mojo/libc.mojopkg | ||
|
||
requirements: | ||
host: | ||
- max == 24.6 | ||
run: | ||
- ${{ pin_compatible('max') }} | ||
|
||
about: | ||
homepage: https://github.com/msaelices/mojo-libc | ||
license: MIT | ||
license_file: LICENSE | ||
summary: Mojo's libc support | ||
repository: https://github.com/msaelices/mojo-libc | ||
|
||
extra: | ||
maintainers: | ||
- msaelices | ||
- crisadamo | ||
project_name: mojo-libc |