Skip to content

Commit

Permalink
It works
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <[email protected]>
  • Loading branch information
Xuanwo committed Mar 15, 2023
1 parent d40356d commit e1beb3e
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 5 deletions.
2 changes: 2 additions & 0 deletions bindings/c/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tests/hello
tests/hello.o
17 changes: 17 additions & 0 deletions bindings/c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

[package]
edition = "2021"
name = "opendal-c"
Expand Down
2 changes: 1 addition & 1 deletion bindings/c/cbindgen.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

language = "C"
header = """
/*
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand Down
2 changes: 1 addition & 1 deletion bindings/c/include/opendal.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
Expand Down
17 changes: 17 additions & 0 deletions bindings/c/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

use opendal::{services::Memory, Operator};

/// Hello, OpenDAL!
Expand Down
5 changes: 2 additions & 3 deletions bindings/c/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
# Build the example client
#

RPATH=$(PWD)/../../target/debug
RPATH=$(PWD)/../../../target/debug
CFLAGS = -I../include
LDFLAGS = -L$(RPATH) -Wl,-rpath,$(RPATH)
LIBS = -lopendal

all: build

build:
$(CC) hello.c $(CFLAGS)
$(CC) -o hello hello.o $(LDFLAGS) $(LIBS)
$(CC) hello.c -o hello $(CFLAGS) $(LDFLAGS) $(LIBS)
18 changes: 18 additions & 0 deletions bindings/c/tests/hello.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "opendal.h"

int main(int argc, char *argv[]) {
Expand Down

1 comment on commit e1beb3e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for opendal ready!

✅ Preview
https://opendal-c6erscrpv-databend.vercel.app
https://opendal-git-bindingsc.vercel.app

Built with commit e1beb3e.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.