WIP: next #5
					 7 changed files with 16 additions and 22 deletions
				
			
		
							
								
								
									
										16
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										16
									
								
								Cargo.lock
									
										
									
										generated
									
									
									
								
							| 
						 | 
				
			
			@ -187,17 +187,6 @@ dependencies = [
 | 
			
		|||
 "wasi",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "inherent"
 | 
			
		||||
version = "1.0.12"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "6c38228f24186d9cc68c729accb4d413be9eaed6ad07ff79e0270d9e56f3de13"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "proc-macro2",
 | 
			
		||||
 "quote",
 | 
			
		||||
 "syn",
 | 
			
		||||
]
 | 
			
		||||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "is_terminal_polyfill"
 | 
			
		||||
version = "1.70.1"
 | 
			
		||||
| 
						 | 
				
			
			@ -395,14 +384,13 @@ dependencies = [
 | 
			
		|||
 | 
			
		||||
[[package]]
 | 
			
		||||
name = "servicepoint"
 | 
			
		||||
version = "0.15.1"
 | 
			
		||||
version = "0.16.0"
 | 
			
		||||
source = "registry+https://github.com/rust-lang/crates.io-index"
 | 
			
		||||
checksum = "2800caad491cb44f67e5dd5b8c61ece368eecfe588155d03c7d9864acbad6919"
 | 
			
		||||
checksum = "9b04582e916474f1bc1605cad3773262c425d9062b487e49a0df59662f2cca8d"
 | 
			
		||||
dependencies = [
 | 
			
		||||
 "bitvec",
 | 
			
		||||
 "bzip2",
 | 
			
		||||
 "flate2",
 | 
			
		||||
 "inherent",
 | 
			
		||||
 "log",
 | 
			
		||||
 "once_cell",
 | 
			
		||||
 "rust-lzma",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,7 +14,7 @@ keywords = ["cccb", "cccb-servicepoint", "cbindgen"]
 | 
			
		|||
crate-type = ["staticlib", "cdylib", "rlib"]
 | 
			
		||||
 | 
			
		||||
[dependencies.servicepoint]
 | 
			
		||||
version = "0.15.1"
 | 
			
		||||
version = "0.16.0"
 | 
			
		||||
default-features = false
 | 
			
		||||
 | 
			
		||||
[dependencies.env_logger]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,7 +45,9 @@ A full example including Makefile is available as part of this crate.
 | 
			
		|||
 | 
			
		||||
This library is still in early development.
 | 
			
		||||
You can absolutely use it, and it works, but expect minor breaking changes with every version bump.
 | 
			
		||||
Please specify the full version including patch in your Cargo.toml until 1.0 is released.
 | 
			
		||||
Pin a specific version until 1.0 is released.
 | 
			
		||||
 | 
			
		||||
Release notes are published [here](https://git.berlin.ccc.de/servicepoint/servicepoint-binding-c/releases).
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -81,6 +83,9 @@ When linked dynamically, you have to provide the `cdylib` at runtime in the _sam
 | 
			
		|||
  guarantees yet.
 | 
			
		||||
The Makefile in the example directory contains a bunch of additional compiler flags you might want to add depending on your use case.
 | 
			
		||||
 | 
			
		||||
The nix flake provides a package for referencing in your flake. 
 | 
			
		||||
The package provides a pkg-config file for automatic linking.
 | 
			
		||||
 | 
			
		||||
## Notes on differences to rust library
 | 
			
		||||
 | 
			
		||||
- function names are: `sp_` \<struct_name\> \<rust name\>.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
use crate::{containers::ByteSlice, macros::wrap};
 | 
			
		||||
use servicepoint::{
 | 
			
		||||
    Bitmap, BitmapCommand, CompressionCode, DataRef, DisplayBitVec, Grid,
 | 
			
		||||
    Origin, Packet,
 | 
			
		||||
    GridMut, Origin, Packet,
 | 
			
		||||
};
 | 
			
		||||
use std::ptr::NonNull;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
use crate::{containers::ByteSlice, macros::wrap};
 | 
			
		||||
use servicepoint::{
 | 
			
		||||
    Brightness, BrightnessGrid, BrightnessGridCommand, ByteGrid, DataRef, Grid,
 | 
			
		||||
    Origin, Packet,
 | 
			
		||||
    GridMut, Origin, Packet,
 | 
			
		||||
};
 | 
			
		||||
use std::{mem::transmute, ptr::NonNull};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,5 +1,5 @@
 | 
			
		|||
use crate::{containers::ByteSlice, macros::wrap};
 | 
			
		||||
use servicepoint::{CharGrid, CharGridCommand, Grid, Origin, Packet};
 | 
			
		||||
use servicepoint::{CharGrid, CharGridCommand, Grid, GridMut, Origin, Packet};
 | 
			
		||||
use std::ptr::NonNull;
 | 
			
		||||
 | 
			
		||||
wrap! {
 | 
			
		||||
| 
						 | 
				
			
			@ -25,8 +25,9 @@ wrap! {
 | 
			
		|||
        /// Loads a [CharGrid] with the specified dimensions from the provided data.
 | 
			
		||||
        ///
 | 
			
		||||
        /// returns: new CharGrid or NULL in case of an error
 | 
			
		||||
        fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_ok *mut CharGrid {
 | 
			
		||||
            CharGrid::load_utf8(width, height, data.to_vec())
 | 
			
		||||
        fn load(width: val usize, height: val usize, data: slice ByteSlice) -> move_some *mut CharGrid {
 | 
			
		||||
            String::from_utf8(data.to_vec()).ok()
 | 
			
		||||
                .and_then(|s| CharGrid::load(width, height, &*s.chars().collect::<Vec<_>>()))
 | 
			
		||||
        };
 | 
			
		||||
    methods:
 | 
			
		||||
        /// Returns the current value at the specified position.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
use crate::{containers::ByteSlice, macros::wrap};
 | 
			
		||||
use servicepoint::{
 | 
			
		||||
    Cp437Grid, Cp437GridCommand, DataRef, Grid, Origin, Packet,
 | 
			
		||||
    Cp437Grid, Cp437GridCommand, DataRef, Grid, GridMut, Origin, Packet,
 | 
			
		||||
};
 | 
			
		||||
use std::ptr::NonNull;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue