mirror of
https://github.com/Sarsoo/csbindgen.git
synced 2024-12-23 06:56:27 +00:00
add quiche, bullet3
This commit is contained in:
parent
bdadaa2707
commit
7c65b5a72c
@ -11,24 +11,57 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
.generate()?
|
||||
.write_to_file("src/lz4/mod.rs")?;
|
||||
|
||||
cc::Build::new().file("c/lz4/lz4.c").compile("csharp_lz4");
|
||||
// TODO:build this
|
||||
// cc::Build::new().file("c/lz4/lz4.c").compile("csharp_lz4");
|
||||
|
||||
bindgen::Builder::default()
|
||||
.header("c/zstd/zstd.h")
|
||||
.generate()?
|
||||
.write_to_file("src/zstd.rs")?;
|
||||
|
||||
// bindgen::Builder::default()
|
||||
// .header("c/quiche/quiche.h")
|
||||
// .generate()?
|
||||
// .write_to_file("src/quiche.rs")?;
|
||||
|
||||
// bindgen::Builder::default()
|
||||
// .header("c/bullet3/PhysicsClientC_API.h")
|
||||
// .header("c/bullet3/PhysicsClientSharedMemory_C_API.h")
|
||||
// .header("c/bullet3/PhysicsClientSharedMemory2_C_API.h")
|
||||
// .header("c/bullet3/PhysicsDirectC_API.h")
|
||||
// .header("c/bullet3/SharedMemoryPublic.h")
|
||||
// .generate()?
|
||||
// .write_to_file("src/bullet3.rs")?;
|
||||
|
||||
csbindgen::Builder::new()
|
||||
.input_bindgen_file("src/lz4/mod.rs")
|
||||
.rust_method_prefix("csbindgen_")
|
||||
.generate_to_file("src/ffi.rs", "../dotnet-sandbox/bindgen.cs")
|
||||
.unwrap();
|
||||
.csharp_class_name("LibLz4")
|
||||
.csharp_dll_name("liblz4")
|
||||
.generate_to_file("src/ffi.rs", "../dotnet-sandbox/bindgen.cs")?;
|
||||
|
||||
csbindgen::Builder::new()
|
||||
csbindgen::Builder::new()
|
||||
.input_bindgen_file("src/zstd.rs")
|
||||
.rust_method_prefix("csbindgen_")
|
||||
.generate_to_file("src/zstd_ffi.rs", "../dotnet-sandbox/zstd_bindgen.cs")
|
||||
.unwrap();
|
||||
.rust_method_prefix("csbindgen_zstd_")
|
||||
.csharp_class_name("LibZstd")
|
||||
.csharp_dll_name("libzsd")
|
||||
.generate_to_file("src/zstd_ffi.rs", "../dotnet-sandbox/zstd_bindgen.cs")?;
|
||||
|
||||
// TODO: build failed?
|
||||
csbindgen::Builder::new()
|
||||
.input_bindgen_file("src/quiche.rs")
|
||||
.rust_method_prefix("csbindgen_quiche_")
|
||||
.csharp_class_name("LibQuiche")
|
||||
.csharp_dll_name("libquiche")
|
||||
.generate_to_file("src/quiche_ffi.rs", "../dotnet-sandbox/quiche_bindgen.cs")?;
|
||||
|
||||
// // TODO: build failed?
|
||||
csbindgen::Builder::new()
|
||||
.input_bindgen_file("src/bullet3.rs")
|
||||
.rust_method_prefix("csbindgen_bullet3_")
|
||||
.csharp_class_name("LibBullet3")
|
||||
.csharp_dll_name("libbullet3")
|
||||
.generate_to_file("src/bullet3_ffi.rs", "../dotnet-sandbox/bullet3_bindgen.cs")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
761
csbindgen-tests/c/bullet3/PhysicsClientC_API.h
Normal file
761
csbindgen-tests/c/bullet3/PhysicsClientC_API.h
Normal file
@ -0,0 +1,761 @@
|
||||
#ifndef PHYSICS_CLIENT_C_API_H
|
||||
#define PHYSICS_CLIENT_C_API_H
|
||||
|
||||
//#include "SharedMemoryBlock.h"
|
||||
#include "SharedMemoryPublic.h"
|
||||
|
||||
#define B3_DECLARE_HANDLE(name) \
|
||||
typedef struct name##__ \
|
||||
{ \
|
||||
int unused; \
|
||||
} * name
|
||||
|
||||
B3_DECLARE_HANDLE(b3PhysicsClientHandle);
|
||||
B3_DECLARE_HANDLE(b3SharedMemoryCommandHandle);
|
||||
B3_DECLARE_HANDLE(b3SharedMemoryStatusHandle);
|
||||
|
||||
#ifdef _WIN32
|
||||
#define B3_SHARED_API __declspec(dllexport)
|
||||
#elif defined(__GNUC__)
|
||||
#define B3_SHARED_API __attribute__((visibility("default")))
|
||||
#else
|
||||
#define B3_SHARED_API
|
||||
#endif
|
||||
|
||||
///There are several connection methods, see following header files:
|
||||
#include "PhysicsClientSharedMemory_C_API.h"
|
||||
#include "PhysicsClientSharedMemory2_C_API.h"
|
||||
#include "PhysicsDirectC_API.h"
|
||||
|
||||
#ifdef BT_ENABLE_ENET
|
||||
#include "PhysicsClientUDP_C_API.h"
|
||||
#endif
|
||||
|
||||
#ifdef BT_ENABLE_CLSOCKET
|
||||
#include "PhysicsClientTCP_C_API.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
///b3DisconnectSharedMemory will disconnect the client from the server and cleanup memory.
|
||||
B3_SHARED_API void b3DisconnectSharedMemory(b3PhysicsClientHandle physClient);
|
||||
|
||||
///There can only be 1 outstanding command. Check if a command can be send.
|
||||
B3_SHARED_API int b3CanSubmitCommand(b3PhysicsClientHandle physClient);
|
||||
|
||||
///blocking submit command and wait for status
|
||||
B3_SHARED_API b3SharedMemoryStatusHandle b3SubmitClientCommandAndWaitStatus(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle);
|
||||
|
||||
///In general it is better to use b3SubmitClientCommandAndWaitStatus. b3SubmitClientCommand is a non-blocking submit
|
||||
///command, which requires checking for the status manually, using b3ProcessServerStatus. Also, before sending the
|
||||
///next command, make sure to check if you can send a command using 'b3CanSubmitCommand'.
|
||||
B3_SHARED_API int b3SubmitClientCommand(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle);
|
||||
|
||||
///non-blocking check status
|
||||
B3_SHARED_API b3SharedMemoryStatusHandle b3ProcessServerStatus(b3PhysicsClientHandle physClient);
|
||||
|
||||
/// Get the physics server return status type. See EnumSharedMemoryServerStatus in SharedMemoryPublic.h for error codes.
|
||||
B3_SHARED_API int b3GetStatusType(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
///Plugin system, load and unload a plugin, execute a command
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCustomCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3CustomCommandLoadPlugin(b3SharedMemoryCommandHandle commandHandle, const char* pluginPath);
|
||||
B3_SHARED_API void b3CustomCommandLoadPluginSetPostFix(b3SharedMemoryCommandHandle commandHandle, const char* postFix);
|
||||
B3_SHARED_API int b3GetStatusPluginUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
B3_SHARED_API int b3GetStatusPluginCommandResult(b3SharedMemoryStatusHandle statusHandle);
|
||||
B3_SHARED_API int b3GetStatusPluginCommandReturnData(b3PhysicsClientHandle physClient, struct b3UserDataValue* valueOut);
|
||||
|
||||
B3_SHARED_API void b3CustomCommandUnloadPlugin(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId);
|
||||
B3_SHARED_API void b3CustomCommandExecutePluginCommand(b3SharedMemoryCommandHandle commandHandle, int pluginUniqueId, const char* textArguments);
|
||||
B3_SHARED_API void b3CustomCommandExecuteAddIntArgument(b3SharedMemoryCommandHandle commandHandle, int intVal);
|
||||
B3_SHARED_API void b3CustomCommandExecuteAddFloatArgument(b3SharedMemoryCommandHandle commandHandle, float floatVal);
|
||||
|
||||
B3_SHARED_API int b3GetStatusBodyIndices(b3SharedMemoryStatusHandle statusHandle, int* bodyIndicesOut, int bodyIndicesCapacity);
|
||||
|
||||
B3_SHARED_API int b3GetStatusBodyIndex(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
B3_SHARED_API int b3GetStatusActualState(b3SharedMemoryStatusHandle statusHandle,
|
||||
int* bodyUniqueId,
|
||||
int* numDegreeOfFreedomQ,
|
||||
int* numDegreeOfFreedomU,
|
||||
const double* rootLocalInertialFrame[],
|
||||
const double* actualStateQ[],
|
||||
const double* actualStateQdot[],
|
||||
const double* jointReactionForces[]);
|
||||
|
||||
B3_SHARED_API int b3GetStatusActualState2(b3SharedMemoryStatusHandle statusHandle,
|
||||
int* bodyUniqueId,
|
||||
int* numLinks,
|
||||
int* numDegreeOfFreedomQ,
|
||||
int* numDegreeOfFreedomU,
|
||||
const double* rootLocalInertialFrame[],
|
||||
const double* actualStateQ[],
|
||||
const double* actualStateQdot[],
|
||||
const double* jointReactionForces[],
|
||||
const double* linkLocalInertialFrames[],
|
||||
const double* jointMotorForces[],
|
||||
const double* linkStates[],
|
||||
const double* linkWorldVelocities[]);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestCollisionInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API int b3GetStatusAABB(b3SharedMemoryStatusHandle statusHandle, int linkIndex, double aabbMin[/*3*/], double aabbMax[/*3*/]);
|
||||
|
||||
///If you re-connected to an existing server, or server changed otherwise, sync the body info and user constraints etc.
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitSyncBodyInfoCommand(b3PhysicsClientHandle physClient);
|
||||
|
||||
// Sync the body info of a single body. Useful when a new body has been added by a different client (e,g, when detecting through a body added notification).
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestBodyInfoCommand(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveBodyCommand(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
///return the total number of bodies in the simulation
|
||||
B3_SHARED_API int b3GetNumBodies(b3PhysicsClientHandle physClient);
|
||||
|
||||
/// return the body unique id, given the index in range [0 , b3GetNumBodies() )
|
||||
B3_SHARED_API int b3GetBodyUniqueId(b3PhysicsClientHandle physClient, int serialIndex);
|
||||
|
||||
///given a body unique id, return the body information. See b3BodyInfo in SharedMemoryPublic.h
|
||||
B3_SHARED_API int b3GetBodyInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, struct b3BodyInfo* info);
|
||||
|
||||
///give a unique body index (after loading the body) return the number of joints.
|
||||
B3_SHARED_API int b3GetNumJoints(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
///give a unique body index (after loading the body) return the number of degrees of freedom (DoF).
|
||||
B3_SHARED_API int b3GetNumDofs(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
///compute the number of degrees of freedom for this body.
|
||||
///Return -1 for unsupported spherical joint, -2 for unsupported planar joint.
|
||||
B3_SHARED_API int b3ComputeDofCount(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
|
||||
///given a body and joint index, return the joint information. See b3JointInfo in SharedMemoryPublic.h
|
||||
B3_SHARED_API int b3GetJointInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, struct b3JointInfo* info);
|
||||
|
||||
///user data handling
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitSyncUserDataCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3AddBodyToSyncUserDataRequest(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitAddUserDataCommand(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex, int visualShapeIndex, const char* key, enum UserDataValueType valueType, int valueLength, const void* valueData);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserDataCommand(b3PhysicsClientHandle physClient, int userDataId);
|
||||
|
||||
B3_SHARED_API int b3GetUserData(b3PhysicsClientHandle physClient, int userDataId, struct b3UserDataValue* valueOut);
|
||||
B3_SHARED_API int b3GetUserDataId(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex, int visualShapeIndex, const char* key);
|
||||
B3_SHARED_API int b3GetUserDataIdFromStatus(b3SharedMemoryStatusHandle statusHandle);
|
||||
B3_SHARED_API int b3GetNumUserData(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API void b3GetUserDataInfo(b3PhysicsClientHandle physClient, int bodyUniqueId, int userDataIndex, const char** keyOut, int* userDataIdOut, int* linkIndexOut, int* visualShapeIndexOut);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3GetDynamicsInfoCommandInit2(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex);
|
||||
|
||||
///given a body unique id and link index, return the dynamics information. See b3DynamicsInfo in SharedMemoryPublic.h
|
||||
B3_SHARED_API int b3GetDynamicsInfo(b3SharedMemoryStatusHandle statusHandle, struct b3DynamicsInfo* info);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeDynamicsInfo2(b3SharedMemoryCommandHandle commandHandle);
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetMass(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double mass);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetLocalInertiaDiagonal(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, const double localInertiaDiagonal[]);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetAnisotropicFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, const double anisotropicFriction[]);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetJointLimit(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double jointLowerLimit, double jointUpperLimit);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetJointLimitForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double jointLimitForce);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetDynamicType(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, int dynamicType);
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetSleepThreshold(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, double sleepThreshold);
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetLateralFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double lateralFriction);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetSpinningFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetRollingFriction(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double friction);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetRestitution(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double restitution);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetLinearDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, double linearDamping);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetAngularDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, double angularDamping);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double jointDamping);
|
||||
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetContactStiffnessAndDamping(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double contactStiffness, double contactDamping);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetFrictionAnchor(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, int frictionAnchor);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetCcdSweptSphereRadius(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double ccdSweptSphereRadius);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetContactProcessingThreshold(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkIndex, double contactProcessingThreshold);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetActivationState(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int activationState);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetMaxJointVelocity(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, double maxJointVelocity);
|
||||
B3_SHARED_API int b3ChangeDynamicsInfoSetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, double collisionMargin);
|
||||
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand(b3PhysicsClientHandle physClient, int parentBodyUniqueId, int parentJointIndex, int childBodyUniqueId, int childJointIndex, struct b3JointInfo* info);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateUserConstraintCommand2(b3SharedMemoryCommandHandle commandHandle, int parentBodyUniqueId, int parentJointIndex, int childBodyUniqueId, int childJointIndex, struct b3JointInfo* info);
|
||||
|
||||
///return a unique id for the user constraint, after successful creation, or -1 for an invalid constraint id
|
||||
B3_SHARED_API int b3GetStatusUserConstraintUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
///change parameters of an existing user constraint
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitChangeUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetPivotInB(b3SharedMemoryCommandHandle commandHandle, const double jointChildPivot[/*3*/]);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetFrameInB(b3SharedMemoryCommandHandle commandHandle, const double jointChildFrameOrn[/*4*/]);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetMaxForce(b3SharedMemoryCommandHandle commandHandle, double maxAppliedForce);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetGearRatio(b3SharedMemoryCommandHandle commandHandle, double gearRatio);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetGearAuxLink(b3SharedMemoryCommandHandle commandHandle, int gearAuxLink);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetRelativePositionTarget(b3SharedMemoryCommandHandle commandHandle, double relativePositionTarget);
|
||||
B3_SHARED_API int b3InitChangeUserConstraintSetERP(b3SharedMemoryCommandHandle commandHandle, double erp);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveUserConstraintCommand(b3PhysicsClientHandle physClient, int userConstraintUniqueId);
|
||||
|
||||
B3_SHARED_API int b3GetNumUserConstraints(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitGetUserConstraintStateCommand(b3PhysicsClientHandle physClient, int constraintUniqueId);
|
||||
B3_SHARED_API int b3GetStatusUserConstraintState(b3SharedMemoryStatusHandle statusHandle, struct b3UserConstraintState* constraintState);
|
||||
|
||||
B3_SHARED_API int b3GetUserConstraintInfo(b3PhysicsClientHandle physClient, int constraintUniqueId, struct b3UserConstraint* info);
|
||||
/// return the user constraint id, given the index in range [0 , b3GetNumUserConstraints() )
|
||||
B3_SHARED_API int b3GetUserConstraintId(b3PhysicsClientHandle physClient, int serialIndex);
|
||||
|
||||
///Request physics debug lines for debug visualization. The flags in debugMode are the same as used in Bullet
|
||||
///See btIDebugDraw::DebugDrawModes in Bullet/src/LinearMath/btIDebugDraw.h
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestDebugLinesCommand(b3PhysicsClientHandle physClient, int debugMode);
|
||||
|
||||
///Get the pointers to the physics debug line information, after b3InitRequestDebugLinesCommand returns
|
||||
///status CMD_DEBUG_LINES_COMPLETED
|
||||
B3_SHARED_API void b3GetDebugLines(b3PhysicsClientHandle physClient, struct b3DebugLines* lines);
|
||||
|
||||
///configure the 3D OpenGL debug visualizer (enable/disable GUI widgets, shadows, position camera etc)
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitConfigureOpenGLVisualizer2(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetVisualizationFlags(b3SharedMemoryCommandHandle commandHandle, int flag, int enabled);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetLightPosition(b3SharedMemoryCommandHandle commandHandle, const float lightPosition[3]);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetShadowMapResolution(b3SharedMemoryCommandHandle commandHandle, int shadowMapResolution);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetShadowMapIntensity(b3SharedMemoryCommandHandle commandHandle, double shadowMapIntensity);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetLightRgbBackground(b3SharedMemoryCommandHandle commandHandle, const float rgbBackground[3]);
|
||||
|
||||
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetShadowMapWorldSize(b3SharedMemoryCommandHandle commandHandle, int shadowMapWorldSize);
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetRemoteSyncTransformInterval(b3SharedMemoryCommandHandle commandHandle, double remoteSyncTransformInterval);
|
||||
|
||||
B3_SHARED_API void b3ConfigureOpenGLVisualizerSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, float cameraDistance, float cameraPitch, float cameraYaw, const float cameraTargetPosition[/*3*/]);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestOpenGLVisualizerCameraCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3GetStatusOpenGLVisualizerCamera(b3SharedMemoryStatusHandle statusHandle, struct b3OpenGLVisualizerCameraInfo* camera);
|
||||
|
||||
/// Add/remove user-specific debug lines and debug text messages
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddLine3D(b3PhysicsClientHandle physClient, const double fromXYZ[/*3*/], const double toXYZ[/*3*/], const double colorRGB[/*3*/], double lineWidth, double lifeTime);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddPoints3D(b3PhysicsClientHandle physClient, const double positionsXYZ[/*3n*/], const double colorsRGB[/*3*/], double pointSize, double lifeTime, int pointNum);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawAddText3D(b3PhysicsClientHandle physClient, const char* txt, const double positionXYZ[/*3*/], const double colorRGB[/*3*/], double textSize, double lifeTime);
|
||||
B3_SHARED_API void b3UserDebugTextSetOptionFlags(b3SharedMemoryCommandHandle commandHandle, int optionFlags);
|
||||
B3_SHARED_API void b3UserDebugTextSetOrientation(b3SharedMemoryCommandHandle commandHandle, const double orientation[/*4*/]);
|
||||
B3_SHARED_API void b3UserDebugItemSetReplaceItemUniqueId(b3SharedMemoryCommandHandle commandHandle, int replaceItem);
|
||||
|
||||
B3_SHARED_API void b3UserDebugItemSetParentObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugAddParameter(b3PhysicsClientHandle physClient, const char* txt, double rangeMin, double rangeMax, double startValue);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugReadParameter(b3PhysicsClientHandle physClient, int debugItemUniqueId);
|
||||
B3_SHARED_API int b3GetStatusDebugParameterValue(b3SharedMemoryStatusHandle statusHandle, double* paramValue);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemove(b3PhysicsClientHandle physClient, int debugItemUniqueId);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserDebugDrawRemoveAll(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUserRemoveAllParameters(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitDebugDrawingCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3SetDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex, const double objectColorRGB[/*3*/]);
|
||||
B3_SHARED_API void b3RemoveDebugObjectColor(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId, int linkIndex);
|
||||
|
||||
///All debug items unique Ids are positive: a negative unique Id means failure.
|
||||
B3_SHARED_API int b3GetDebugItemUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
///request an image from a simulated camera, using a software renderer.
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCameraImage(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCameraImage2(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3RequestCameraImageSetCameraMatrices(b3SharedMemoryCommandHandle commandHandle, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]);
|
||||
B3_SHARED_API void b3RequestCameraImageSetPixelResolution(b3SharedMemoryCommandHandle commandHandle, int width, int height);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightDirection(b3SharedMemoryCommandHandle commandHandle, const float lightDirection[/*3*/]);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightColor(b3SharedMemoryCommandHandle commandHandle, const float lightColor[/*3*/]);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightDistance(b3SharedMemoryCommandHandle commandHandle, float lightDistance);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightAmbientCoeff(b3SharedMemoryCommandHandle commandHandle, float lightAmbientCoeff);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightDiffuseCoeff(b3SharedMemoryCommandHandle commandHandle, float lightDiffuseCoeff);
|
||||
B3_SHARED_API void b3RequestCameraImageSetLightSpecularCoeff(b3SharedMemoryCommandHandle commandHandle, float lightSpecularCoeff);
|
||||
B3_SHARED_API void b3RequestCameraImageSetShadow(b3SharedMemoryCommandHandle commandHandle, int hasShadow);
|
||||
B3_SHARED_API void b3RequestCameraImageSelectRenderer(b3SharedMemoryCommandHandle commandHandle, int renderer);
|
||||
B3_SHARED_API void b3RequestCameraImageSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
B3_SHARED_API void b3GetCameraImageData(b3PhysicsClientHandle physClient, struct b3CameraImageData* imageData);
|
||||
|
||||
///set projective texture camera matrices.
|
||||
B3_SHARED_API void b3RequestCameraImageSetProjectiveTextureMatrices(b3SharedMemoryCommandHandle commandHandle, float viewMatrix[/*16*/], float projectionMatrix[/*16*/]);
|
||||
|
||||
///compute a view matrix, helper function for b3RequestCameraImageSetCameraMatrices
|
||||
B3_SHARED_API void b3ComputeViewMatrixFromPositions(const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/], float viewMatrix[/*16*/]);
|
||||
B3_SHARED_API void b3ComputeViewMatrixFromYawPitchRoll(const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis, float viewMatrix[/*16*/]);
|
||||
B3_SHARED_API void b3ComputePositionFromViewMatrix(const float viewMatrix[/*16*/], float cameraPosition[/*3*/], float cameraTargetPosition[/*3*/], float cameraUp[/*3*/]);
|
||||
|
||||
///compute a projection matrix, helper function for b3RequestCameraImageSetCameraMatrices
|
||||
B3_SHARED_API void b3ComputeProjectionMatrix(float left, float right, float bottom, float top, float nearVal, float farVal, float projectionMatrix[/*16*/]);
|
||||
B3_SHARED_API void b3ComputeProjectionMatrixFOV(float fov, float aspect, float nearVal, float farVal, float projectionMatrix[/*16*/]);
|
||||
|
||||
/* obsolete, please use b3ComputeViewProjectionMatrices */
|
||||
B3_SHARED_API void b3RequestCameraImageSetViewMatrix(b3SharedMemoryCommandHandle commandHandle, const float cameraPosition[/*3*/], const float cameraTargetPosition[/*3*/], const float cameraUp[/*3*/]);
|
||||
/* obsolete, please use b3ComputeViewProjectionMatrices */
|
||||
B3_SHARED_API void b3RequestCameraImageSetViewMatrix2(b3SharedMemoryCommandHandle commandHandle, const float cameraTargetPosition[/*3*/], float distance, float yaw, float pitch, float roll, int upAxis);
|
||||
/* obsolete, please use b3ComputeViewProjectionMatrices */
|
||||
B3_SHARED_API void b3RequestCameraImageSetProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float left, float right, float bottom, float top, float nearVal, float farVal);
|
||||
/* obsolete, please use b3ComputeViewProjectionMatrices */
|
||||
B3_SHARED_API void b3RequestCameraImageSetFOVProjectionMatrix(b3SharedMemoryCommandHandle commandHandle, float fov, float aspect, float nearVal, float farVal);
|
||||
|
||||
///request an contact point information
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestContactPointInformation(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3SetContactFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA);
|
||||
B3_SHARED_API void b3SetContactFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB);
|
||||
B3_SHARED_API void b3SetContactFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA);
|
||||
B3_SHARED_API void b3SetContactFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB);
|
||||
B3_SHARED_API void b3GetContactPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointData);
|
||||
|
||||
///compute the closest points between two bodies
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitClosestDistanceQuery(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterBodyA(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterLinkA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterBodyB(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdB);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterLinkB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB);
|
||||
B3_SHARED_API void b3SetClosestDistanceThreshold(b3SharedMemoryCommandHandle commandHandle, double distance);
|
||||
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapeA(b3SharedMemoryCommandHandle commandHandle, int collisionShapeA);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapeB(b3SharedMemoryCommandHandle commandHandle, int collisionShapeB);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapePositionA(b3SharedMemoryCommandHandle commandHandle, const double collisionShapePositionA[/*3*/]);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapePositionB(b3SharedMemoryCommandHandle commandHandle, const double collisionShapePositionB[/*3*/]);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapeOrientationA(b3SharedMemoryCommandHandle commandHandle, const double collisionShapeOrientationA[/*4*/]);
|
||||
B3_SHARED_API void b3SetClosestDistanceFilterCollisionShapeOrientationB(b3SharedMemoryCommandHandle commandHandle, const double collisionShapeOrientationB[/*4*/]);
|
||||
|
||||
B3_SHARED_API void b3GetClosestPointInformation(b3PhysicsClientHandle physClient, struct b3ContactInformation* contactPointInfo);
|
||||
|
||||
///get all the bodies that touch a given axis aligned bounding box specified in world space (min and max coordinates)
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitAABBOverlapQuery(b3PhysicsClientHandle physClient, const double aabbMin[/*3*/], const double aabbMax[/*3*/]);
|
||||
B3_SHARED_API void b3GetAABBOverlapResults(b3PhysicsClientHandle physClient, struct b3AABBOverlapData* data);
|
||||
|
||||
//request visual shape information
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestVisualShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueIdA);
|
||||
B3_SHARED_API void b3GetVisualShapeInformation(b3PhysicsClientHandle physClient, struct b3VisualShapeInformation* visualShapeInfo);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestCollisionShapeInformation(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex);
|
||||
B3_SHARED_API void b3GetCollisionShapeInformation(b3PhysicsClientHandle physClient, struct b3CollisionShapeInformation* collisionShapeInfo);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitLoadTexture(b3PhysicsClientHandle physClient, const char* filename);
|
||||
B3_SHARED_API int b3GetStatusTextureUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateChangeTextureCommandInit(b3PhysicsClientHandle physClient, int textureUniqueId, int width, int height, const char* rgbPixels);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUpdateVisualShape(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex, int textureUniqueId);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitUpdateVisualShape2(b3PhysicsClientHandle physClient, int bodyUniqueId, int jointIndex, int shapeIndex);
|
||||
B3_SHARED_API void b3UpdateVisualShapeTexture(b3SharedMemoryCommandHandle commandHandle, int textureUniqueId);
|
||||
B3_SHARED_API void b3UpdateVisualShapeRGBAColor(b3SharedMemoryCommandHandle commandHandle, const double rgbaColor[/*4*/]);
|
||||
B3_SHARED_API void b3UpdateVisualShapeFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
B3_SHARED_API void b3UpdateVisualShapeSpecularColor(b3SharedMemoryCommandHandle commandHandle, const double specularColor[/*3*/]);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitPhysicsParamCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitPhysicsParamCommand2(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API int b3PhysicsParamSetGravity(b3SharedMemoryCommandHandle commandHandle, double gravx, double gravy, double gravz);
|
||||
B3_SHARED_API int b3PhysicsParamSetTimeStep(b3SharedMemoryCommandHandle commandHandle, double timeStep);
|
||||
B3_SHARED_API int b3PhysicsParamSetDefaultContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultContactERP);
|
||||
B3_SHARED_API int b3PhysicsParamSetDefaultNonContactERP(b3SharedMemoryCommandHandle commandHandle, double defaultNonContactERP);
|
||||
B3_SHARED_API int b3PhysicsParamSetDefaultFrictionERP(b3SharedMemoryCommandHandle commandHandle, double frictionERP);
|
||||
B3_SHARED_API int b3PhysicsParamSetDefaultGlobalCFM(b3SharedMemoryCommandHandle commandHandle, double defaultGlobalCFM);
|
||||
B3_SHARED_API int b3PhysicsParamSetDefaultFrictionCFM(b3SharedMemoryCommandHandle commandHandle, double frictionCFM);
|
||||
B3_SHARED_API int b3PhysicsParamSetNumSubSteps(b3SharedMemoryCommandHandle commandHandle, int numSubSteps);
|
||||
B3_SHARED_API int b3PhysicsParamSetRealTimeSimulation(b3SharedMemoryCommandHandle commandHandle, int enableRealTimeSimulation);
|
||||
B3_SHARED_API int b3PhysicsParamSetNumSolverIterations(b3SharedMemoryCommandHandle commandHandle, int numSolverIterations);
|
||||
B3_SHARED_API int b3PhysicsParamSetNumNonContactInnerIterations(b3SharedMemoryCommandHandle commandHandle, int numMotorIterations);
|
||||
B3_SHARED_API int b3PhysicsParamSetWarmStartingFactor(b3SharedMemoryCommandHandle commandHandle, double warmStartingFactor);
|
||||
B3_SHARED_API int b3PhysicsParamSetArticulatedWarmStartingFactor(b3SharedMemoryCommandHandle commandHandle, double warmStartingFactor);
|
||||
B3_SHARED_API int b3PhysicsParamSetCollisionFilterMode(b3SharedMemoryCommandHandle commandHandle, int filterMode);
|
||||
B3_SHARED_API int b3PhysicsParamSetUseSplitImpulse(b3SharedMemoryCommandHandle commandHandle, int useSplitImpulse);
|
||||
B3_SHARED_API int b3PhysicsParamSetSplitImpulsePenetrationThreshold(b3SharedMemoryCommandHandle commandHandle, double splitImpulsePenetrationThreshold);
|
||||
B3_SHARED_API int b3PhysicsParamSetContactBreakingThreshold(b3SharedMemoryCommandHandle commandHandle, double contactBreakingThreshold);
|
||||
B3_SHARED_API int b3PhysicsParamSetMaxNumCommandsPer1ms(b3SharedMemoryCommandHandle commandHandle, int maxNumCmdPer1ms);
|
||||
B3_SHARED_API int b3PhysicsParamSetEnableFileCaching(b3SharedMemoryCommandHandle commandHandle, int enableFileCaching);
|
||||
B3_SHARED_API int b3PhysicsParamSetRestitutionVelocityThreshold(b3SharedMemoryCommandHandle commandHandle, double restitutionVelocityThreshold);
|
||||
B3_SHARED_API int b3PhysicsParamSetEnableConeFriction(b3SharedMemoryCommandHandle commandHandle, int enableConeFriction);
|
||||
B3_SHARED_API int b3PhysicsParameterSetDeterministicOverlappingPairs(b3SharedMemoryCommandHandle commandHandle, int deterministicOverlappingPairs);
|
||||
B3_SHARED_API int b3PhysicsParameterSetAllowedCcdPenetration(b3SharedMemoryCommandHandle commandHandle, double allowedCcdPenetration);
|
||||
B3_SHARED_API int b3PhysicsParameterSetJointFeedbackMode(b3SharedMemoryCommandHandle commandHandle, int jointFeedbackMode);
|
||||
B3_SHARED_API int b3PhysicsParamSetSolverResidualThreshold(b3SharedMemoryCommandHandle commandHandle, double solverResidualThreshold);
|
||||
B3_SHARED_API int b3PhysicsParamSetContactSlop(b3SharedMemoryCommandHandle commandHandle, double contactSlop);
|
||||
B3_SHARED_API int b3PhysicsParameterSetEnableSAT(b3SharedMemoryCommandHandle commandHandle, int enableSAT);
|
||||
B3_SHARED_API int b3PhysicsParameterSetConstraintSolverType(b3SharedMemoryCommandHandle commandHandle, int constraintSolverType);
|
||||
B3_SHARED_API int b3PhysicsParameterSetMinimumSolverIslandSize(b3SharedMemoryCommandHandle commandHandle, int minimumSolverIslandSize);
|
||||
B3_SHARED_API int b3PhysicsParamSetSolverAnalytics(b3SharedMemoryCommandHandle commandHandle, int reportSolverAnalytics);
|
||||
B3_SHARED_API int b3PhysicsParameterSetSparseSdfVoxelSize(b3SharedMemoryCommandHandle commandHandle, double sparseSdfVoxelSize);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRequestPhysicsParamCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3GetStatusPhysicsSimulationParameters(b3SharedMemoryStatusHandle statusHandle, struct b3PhysicsSimulationParameters* params);
|
||||
|
||||
//b3PhysicsParamSetInternalSimFlags is for internal/temporary/easter-egg/experimental demo purposes
|
||||
//Use at own risk: magic things may or my not happen when calling this API
|
||||
B3_SHARED_API int b3PhysicsParamSetInternalSimFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitStepSimulationCommand2(b3SharedMemoryCommandHandle commandHandle);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitPerformCollisionDetectionCommand(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API int b3GetStatusForwardDynamicsAnalyticsData(b3SharedMemoryStatusHandle statusHandle, struct b3ForwardDynamicsAnalyticsArgs* analyticsData);
|
||||
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitResetSimulationCommand(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitResetSimulationCommand2(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API int b3InitResetSimulationSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
///Load a robot from a URDF file. Status type will CMD_URDF_LOADING_COMPLETED.
|
||||
///Access the robot from the unique body index, through b3GetStatusBodyIndex(statusHandle);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit(b3PhysicsClientHandle physClient, const char* urdfFileName);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadUrdfCommandInit2(b3SharedMemoryCommandHandle commandHandle, const char* urdfFileName);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX, double startPosY, double startPosZ);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle, int useFixedBase);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
B3_SHARED_API int b3LoadUrdfCommandSetGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3SaveStateCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveStateCommand(b3PhysicsClientHandle physClient, int stateId);
|
||||
B3_SHARED_API int b3GetStatusGetStateId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadStateCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3LoadStateSetStateId(b3SharedMemoryCommandHandle commandHandle, int stateId);
|
||||
B3_SHARED_API int b3LoadStateSetFileName(b3SharedMemoryCommandHandle commandHandle, const char* fileName);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3SaveBulletCommandInit(b3PhysicsClientHandle physClient, const char* fileName);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadMJCFCommandInit(b3PhysicsClientHandle physClient, const char* fileName);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadMJCFCommandInit2(b3SharedMemoryCommandHandle commandHandle, const char* fileName);
|
||||
B3_SHARED_API void b3LoadMJCFCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
B3_SHARED_API void b3LoadMJCFCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody);
|
||||
|
||||
|
||||
///compute the forces to achieve an acceleration, given a state q and qdot using inverse dynamics
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId,
|
||||
const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseDynamicsCommandInit2(b3PhysicsClientHandle physClient, int bodyUniqueId,
|
||||
const double* jointPositionsQ, int dofCountQ, const double* jointVelocitiesQdot, const double* jointAccelerations, int dofCountQdot);
|
||||
B3_SHARED_API void b3CalculateInverseDynamicsSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
B3_SHARED_API int b3GetStatusInverseDynamicsJointForces(b3SharedMemoryStatusHandle statusHandle,
|
||||
int* bodyUniqueId,
|
||||
int* dofCount,
|
||||
double* jointForces);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateJacobianCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex, const double* localPosition, const double* jointPositionsQ, const double* jointVelocitiesQdot, const double* jointAccelerations);
|
||||
B3_SHARED_API int b3GetStatusJacobian(b3SharedMemoryStatusHandle statusHandle,
|
||||
int* dofCount,
|
||||
double* linearJacobian,
|
||||
double* angularJacobian);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateMassMatrixCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, const double* jointPositionsQ, int dofCountQ);
|
||||
B3_SHARED_API void b3CalculateMassMatrixSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
///the mass matrix is stored in column-major layout of size dofCount*dofCount
|
||||
B3_SHARED_API int b3GetStatusMassMatrix(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int* dofCount, double* massMatrix);
|
||||
|
||||
///compute the joint positions to move the end effector to a desired target using inverse kinematics
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CalculateInverseKinematicsCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPurePosition(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/]);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsAddTargetsPurePosition(b3SharedMemoryCommandHandle commandHandle, int numEndEffectorLinkIndices, const int* endEffectorIndices, const double* targetPositions);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsAddTargetPositionWithOrientation(b3SharedMemoryCommandHandle commandHandle, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/]);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsPosWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsPosOrnWithNullSpaceVel(b3SharedMemoryCommandHandle commandHandle, int numDof, int endEffectorLinkIndex, const double targetPosition[/*3*/], const double targetOrientation[/*4*/], const double* lowerLimit, const double* upperLimit, const double* jointRange, const double* restPose);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsSetJointDamping(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* jointDampingCoeff);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsSelectSolver(b3SharedMemoryCommandHandle commandHandle, int solver);
|
||||
B3_SHARED_API int b3GetStatusInverseKinematicsJointPositions(b3SharedMemoryStatusHandle statusHandle,
|
||||
int* bodyUniqueId,
|
||||
int* dofCount,
|
||||
double* jointPositions);
|
||||
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsSetCurrentPositions(b3SharedMemoryCommandHandle commandHandle, int numDof, const double* currentJointPositions);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsSetMaxNumIterations(b3SharedMemoryCommandHandle commandHandle, int maxNumIterations);
|
||||
B3_SHARED_API void b3CalculateInverseKinematicsSetResidualThreshold(b3SharedMemoryCommandHandle commandHandle, double residualThreshold);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CollisionFilterCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3SetCollisionFilterPair(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA,
|
||||
int bodyUniqueIdB, int linkIndexA, int linkIndexB, int enableCollision);
|
||||
B3_SHARED_API void b3SetCollisionFilterGroupMask(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueIdA,
|
||||
int linkIndexA, int collisionFilterGroup, int collisionFilterMask);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadSdfCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadSdfCommandInit2(b3SharedMemoryCommandHandle commandHandle, const char* sdfFileName);
|
||||
|
||||
B3_SHARED_API int b3LoadSdfCommandSetUseMultiBody(b3SharedMemoryCommandHandle commandHandle, int useMultiBody);
|
||||
B3_SHARED_API int b3LoadSdfCommandSetUseGlobalScaling(b3SharedMemoryCommandHandle commandHandle, double globalScaling);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3SaveWorldCommandInit(b3PhysicsClientHandle physClient, const char* sdfFileName);
|
||||
|
||||
///The b3JointControlCommandInit method is obsolete, use b3JointControlCommandInit2 instead
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit(b3PhysicsClientHandle physClient, int controlMode);
|
||||
|
||||
///Set joint motor control variables such as desired position/angle, desired velocity,
|
||||
///applied joint forces, dependent on the control mode (CONTROL_MODE_VELOCITY or CONTROL_MODE_TORQUE)
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit2(b3PhysicsClientHandle physClient, int bodyUniqueId, int controlMode);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3JointControlCommandInit2Internal(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int controlMode);
|
||||
|
||||
///Only use when controlMode is CONTROL_MODE_POSITION_VELOCITY_PD
|
||||
B3_SHARED_API int b3JointControlSetDesiredPosition(b3SharedMemoryCommandHandle commandHandle, int qIndex, double value);
|
||||
B3_SHARED_API int b3JointControlSetDesiredPositionMultiDof(b3SharedMemoryCommandHandle commandHandle, int qIndex, const double* position, int dofCount);
|
||||
|
||||
B3_SHARED_API int b3JointControlSetKp(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
|
||||
B3_SHARED_API int b3JointControlSetKpMultiDof(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double* kps, int dofCount);
|
||||
B3_SHARED_API int b3JointControlSetKd(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
|
||||
B3_SHARED_API int b3JointControlSetKdMultiDof(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double* kds, int dofCount);
|
||||
B3_SHARED_API int b3JointControlSetMaximumVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double maximumVelocity);
|
||||
|
||||
///Only use when controlMode is CONTROL_MODE_VELOCITY
|
||||
B3_SHARED_API int b3JointControlSetDesiredVelocity(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value); /* find a better name for dof/q/u indices, point to b3JointInfo */
|
||||
B3_SHARED_API int b3JointControlSetDesiredVelocityMultiDof(b3SharedMemoryCommandHandle commandHandle, int dofIndex, const double* velocity, int dofCount);
|
||||
B3_SHARED_API int b3JointControlSetDesiredVelocityMultiDof2(b3SharedMemoryCommandHandle commandHandle, int dofIndex, const double* velocity, int dofCount);
|
||||
|
||||
B3_SHARED_API int b3JointControlSetMaximumForce(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
|
||||
B3_SHARED_API int b3JointControlSetDesiredForceTorqueMultiDof(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double* forces, int dofCount);
|
||||
B3_SHARED_API int b3JointControlSetDamping(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
|
||||
B3_SHARED_API int b3JointControlSetDampingMultiDof(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double* damping, int dofCount);
|
||||
|
||||
///Only use if when controlMode is CONTROL_MODE_TORQUE,
|
||||
B3_SHARED_API int b3JointControlSetDesiredForceTorque(b3SharedMemoryCommandHandle commandHandle, int dofIndex, double value);
|
||||
|
||||
///the creation of collision shapes and rigid bodies etc is likely going to change,
|
||||
///but good to have a b3CreateBoxShapeCommandInit for now
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateCollisionShapeCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddSphere(b3SharedMemoryCommandHandle commandHandle, double radius);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddBox(b3SharedMemoryCommandHandle commandHandle, const double halfExtents[/*3*/]);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle, double radius, double height);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle, double radius, double height);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddHeightfield(b3SharedMemoryCommandHandle commandHandle, const char* fileName, const double meshScale[/*3*/], double textureScaling);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddHeightfield2(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double meshScale[/*3*/], double textureScaling, float* heightfieldData, int numHeightfieldRows, int numHeightfieldColumns, int replaceHeightfieldIndex);
|
||||
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, const double planeNormal[/*3*/], double planeConstant);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddMesh(b3SharedMemoryCommandHandle commandHandle, const char* fileName, const double meshScale[/*3*/]);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddConvexMesh(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double meshScale[/*3*/], const double* vertices, int numVertices);
|
||||
B3_SHARED_API int b3CreateCollisionShapeAddConcaveMesh(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double meshScale[/*3*/], const double* vertices, int numVertices, const int* indices, int numIndices);
|
||||
B3_SHARED_API void b3CreateCollisionSetFlag(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, int flags);
|
||||
B3_SHARED_API void b3CreateCollisionShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, const double childPosition[/*3*/], const double childOrientation[/*4*/]);
|
||||
B3_SHARED_API int b3GetStatusCollisionShapeUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitRemoveCollisionShapeCommand(b3PhysicsClientHandle physClient, int collisionShapeId);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3GetMeshDataCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int linkIndex);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3GetTetraMeshDataCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API void b3GetMeshDataSimulationMesh(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3MeshDataSimulationMeshVelocity(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3GetMeshDataSetCollisionShapeIndex(b3SharedMemoryCommandHandle commandHandle, int shapeIndex);
|
||||
B3_SHARED_API void b3GetMeshDataSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
B3_SHARED_API void b3GetTetraMeshDataSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
B3_SHARED_API void b3GetMeshData(b3PhysicsClientHandle physClient, struct b3MeshData* meshData);
|
||||
B3_SHARED_API void b3GetTetraMeshData(b3PhysicsClientHandle physClient, struct b3TetraMeshData* meshData);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3ResetMeshDataCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId, int num_vertices, const double* vertices);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateVisualShapeCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddSphere(b3SharedMemoryCommandHandle commandHandle, double radius);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddBox(b3SharedMemoryCommandHandle commandHandle, const double halfExtents[/*3*/]);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddCapsule(b3SharedMemoryCommandHandle commandHandle, double radius, double height);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddCylinder(b3SharedMemoryCommandHandle commandHandle, double radius, double height);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddPlane(b3SharedMemoryCommandHandle commandHandle, const double planeNormal[/*3*/], double planeConstant);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddMesh(b3SharedMemoryCommandHandle commandHandle, const char* fileName, const double meshScale[/*3*/]);
|
||||
B3_SHARED_API int b3CreateVisualShapeAddMesh2(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double meshScale[/*3*/], const double* vertices, int numVertices, const int* indices, int numIndices, const double* normals, int numNormals, const double* uvs, int numUVs);
|
||||
|
||||
|
||||
B3_SHARED_API void b3CreateVisualSetFlag(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, int flags);
|
||||
B3_SHARED_API void b3CreateVisualShapeSetChildTransform(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, const double childPosition[/*3*/], const double childOrientation[/*4*/]);
|
||||
B3_SHARED_API void b3CreateVisualShapeSetSpecularColor(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, const double specularColor[/*3*/]);
|
||||
B3_SHARED_API void b3CreateVisualShapeSetRGBAColor(b3SharedMemoryCommandHandle commandHandle, int shapeIndex, const double rgbaColor[/*4*/]);
|
||||
|
||||
B3_SHARED_API int b3GetStatusVisualShapeUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateMultiBodyCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3CreateMultiBodyBase(b3SharedMemoryCommandHandle commandHandle, double mass, int collisionShapeUnique, int visualShapeUniqueId, const double basePosition[/*3*/], const double baseOrientation[/*4*/], const double baseInertialFramePosition[/*3*/], const double baseInertialFrameOrientation[/*4*/]);
|
||||
|
||||
B3_SHARED_API int b3CreateMultiBodyLink(b3SharedMemoryCommandHandle commandHandle, double linkMass, double linkCollisionShapeIndex,
|
||||
double linkVisualShapeIndex,
|
||||
const double linkPosition[/*3*/],
|
||||
const double linkOrientation[/*4*/],
|
||||
const double linkInertialFramePosition[/*3*/],
|
||||
const double linkInertialFrameOrientation[/*4*/],
|
||||
int linkParentIndex,
|
||||
int linkJointType,
|
||||
const double linkJointAxis[/*3*/]);
|
||||
|
||||
//batch creation is an performance feature to create a large number of multi bodies in one command
|
||||
B3_SHARED_API int b3CreateMultiBodySetBatchPositions(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, double* batchPositions, int numBatchObjects);
|
||||
|
||||
//useMaximalCoordinates are disabled by default, enabling them is experimental and not fully supported yet
|
||||
B3_SHARED_API void b3CreateMultiBodyUseMaximalCoordinates(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3CreateMultiBodySetFlags(b3SharedMemoryCommandHandle commandHandle, int flags);
|
||||
|
||||
//int b3CreateMultiBodyAddLink(b3SharedMemoryCommandHandle commandHandle, int jointType, int parentLinkIndex, double linkMass, int linkCollisionShapeUnique, int linkVisualShapeUniqueId);
|
||||
|
||||
///create a box of size (1,1,1) at world origin (0,0,0) at orientation quat (0,0,0,1)
|
||||
///after that, you can optionally adjust the initial position, orientation and size
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateBoxShapeCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX, double startPosY, double startPosZ);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetHalfExtents(b3SharedMemoryCommandHandle commandHandle, double halfExtentsX, double halfExtentsY, double halfExtentsZ);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetMass(b3SharedMemoryCommandHandle commandHandle, double mass);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetCollisionShapeType(b3SharedMemoryCommandHandle commandHandle, int collisionShapeType);
|
||||
B3_SHARED_API int b3CreateBoxCommandSetColorRGBA(b3SharedMemoryCommandHandle commandHandle, double red, double green, double blue, double alpha);
|
||||
|
||||
///b3CreatePoseCommandInit will initialize (teleport) the pose of a body/robot. You can individually set the base position,
|
||||
///base orientation and joint angles. This will set all velocities of base and joints to zero.
|
||||
///This is not a robot control command using actuators/joint motors, but manual repositioning the robot.
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreatePoseCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreatePoseCommandInit2(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId);
|
||||
|
||||
B3_SHARED_API int b3CreatePoseCommandSetBasePosition(b3SharedMemoryCommandHandle commandHandle, double startPosX, double startPosY, double startPosZ);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetBaseOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetBaseLinearVelocity(b3SharedMemoryCommandHandle commandHandle, const double linVel[/*3*/]);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetBaseAngularVelocity(b3SharedMemoryCommandHandle commandHandle, const double angVel[/*3*/]);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetBaseScaling(b3SharedMemoryCommandHandle commandHandle, double scaling[/* 3*/]);
|
||||
|
||||
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointPositions(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* jointPositions);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointPosition(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointPosition);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointPositionMultiDof(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, const double* jointPosition, int posSize);
|
||||
|
||||
B3_SHARED_API int b3CreatePoseCommandSetQ(b3SharedMemoryCommandHandle commandHandle, int numJointPositions, const double* q, const int* hasQ);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetQdots(b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* qDots, const int* hasQdots);
|
||||
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointVelocities(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int numJointVelocities, const double* jointVelocities);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointVelocity(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, double jointVelocity);
|
||||
B3_SHARED_API int b3CreatePoseCommandSetJointVelocityMultiDof(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, int jointIndex, const double* jointVelocity, int velSize);
|
||||
|
||||
///We are currently not reading the sensor information from the URDF file, and programmatically assign sensors.
|
||||
///This is rather inconsistent, to mix programmatical creation with loading from file.
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateSensorCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API int b3CreateSensorEnable6DofJointForceTorqueSensor(b3SharedMemoryCommandHandle commandHandle, int jointIndex, int enable);
|
||||
///b3CreateSensorEnableIMUForLink is not implemented yet.
|
||||
///For now, if the IMU is located in the root link, use the root world transform to mimic an IMU.
|
||||
B3_SHARED_API int b3CreateSensorEnableIMUForLink(b3SharedMemoryCommandHandle commandHandle, int linkIndex, int enable);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestActualStateCommandInit(b3PhysicsClientHandle physClient, int bodyUniqueId);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestActualStateCommandInit2(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId);
|
||||
|
||||
B3_SHARED_API int b3RequestActualStateCommandComputeLinkVelocity(b3SharedMemoryCommandHandle commandHandle, int computeLinkVelocity);
|
||||
B3_SHARED_API int b3RequestActualStateCommandComputeForwardKinematics(b3SharedMemoryCommandHandle commandHandle, int computeForwardKinematics);
|
||||
|
||||
B3_SHARED_API int b3GetJointState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState* state);
|
||||
B3_SHARED_API int b3GetJointStateMultiDof(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int jointIndex, struct b3JointSensorState2* state);
|
||||
B3_SHARED_API int b3GetLinkState(b3PhysicsClientHandle physClient, b3SharedMemoryStatusHandle statusHandle, int linkIndex, struct b3LinkState* state);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3PickBody(b3PhysicsClientHandle physClient, double rayFromWorldX,
|
||||
double rayFromWorldY, double rayFromWorldZ,
|
||||
double rayToWorldX, double rayToWorldY, double rayToWorldZ);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3MovePickedBody(b3PhysicsClientHandle physClient, double rayFromWorldX,
|
||||
double rayFromWorldY, double rayFromWorldZ,
|
||||
double rayToWorldX, double rayToWorldY,
|
||||
double rayToWorldZ);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RemovePickingConstraint(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastCommandInit(b3PhysicsClientHandle physClient, double rayFromWorldX,
|
||||
double rayFromWorldY, double rayFromWorldZ,
|
||||
double rayToWorldX, double rayToWorldY, double rayToWorldZ);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3CreateRaycastBatchCommandInit(b3PhysicsClientHandle physClient);
|
||||
// Sets the number of threads to use to compute the ray intersections for the batch. Specify 0 to let Bullet decide, 1 (default) for single core execution, 2 or more to select the number of threads to use.
|
||||
B3_SHARED_API void b3RaycastBatchSetNumThreads(b3SharedMemoryCommandHandle commandHandle, int numThreads);
|
||||
//max num rays for b3RaycastBatchAddRay is MAX_RAY_INTERSECTION_BATCH_SIZE
|
||||
B3_SHARED_API void b3RaycastBatchAddRay(b3SharedMemoryCommandHandle commandHandle, const double rayFromWorld[/*3*/], const double rayToWorld[/*3*/]);
|
||||
//max num rays for b3RaycastBatchAddRays is MAX_RAY_INTERSECTION_BATCH_SIZE_STREAMING
|
||||
B3_SHARED_API void b3RaycastBatchAddRays(b3PhysicsClientHandle physClient, b3SharedMemoryCommandHandle commandHandle, const double* rayFromWorld, const double* rayToWorld, int numRays);
|
||||
B3_SHARED_API void b3RaycastBatchSetParentObject(b3SharedMemoryCommandHandle commandHandle, int parentObjectUniqueId, int parentLinkIndex);
|
||||
B3_SHARED_API void b3RaycastBatchSetReportHitNumber(b3SharedMemoryCommandHandle commandHandle, int reportHitNumber);
|
||||
B3_SHARED_API void b3RaycastBatchSetCollisionFilterMask(b3SharedMemoryCommandHandle commandHandle, int collisionFilterMask);
|
||||
B3_SHARED_API void b3RaycastBatchSetFractionEpsilon(b3SharedMemoryCommandHandle commandHandle, double fractionEpsilon);
|
||||
|
||||
B3_SHARED_API void b3GetRaycastInformation(b3PhysicsClientHandle physClient, struct b3RaycastInformation* raycastInfo);
|
||||
|
||||
/// Apply external force at the body (or link) center of mass, in world space/Cartesian coordinates.
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3ApplyExternalForceCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3ApplyExternalForce(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double force[/*3*/], const double position[/*3*/], int flag);
|
||||
B3_SHARED_API void b3ApplyExternalTorque(b3SharedMemoryCommandHandle commandHandle, int bodyUniqueId, int linkId, const double torque[/*3*/], int flag);
|
||||
|
||||
///experiments of robots interacting with non-rigid objects (such as btSoftBody)
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3LoadSoftBodyCommandInit(b3PhysicsClientHandle physClient, const char* fileName);
|
||||
B3_SHARED_API int b3LoadSoftBodySetScale(b3SharedMemoryCommandHandle commandHandle, double scale);
|
||||
B3_SHARED_API int b3LoadSoftBodySetMass(b3SharedMemoryCommandHandle commandHandle, double mass);
|
||||
B3_SHARED_API int b3LoadSoftBodySetCollisionMargin(b3SharedMemoryCommandHandle commandHandle, double collisionMargin);
|
||||
B3_SHARED_API int b3LoadSoftBodySetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX, double startPosY, double startPosZ);
|
||||
B3_SHARED_API int b3LoadSoftBodySetStartOrientation(b3SharedMemoryCommandHandle commandHandle, double startOrnX, double startOrnY, double startOrnZ, double startOrnW);
|
||||
B3_SHARED_API int b3LoadSoftBodyUpdateSimMesh(b3SharedMemoryCommandHandle commandHandle, const char* filename);
|
||||
B3_SHARED_API int b3LoadSoftBodyAddCorotatedForce(b3SharedMemoryCommandHandle commandHandle, double corotatedMu, double corotatedLambda);
|
||||
B3_SHARED_API int b3LoadSoftBodyAddCorotatedForce(b3SharedMemoryCommandHandle commandHandle, double corotatedMu, double corotatedLambda);
|
||||
B3_SHARED_API int b3LoadSoftBodyAddNeoHookeanForce(b3SharedMemoryCommandHandle commandHandle, double NeoHookeanMu, double NeoHookeanLambda, double NeoHookeanDamping);
|
||||
B3_SHARED_API int b3LoadSoftBodyAddMassSpringForce(b3SharedMemoryCommandHandle commandHandle, double springElasticStiffness , double springDampingStiffness);
|
||||
B3_SHARED_API int b3LoadSoftBodyAddGravityForce(b3SharedMemoryCommandHandle commandHandle, double gravityX, double gravityY, double gravityZ);
|
||||
B3_SHARED_API int b3LoadSoftBodySetCollisionHardness(b3SharedMemoryCommandHandle commandHandle, double collisionHardness);
|
||||
B3_SHARED_API int b3LoadSoftBodySetSelfCollision(b3SharedMemoryCommandHandle commandHandle, int useSelfCollision);
|
||||
B3_SHARED_API int b3LoadSoftBodySetRepulsionStiffness(b3SharedMemoryCommandHandle commandHandle, double stiffness);
|
||||
B3_SHARED_API int b3LoadSoftBodyUseFaceContact(b3SharedMemoryCommandHandle commandHandle, int useFaceContact);
|
||||
B3_SHARED_API int b3LoadSoftBodySetFrictionCoefficient(b3SharedMemoryCommandHandle commandHandle, double frictionCoefficient);
|
||||
B3_SHARED_API int b3LoadSoftBodyUseBendingSprings(b3SharedMemoryCommandHandle commandHandle, int useBendingSprings, double bendingStiffness);
|
||||
B3_SHARED_API int b3LoadSoftBodyUseAllDirectionDampingSprings(b3SharedMemoryCommandHandle commandHandle, int useAllDirectionDamping);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3InitCreateSoftBodyAnchorConstraintCommand(b3PhysicsClientHandle physClient, int softBodyUniqueId, int nodeIndex, int bodyUniqueId, int linkIndex, const double bodyFramePosition[3]);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestVREventsCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3VREventsSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter);
|
||||
|
||||
B3_SHARED_API void b3GetVREventsData(b3PhysicsClientHandle physClient, struct b3VREventsData* vrEventsData);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3SetVRCameraStateCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3SetVRCameraRootPosition(b3SharedMemoryCommandHandle commandHandle, const double rootPos[/*3*/]);
|
||||
B3_SHARED_API int b3SetVRCameraRootOrientation(b3SharedMemoryCommandHandle commandHandle, const double rootOrn[/*4*/]);
|
||||
B3_SHARED_API int b3SetVRCameraTrackingObject(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId);
|
||||
B3_SHARED_API int b3SetVRCameraTrackingObjectFlag(b3SharedMemoryCommandHandle commandHandle, int flag);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestKeyboardEventsCommandInit2(b3SharedMemoryCommandHandle commandHandle);
|
||||
B3_SHARED_API void b3GetKeyboardEventsData(b3PhysicsClientHandle physClient, struct b3KeyboardEventsData* keyboardEventsData);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3RequestMouseEventsCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API void b3GetMouseEventsData(b3PhysicsClientHandle physClient, struct b3MouseEventsData* mouseEventsData);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3StateLoggingCommandInit(b3PhysicsClientHandle physClient);
|
||||
B3_SHARED_API int b3StateLoggingStart(b3SharedMemoryCommandHandle commandHandle, int loggingType, const char* fileName);
|
||||
B3_SHARED_API int b3StateLoggingAddLoggingObjectUniqueId(b3SharedMemoryCommandHandle commandHandle, int objectUniqueId);
|
||||
B3_SHARED_API int b3StateLoggingSetMaxLogDof(b3SharedMemoryCommandHandle commandHandle, int maxLogDof);
|
||||
B3_SHARED_API int b3StateLoggingSetLinkIndexA(b3SharedMemoryCommandHandle commandHandle, int linkIndexA);
|
||||
B3_SHARED_API int b3StateLoggingSetLinkIndexB(b3SharedMemoryCommandHandle commandHandle, int linkIndexB);
|
||||
B3_SHARED_API int b3StateLoggingSetBodyAUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyAUniqueId);
|
||||
B3_SHARED_API int b3StateLoggingSetBodyBUniqueId(b3SharedMemoryCommandHandle commandHandle, int bodyBUniqueId);
|
||||
B3_SHARED_API int b3StateLoggingSetDeviceTypeFilter(b3SharedMemoryCommandHandle commandHandle, int deviceTypeFilter);
|
||||
B3_SHARED_API int b3StateLoggingSetLogFlags(b3SharedMemoryCommandHandle commandHandle, int logFlags);
|
||||
|
||||
B3_SHARED_API int b3GetStatusLoggingUniqueId(b3SharedMemoryStatusHandle statusHandle);
|
||||
B3_SHARED_API int b3StateLoggingStop(b3SharedMemoryCommandHandle commandHandle, int loggingUid);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsClientHandle physClient, const char* name);
|
||||
B3_SHARED_API void b3SetProfileTimingDuractionInMicroSeconds(b3SharedMemoryCommandHandle commandHandle, int duration);
|
||||
B3_SHARED_API void b3SetProfileTimingType(b3SharedMemoryCommandHandle commandHandle, int type);
|
||||
|
||||
B3_SHARED_API void b3PushProfileTiming(b3PhysicsClientHandle physClient, const char* timingName);
|
||||
B3_SHARED_API void b3PopProfileTiming(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API void b3SetTimeOut(b3PhysicsClientHandle physClient, double timeOutInSeconds);
|
||||
B3_SHARED_API double b3GetTimeOut(b3PhysicsClientHandle physClient);
|
||||
|
||||
B3_SHARED_API b3SharedMemoryCommandHandle b3SetAdditionalSearchPath(b3PhysicsClientHandle physClient, const char* path);
|
||||
|
||||
B3_SHARED_API void b3MultiplyTransforms(const double posA[/*3*/], const double ornA[/*4*/], const double posB[/*3*/], const double ornB[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]);
|
||||
B3_SHARED_API void b3InvertTransform(const double pos[/*3*/], const double orn[/*4*/], double outPos[/*3*/], double outOrn[/*4*/]);
|
||||
B3_SHARED_API void b3QuaternionSlerp(const double startQuat[/*4*/], const double endQuat[/*4*/], double interpolationFraction, double outOrn[/*4*/]);
|
||||
B3_SHARED_API void b3GetQuaternionFromAxisAngle(const double axis[/*3*/], double angle, double outQuat[/*4*/]);
|
||||
B3_SHARED_API void b3GetAxisAngleFromQuaternion(const double quat[/*4*/], double axis[/*3*/], double* angle);
|
||||
B3_SHARED_API void b3GetQuaternionDifference(const double startQuat[/*4*/], const double endQuat[/*4*/], double outOrn[/*4*/]);
|
||||
B3_SHARED_API void b3GetAxisDifferenceQuaternion(const double startQuat[/*4*/], const double endQuat[/*4*/], double axisOut[/*3*/]);
|
||||
B3_SHARED_API void b3CalculateVelocityQuaternion(const double startQuat[/*4*/], const double endQuat[/*4*/], double deltaTime, double angVelOut[/*3*/]);
|
||||
B3_SHARED_API void b3RotateVector(const double quat[/*4*/], const double vec[/*3*/], double vecOut[/*3*/]);
|
||||
|
||||
#ifdef BT_ENABLE_VHACD
|
||||
B3_SHARED_API void b3VHACD(const char* fileNameInput, const char* fileNameOutput, const char* fileNameLogging,
|
||||
double concavity, double alpha, double beta, double gamma, double minVolumePerCH, int resolution,
|
||||
int maxNumVerticesPerCH, int depth, int planeDownsampling, int convexhullDownsampling,
|
||||
int pca, int mode, int convexhullApproximation);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PHYSICS_CLIENT_C_API_H
|
17
csbindgen-tests/c/bullet3/PhysicsClientSharedMemory2_C_API.h
Normal file
17
csbindgen-tests/c/bullet3/PhysicsClientSharedMemory2_C_API.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef PHYSICS_CLIENT_SHARED_MEMORY2_H
|
||||
#define PHYSICS_CLIENT_SHARED_MEMORY2_H
|
||||
|
||||
#include "PhysicsClientC_API.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
b3PhysicsClientHandle b3ConnectSharedMemory2(int key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PHYSICS_CLIENT_SHARED_MEMORY2_H
|
17
csbindgen-tests/c/bullet3/PhysicsClientSharedMemory_C_API.h
Normal file
17
csbindgen-tests/c/bullet3/PhysicsClientSharedMemory_C_API.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef PHYSICS_CLIENT_SHARED_MEMORY_H
|
||||
#define PHYSICS_CLIENT_SHARED_MEMORY_H
|
||||
|
||||
#include "PhysicsClientC_API.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
B3_SHARED_API b3PhysicsClientHandle b3ConnectSharedMemory(int key);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PHYSICS_CLIENT_SHARED_MEMORY_H
|
18
csbindgen-tests/c/bullet3/PhysicsDirectC_API.h
Normal file
18
csbindgen-tests/c/bullet3/PhysicsDirectC_API.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef PHYSICS_DIRECT_C_API_H
|
||||
#define PHYSICS_DIRECT_C_API_H
|
||||
|
||||
#include "PhysicsClientC_API.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
///think more about naming. Directly execute commands without transport (no shared memory, UDP, socket, grpc etc)
|
||||
B3_SHARED_API b3PhysicsClientHandle b3ConnectPhysicsDirect();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //PHYSICS_DIRECT_C_API_H
|
1137
csbindgen-tests/c/bullet3/SharedMemoryPublic.h
Normal file
1137
csbindgen-tests/c/bullet3/SharedMemoryPublic.h
Normal file
File diff suppressed because it is too large
Load Diff
949
csbindgen-tests/c/quiche/quiche.h
Normal file
949
csbindgen-tests/c/quiche/quiche.h
Normal file
@ -0,0 +1,949 @@
|
||||
// Copyright (C) 2018-2019, Cloudflare, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright
|
||||
// notice, this list of conditions and the following disclaimer.
|
||||
//
|
||||
// * Redistributions in binary form must reproduce the above copyright
|
||||
// notice, this list of conditions and the following disclaimer in the
|
||||
// documentation and/or other materials provided with the distribution.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#ifndef QUICHE_H
|
||||
#define QUICHE_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#ifdef __unix__
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef _MSC_VER
|
||||
#include <BaseTsd.h>
|
||||
#define ssize_t SSIZE_T
|
||||
#endif
|
||||
|
||||
// QUIC transport API.
|
||||
//
|
||||
|
||||
// The current QUIC wire version.
|
||||
#define QUICHE_PROTOCOL_VERSION 0x00000001
|
||||
|
||||
// The maximum length of a connection ID.
|
||||
#define QUICHE_MAX_CONN_ID_LEN 20
|
||||
|
||||
// The minimum length of Initial packets sent by a client.
|
||||
#define QUICHE_MIN_CLIENT_INITIAL_LEN 1200
|
||||
|
||||
enum quiche_error {
|
||||
// There is no more work to do.
|
||||
QUICHE_ERR_DONE = -1,
|
||||
|
||||
// The provided buffer is too short.
|
||||
QUICHE_ERR_BUFFER_TOO_SHORT = -2,
|
||||
|
||||
// The provided packet cannot be parsed because its version is unknown.
|
||||
QUICHE_ERR_UNKNOWN_VERSION = -3,
|
||||
|
||||
// The provided packet cannot be parsed because it contains an invalid
|
||||
// frame.
|
||||
QUICHE_ERR_INVALID_FRAME = -4,
|
||||
|
||||
// The provided packet cannot be parsed.
|
||||
QUICHE_ERR_INVALID_PACKET = -5,
|
||||
|
||||
// The operation cannot be completed because the connection is in an
|
||||
// invalid state.
|
||||
QUICHE_ERR_INVALID_STATE = -6,
|
||||
|
||||
// The operation cannot be completed because the stream is in an
|
||||
// invalid state.
|
||||
QUICHE_ERR_INVALID_STREAM_STATE = -7,
|
||||
|
||||
// The peer's transport params cannot be parsed.
|
||||
QUICHE_ERR_INVALID_TRANSPORT_PARAM = -8,
|
||||
|
||||
// A cryptographic operation failed.
|
||||
QUICHE_ERR_CRYPTO_FAIL = -9,
|
||||
|
||||
// The TLS handshake failed.
|
||||
QUICHE_ERR_TLS_FAIL = -10,
|
||||
|
||||
// The peer violated the local flow control limits.
|
||||
QUICHE_ERR_FLOW_CONTROL = -11,
|
||||
|
||||
// The peer violated the local stream limits.
|
||||
QUICHE_ERR_STREAM_LIMIT = -12,
|
||||
|
||||
// The specified stream was stopped by the peer.
|
||||
QUICHE_ERR_STREAM_STOPPED = -15,
|
||||
|
||||
// The specified stream was reset by the peer.
|
||||
QUICHE_ERR_STREAM_RESET = -16,
|
||||
|
||||
// The received data exceeds the stream's final size.
|
||||
QUICHE_ERR_FINAL_SIZE = -13,
|
||||
|
||||
// Error in congestion control.
|
||||
QUICHE_ERR_CONGESTION_CONTROL = -14,
|
||||
};
|
||||
|
||||
// Returns a human readable string with the quiche version number.
|
||||
const char *quiche_version(void);
|
||||
|
||||
// Enables logging. |cb| will be called with log messages
|
||||
int quiche_enable_debug_logging(void (*cb)(const char *line, void *argp),
|
||||
void *argp);
|
||||
|
||||
// Stores configuration shared between multiple connections.
|
||||
typedef struct quiche_config quiche_config;
|
||||
|
||||
// Creates a config object with the given version.
|
||||
quiche_config *quiche_config_new(uint32_t version);
|
||||
|
||||
// Configures the given certificate chain.
|
||||
int quiche_config_load_cert_chain_from_pem_file(quiche_config *config,
|
||||
const char *path);
|
||||
|
||||
// Configures the given private key.
|
||||
int quiche_config_load_priv_key_from_pem_file(quiche_config *config,
|
||||
const char *path);
|
||||
|
||||
// Specifies a file where trusted CA certificates are stored for the purposes of certificate verification.
|
||||
int quiche_config_load_verify_locations_from_file(quiche_config *config,
|
||||
const char *path);
|
||||
|
||||
// Specifies a directory where trusted CA certificates are stored for the purposes of certificate verification.
|
||||
int quiche_config_load_verify_locations_from_directory(quiche_config *config,
|
||||
const char *path);
|
||||
|
||||
// Configures whether to verify the peer's certificate.
|
||||
void quiche_config_verify_peer(quiche_config *config, bool v);
|
||||
|
||||
// Configures whether to send GREASE.
|
||||
void quiche_config_grease(quiche_config *config, bool v);
|
||||
|
||||
// Enables logging of secrets.
|
||||
void quiche_config_log_keys(quiche_config *config);
|
||||
|
||||
// Enables sending or receiving early data.
|
||||
void quiche_config_enable_early_data(quiche_config *config);
|
||||
|
||||
// Configures the list of supported application protocols.
|
||||
int quiche_config_set_application_protos(quiche_config *config,
|
||||
const uint8_t *protos,
|
||||
size_t protos_len);
|
||||
|
||||
// Sets the `max_idle_timeout` transport parameter, in milliseconds, default is
|
||||
// no timeout.
|
||||
void quiche_config_set_max_idle_timeout(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `max_udp_payload_size transport` parameter.
|
||||
void quiche_config_set_max_recv_udp_payload_size(quiche_config *config, size_t v);
|
||||
|
||||
// Sets the maximum outgoing UDP payload size.
|
||||
void quiche_config_set_max_send_udp_payload_size(quiche_config *config, size_t v);
|
||||
|
||||
// Sets the `initial_max_data` transport parameter.
|
||||
void quiche_config_set_initial_max_data(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `initial_max_stream_data_bidi_local` transport parameter.
|
||||
void quiche_config_set_initial_max_stream_data_bidi_local(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `initial_max_stream_data_bidi_remote` transport parameter.
|
||||
void quiche_config_set_initial_max_stream_data_bidi_remote(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `initial_max_stream_data_uni` transport parameter.
|
||||
void quiche_config_set_initial_max_stream_data_uni(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `initial_max_streams_bidi` transport parameter.
|
||||
void quiche_config_set_initial_max_streams_bidi(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `initial_max_streams_uni` transport parameter.
|
||||
void quiche_config_set_initial_max_streams_uni(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `ack_delay_exponent` transport parameter.
|
||||
void quiche_config_set_ack_delay_exponent(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `max_ack_delay` transport parameter.
|
||||
void quiche_config_set_max_ack_delay(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the `disable_active_migration` transport parameter.
|
||||
void quiche_config_set_disable_active_migration(quiche_config *config, bool v);
|
||||
|
||||
enum quiche_cc_algorithm {
|
||||
QUICHE_CC_RENO = 0,
|
||||
QUICHE_CC_CUBIC = 1,
|
||||
QUICHE_CC_BBR = 2,
|
||||
};
|
||||
|
||||
// Sets the congestion control algorithm used.
|
||||
void quiche_config_set_cc_algorithm(quiche_config *config, enum quiche_cc_algorithm algo);
|
||||
|
||||
// Configures whether to use HyStart++.
|
||||
void quiche_config_enable_hystart(quiche_config *config, bool v);
|
||||
|
||||
// Configures whether to enable pacing (enabled by default).
|
||||
void quiche_config_enable_pacing(quiche_config *config, bool v);
|
||||
|
||||
// Configures whether to enable receiving DATAGRAM frames.
|
||||
void quiche_config_enable_dgram(quiche_config *config, bool enabled,
|
||||
size_t recv_queue_len,
|
||||
size_t send_queue_len);
|
||||
|
||||
// Sets the maximum connection window.
|
||||
void quiche_config_set_max_connection_window(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the maximum stream window.
|
||||
void quiche_config_set_max_stream_window(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the limit of active connection IDs.
|
||||
void quiche_config_set_active_connection_id_limit(quiche_config *config, uint64_t v);
|
||||
|
||||
// Sets the initial stateless reset token. |v| must contain 16 bytes, otherwise the behaviour is undefined.
|
||||
void quiche_config_set_stateless_reset_token(quiche_config *config, const uint8_t *v);
|
||||
|
||||
// Frees the config object.
|
||||
void quiche_config_free(quiche_config *config);
|
||||
|
||||
// Extracts version, type, source / destination connection ID and address
|
||||
// verification token from the packet in |buf|.
|
||||
int quiche_header_info(const uint8_t *buf, size_t buf_len, size_t dcil,
|
||||
uint32_t *version, uint8_t *type,
|
||||
uint8_t *scid, size_t *scid_len,
|
||||
uint8_t *dcid, size_t *dcid_len,
|
||||
uint8_t *token, size_t *token_len);
|
||||
|
||||
// A QUIC connection.
|
||||
typedef struct quiche_conn quiche_conn;
|
||||
|
||||
// Creates a new server-side connection.
|
||||
quiche_conn *quiche_accept(const uint8_t *scid, size_t scid_len,
|
||||
const uint8_t *odcid, size_t odcid_len,
|
||||
const struct sockaddr *local, size_t local_len,
|
||||
const struct sockaddr *peer, size_t peer_len,
|
||||
quiche_config *config);
|
||||
|
||||
// Creates a new client-side connection.
|
||||
quiche_conn *quiche_connect(const char *server_name,
|
||||
const uint8_t *scid, size_t scid_len,
|
||||
const struct sockaddr *local, size_t local_len,
|
||||
const struct sockaddr *peer, size_t peer_len,
|
||||
quiche_config *config);
|
||||
|
||||
// Writes a version negotiation packet.
|
||||
ssize_t quiche_negotiate_version(const uint8_t *scid, size_t scid_len,
|
||||
const uint8_t *dcid, size_t dcid_len,
|
||||
uint8_t *out, size_t out_len);
|
||||
|
||||
// Writes a retry packet.
|
||||
ssize_t quiche_retry(const uint8_t *scid, size_t scid_len,
|
||||
const uint8_t *dcid, size_t dcid_len,
|
||||
const uint8_t *new_scid, size_t new_scid_len,
|
||||
const uint8_t *token, size_t token_len,
|
||||
uint32_t version, uint8_t *out, size_t out_len);
|
||||
|
||||
// Returns true if the given protocol version is supported.
|
||||
bool quiche_version_is_supported(uint32_t version);
|
||||
|
||||
quiche_conn *quiche_conn_new_with_tls(const uint8_t *scid, size_t scid_len,
|
||||
const uint8_t *odcid, size_t odcid_len,
|
||||
const struct sockaddr *local, size_t local_len,
|
||||
const struct sockaddr *peer, size_t peer_len,
|
||||
quiche_config *config, void *ssl,
|
||||
bool is_server);
|
||||
|
||||
// Enables keylog to the specified file path. Returns true on success.
|
||||
bool quiche_conn_set_keylog_path(quiche_conn *conn, const char *path);
|
||||
|
||||
// Enables keylog to the specified file descriptor. Unix only.
|
||||
void quiche_conn_set_keylog_fd(quiche_conn *conn, int fd);
|
||||
|
||||
// Enables qlog to the specified file path. Returns true on success.
|
||||
bool quiche_conn_set_qlog_path(quiche_conn *conn, const char *path,
|
||||
const char *log_title, const char *log_desc);
|
||||
|
||||
// Enables qlog to the specified file descriptor. Unix only.
|
||||
void quiche_conn_set_qlog_fd(quiche_conn *conn, int fd, const char *log_title,
|
||||
const char *log_desc);
|
||||
|
||||
// Configures the given session for resumption.
|
||||
int quiche_conn_set_session(quiche_conn *conn, const uint8_t *buf, size_t buf_len);
|
||||
|
||||
typedef struct {
|
||||
// The remote address the packet was received from.
|
||||
struct sockaddr *from;
|
||||
socklen_t from_len;
|
||||
|
||||
// The local address the packet was received on.
|
||||
struct sockaddr *to;
|
||||
socklen_t to_len;
|
||||
} quiche_recv_info;
|
||||
|
||||
// Processes QUIC packets received from the peer.
|
||||
ssize_t quiche_conn_recv(quiche_conn *conn, uint8_t *buf, size_t buf_len,
|
||||
const quiche_recv_info *info);
|
||||
|
||||
typedef struct {
|
||||
// The local address the packet should be sent from.
|
||||
struct sockaddr_storage from;
|
||||
socklen_t from_len;
|
||||
|
||||
// The remote address the packet should be sent to.
|
||||
struct sockaddr_storage to;
|
||||
socklen_t to_len;
|
||||
|
||||
// The time to send the packet out.
|
||||
struct timespec at;
|
||||
} quiche_send_info;
|
||||
|
||||
// Writes a single QUIC packet to be sent to the peer.
|
||||
ssize_t quiche_conn_send(quiche_conn *conn, uint8_t *out, size_t out_len,
|
||||
quiche_send_info *out_info);
|
||||
|
||||
// Returns the size of the send quantum, in bytes.
|
||||
size_t quiche_conn_send_quantum(const quiche_conn *conn);
|
||||
|
||||
// Reads contiguous data from a stream.
|
||||
ssize_t quiche_conn_stream_recv(quiche_conn *conn, uint64_t stream_id,
|
||||
uint8_t *out, size_t buf_len, bool *fin);
|
||||
|
||||
// Writes data to a stream.
|
||||
ssize_t quiche_conn_stream_send(quiche_conn *conn, uint64_t stream_id,
|
||||
const uint8_t *buf, size_t buf_len, bool fin);
|
||||
|
||||
// The side of the stream to be shut down.
|
||||
enum quiche_shutdown {
|
||||
QUICHE_SHUTDOWN_READ = 0,
|
||||
QUICHE_SHUTDOWN_WRITE = 1,
|
||||
};
|
||||
|
||||
// Sets the priority for a stream.
|
||||
int quiche_conn_stream_priority(quiche_conn *conn, uint64_t stream_id,
|
||||
uint8_t urgency, bool incremental);
|
||||
|
||||
// Shuts down reading or writing from/to the specified stream.
|
||||
int quiche_conn_stream_shutdown(quiche_conn *conn, uint64_t stream_id,
|
||||
enum quiche_shutdown direction, uint64_t err);
|
||||
|
||||
// Returns the stream's send capacity in bytes.
|
||||
ssize_t quiche_conn_stream_capacity(const quiche_conn *conn, uint64_t stream_id);
|
||||
|
||||
// Returns true if the stream has data that can be read.
|
||||
bool quiche_conn_stream_readable(const quiche_conn *conn, uint64_t stream_id);
|
||||
|
||||
// Returns the next stream that has data to read, or -1 if no such stream is
|
||||
// available.
|
||||
int64_t quiche_conn_stream_readable_next(quiche_conn *conn);
|
||||
|
||||
// Returns true if the stream has enough send capacity.
|
||||
//
|
||||
// On error a value lower than 0 is returned.
|
||||
int quiche_conn_stream_writable(quiche_conn *conn, uint64_t stream_id, size_t len);
|
||||
|
||||
// Returns the next stream that can be written to, or -1 if no such stream is
|
||||
// available.
|
||||
int64_t quiche_conn_stream_writable_next(quiche_conn *conn);
|
||||
|
||||
// Returns true if all the data has been read from the specified stream.
|
||||
bool quiche_conn_stream_finished(const quiche_conn *conn, uint64_t stream_id);
|
||||
|
||||
typedef struct quiche_stream_iter quiche_stream_iter;
|
||||
|
||||
// Returns an iterator over streams that have outstanding data to read.
|
||||
quiche_stream_iter *quiche_conn_readable(const quiche_conn *conn);
|
||||
|
||||
// Returns an iterator over streams that can be written to.
|
||||
quiche_stream_iter *quiche_conn_writable(const quiche_conn *conn);
|
||||
|
||||
// Returns the maximum possible size of egress UDP payloads.
|
||||
size_t quiche_conn_max_send_udp_payload_size(const quiche_conn *conn);
|
||||
|
||||
// Returns the amount of time until the next timeout event, in nanoseconds.
|
||||
uint64_t quiche_conn_timeout_as_nanos(const quiche_conn *conn);
|
||||
|
||||
// Returns the amount of time until the next timeout event, in milliseconds.
|
||||
uint64_t quiche_conn_timeout_as_millis(const quiche_conn *conn);
|
||||
|
||||
// Processes a timeout event.
|
||||
void quiche_conn_on_timeout(quiche_conn *conn);
|
||||
|
||||
// Closes the connection with the given error and reason.
|
||||
int quiche_conn_close(quiche_conn *conn, bool app, uint64_t err,
|
||||
const uint8_t *reason, size_t reason_len);
|
||||
|
||||
// Returns a string uniquely representing the connection.
|
||||
void quiche_conn_trace_id(const quiche_conn *conn, const uint8_t **out, size_t *out_len);
|
||||
|
||||
// Returns the source connection ID.
|
||||
void quiche_conn_source_id(const quiche_conn *conn, const uint8_t **out, size_t *out_len);
|
||||
|
||||
// Returns the destination connection ID.
|
||||
void quiche_conn_destination_id(const quiche_conn *conn, const uint8_t **out, size_t *out_len);
|
||||
|
||||
// Returns the negotiated ALPN protocol.
|
||||
void quiche_conn_application_proto(const quiche_conn *conn, const uint8_t **out,
|
||||
size_t *out_len);
|
||||
|
||||
// Returns the peer's leaf certificate (if any) as a DER-encoded buffer.
|
||||
void quiche_conn_peer_cert(const quiche_conn *conn, const uint8_t **out, size_t *out_len);
|
||||
|
||||
// Returns the serialized cryptographic session for the connection.
|
||||
void quiche_conn_session(const quiche_conn *conn, const uint8_t **out, size_t *out_len);
|
||||
|
||||
// Returns true if the connection handshake is complete.
|
||||
bool quiche_conn_is_established(const quiche_conn *conn);
|
||||
|
||||
// Returns true if the connection has a pending handshake that has progressed
|
||||
// enough to send or receive early data.
|
||||
bool quiche_conn_is_in_early_data(const quiche_conn *conn);
|
||||
|
||||
// Returns whether there is stream or DATAGRAM data available to read.
|
||||
bool quiche_conn_is_readable(const quiche_conn *conn);
|
||||
|
||||
// Returns true if the connection is draining.
|
||||
bool quiche_conn_is_draining(const quiche_conn *conn);
|
||||
|
||||
// Returns the number of bidirectional streams that can be created
|
||||
// before the peer's stream count limit is reached.
|
||||
uint64_t quiche_conn_peer_streams_left_bidi(const quiche_conn *conn);
|
||||
|
||||
// Returns the number of unidirectional streams that can be created
|
||||
// before the peer's stream count limit is reached.
|
||||
uint64_t quiche_conn_peer_streams_left_uni(const quiche_conn *conn);
|
||||
|
||||
// Returns true if the connection is closed.
|
||||
bool quiche_conn_is_closed(const quiche_conn *conn);
|
||||
|
||||
// Returns true if the connection was closed due to the idle timeout.
|
||||
bool quiche_conn_is_timed_out(const quiche_conn *conn);
|
||||
|
||||
// Returns true if a connection error was received, and updates the provided
|
||||
// parameters accordingly.
|
||||
bool quiche_conn_peer_error(const quiche_conn *conn,
|
||||
bool *is_app,
|
||||
uint64_t *error_code,
|
||||
const uint8_t **reason,
|
||||
size_t *reason_len);
|
||||
|
||||
// Returns true if a connection error was queued or sent, and updates the provided
|
||||
// parameters accordingly.
|
||||
bool quiche_conn_local_error(const quiche_conn *conn,
|
||||
bool *is_app,
|
||||
uint64_t *error_code,
|
||||
const uint8_t **reason,
|
||||
size_t *reason_len);
|
||||
|
||||
// Initializes the stream's application data.
|
||||
//
|
||||
// Stream data can only be initialized once. Additional calls to this method
|
||||
// will fail.
|
||||
//
|
||||
// Note that the application is responsible for freeing the data.
|
||||
int quiche_conn_stream_init_application_data(quiche_conn *conn,
|
||||
uint64_t stream_id,
|
||||
void *data);
|
||||
|
||||
// Returns the stream's application data, if any was initialized.
|
||||
void *quiche_conn_stream_application_data(quiche_conn *conn, uint64_t stream_id);
|
||||
|
||||
// Fetches the next stream from the given iterator. Returns false if there are
|
||||
// no more elements in the iterator.
|
||||
bool quiche_stream_iter_next(quiche_stream_iter *iter, uint64_t *stream_id);
|
||||
|
||||
// Frees the given stream iterator object.
|
||||
void quiche_stream_iter_free(quiche_stream_iter *iter);
|
||||
|
||||
typedef struct {
|
||||
// The number of QUIC packets received on this connection.
|
||||
size_t recv;
|
||||
|
||||
// The number of QUIC packets sent on this connection.
|
||||
size_t sent;
|
||||
|
||||
// The number of QUIC packets that were lost.
|
||||
size_t lost;
|
||||
|
||||
// The number of sent QUIC packets with retransmitted data.
|
||||
size_t retrans;
|
||||
|
||||
// The number of sent bytes.
|
||||
uint64_t sent_bytes;
|
||||
|
||||
// The number of received bytes.
|
||||
uint64_t recv_bytes;
|
||||
|
||||
// The number of bytes lost.
|
||||
uint64_t lost_bytes;
|
||||
|
||||
// The number of stream bytes retransmitted.
|
||||
uint64_t stream_retrans_bytes;
|
||||
|
||||
// The number of known paths for the connection.
|
||||
size_t paths_count;
|
||||
|
||||
// The maximum idle timeout.
|
||||
uint64_t peer_max_idle_timeout;
|
||||
|
||||
// The maximum UDP payload size.
|
||||
uint64_t peer_max_udp_payload_size;
|
||||
|
||||
// The initial flow control maximum data for the connection.
|
||||
uint64_t peer_initial_max_data;
|
||||
|
||||
// The initial flow control maximum data for local bidirectional streams.
|
||||
uint64_t peer_initial_max_stream_data_bidi_local;
|
||||
|
||||
// The initial flow control maximum data for remote bidirectional streams.
|
||||
uint64_t peer_initial_max_stream_data_bidi_remote;
|
||||
|
||||
// The initial flow control maximum data for unidirectional streams.
|
||||
uint64_t peer_initial_max_stream_data_uni;
|
||||
|
||||
// The initial maximum bidirectional streams.
|
||||
uint64_t peer_initial_max_streams_bidi;
|
||||
|
||||
// The initial maximum unidirectional streams.
|
||||
uint64_t peer_initial_max_streams_uni;
|
||||
|
||||
// The ACK delay exponent.
|
||||
uint64_t peer_ack_delay_exponent;
|
||||
|
||||
// The max ACK delay.
|
||||
uint64_t peer_max_ack_delay;
|
||||
|
||||
// Whether active migration is disabled.
|
||||
bool peer_disable_active_migration;
|
||||
|
||||
// The active connection ID limit.
|
||||
uint64_t peer_active_conn_id_limit;
|
||||
|
||||
// DATAGRAM frame extension parameter, if any.
|
||||
ssize_t peer_max_datagram_frame_size;
|
||||
} quiche_stats;
|
||||
|
||||
// Collects and returns statistics about the connection.
|
||||
void quiche_conn_stats(const quiche_conn *conn, quiche_stats *out);
|
||||
|
||||
typedef struct {
|
||||
// The local address used by this path.
|
||||
struct sockaddr_storage local_addr;
|
||||
socklen_t local_addr_len;
|
||||
|
||||
// The peer address seen by this path.
|
||||
struct sockaddr_storage peer_addr;
|
||||
socklen_t peer_addr_len;
|
||||
|
||||
// The validation state of the path.
|
||||
ssize_t validation_state;
|
||||
|
||||
// Whether this path is active.
|
||||
bool active;
|
||||
|
||||
// The number of QUIC packets received on this path.
|
||||
size_t recv;
|
||||
|
||||
// The number of QUIC packets sent on this path.
|
||||
size_t sent;
|
||||
|
||||
// The number of QUIC packets that were lost on this path.
|
||||
size_t lost;
|
||||
|
||||
// The number of sent QUIC packets with retransmitted data on this path.
|
||||
size_t retrans;
|
||||
|
||||
// The estimated round-trip time of the path (in nanoseconds).
|
||||
uint64_t rtt;
|
||||
|
||||
// The size of the path's congestion window in bytes.
|
||||
size_t cwnd;
|
||||
|
||||
// The number of sent bytes on this path.
|
||||
uint64_t sent_bytes;
|
||||
|
||||
// The number of received bytes on this path.
|
||||
uint64_t recv_bytes;
|
||||
|
||||
// The number of bytes lost on this path.
|
||||
uint64_t lost_bytes;
|
||||
|
||||
// The number of stream bytes retransmitted on this path.
|
||||
uint64_t stream_retrans_bytes;
|
||||
|
||||
// The current PMTU for the path.
|
||||
size_t pmtu;
|
||||
|
||||
// The most recent data delivery rate estimate in bytes/s.
|
||||
uint64_t delivery_rate;
|
||||
} quiche_path_stats;
|
||||
|
||||
|
||||
// Collects and returns statistics about the specified path for the connection.
|
||||
//
|
||||
// The `idx` argument represent the path's index (also see the `paths_count`
|
||||
// field of `quiche_stats`).
|
||||
int quiche_conn_path_stats(const quiche_conn *conn, size_t idx, quiche_path_stats *out);
|
||||
|
||||
// Returns the maximum DATAGRAM payload that can be sent.
|
||||
ssize_t quiche_conn_dgram_max_writable_len(const quiche_conn *conn);
|
||||
|
||||
// Returns the length of the first stored DATAGRAM.
|
||||
ssize_t quiche_conn_dgram_recv_front_len(const quiche_conn *conn);
|
||||
|
||||
// Returns the number of items in the DATAGRAM receive queue.
|
||||
ssize_t quiche_conn_dgram_recv_queue_len(const quiche_conn *conn);
|
||||
|
||||
// Returns the total size of all items in the DATAGRAM receive queue.
|
||||
ssize_t quiche_conn_dgram_recv_queue_byte_size(const quiche_conn *conn);
|
||||
|
||||
// Returns the number of items in the DATAGRAM send queue.
|
||||
ssize_t quiche_conn_dgram_send_queue_len(const quiche_conn *conn);
|
||||
|
||||
// Returns the total size of all items in the DATAGRAM send queue.
|
||||
ssize_t quiche_conn_dgram_send_queue_byte_size(const quiche_conn *conn);
|
||||
|
||||
// Reads the first received DATAGRAM.
|
||||
ssize_t quiche_conn_dgram_recv(quiche_conn *conn, uint8_t *buf,
|
||||
size_t buf_len);
|
||||
|
||||
// Sends data in a DATAGRAM frame.
|
||||
ssize_t quiche_conn_dgram_send(quiche_conn *conn, const uint8_t *buf,
|
||||
size_t buf_len);
|
||||
|
||||
// Purges queued outgoing DATAGRAMs matching the predicate.
|
||||
void quiche_conn_dgram_purge_outgoing(quiche_conn *conn,
|
||||
bool (*f)(uint8_t *, size_t));
|
||||
|
||||
// Schedule an ack-eliciting packet on the active path.
|
||||
ssize_t quiche_conn_send_ack_eliciting(quiche_conn *conn);
|
||||
|
||||
// Schedule an ack-eliciting packet on the specified path.
|
||||
ssize_t quiche_conn_send_ack_eliciting_on_path(quiche_conn *conn,
|
||||
const struct sockaddr *local, size_t local_len,
|
||||
const struct sockaddr *peer, size_t peer_len);
|
||||
|
||||
// Frees the connection object.
|
||||
void quiche_conn_free(quiche_conn *conn);
|
||||
|
||||
|
||||
// HTTP/3 API
|
||||
//
|
||||
|
||||
// List of ALPN tokens of supported HTTP/3 versions.
|
||||
#define QUICHE_H3_APPLICATION_PROTOCOL "\x02h3\x05h3-29\x05h3-28\x05h3-27"
|
||||
|
||||
enum quiche_h3_error {
|
||||
// There is no error or no work to do
|
||||
QUICHE_H3_ERR_DONE = -1,
|
||||
|
||||
// The provided buffer is too short.
|
||||
QUICHE_H3_ERR_BUFFER_TOO_SHORT = -2,
|
||||
|
||||
// Internal error in the HTTP/3 stack.
|
||||
QUICHE_H3_ERR_INTERNAL_ERROR = -3,
|
||||
|
||||
// Endpoint detected that the peer is exhibiting behavior that causes.
|
||||
// excessive load.
|
||||
QUICHE_H3_ERR_EXCESSIVE_LOAD = -4,
|
||||
|
||||
// Stream ID or Push ID greater that current maximum was
|
||||
// used incorrectly, such as exceeding a limit, reducing a limit,
|
||||
// or being reused.
|
||||
QUICHE_H3_ERR_ID_ERROR= -5,
|
||||
|
||||
// The endpoint detected that its peer created a stream that it will not
|
||||
// accept.
|
||||
QUICHE_H3_ERR_STREAM_CREATION_ERROR = -6,
|
||||
|
||||
// A required critical stream was closed.
|
||||
QUICHE_H3_ERR_CLOSED_CRITICAL_STREAM = -7,
|
||||
|
||||
// No SETTINGS frame at beginning of control stream.
|
||||
QUICHE_H3_ERR_MISSING_SETTINGS = -8,
|
||||
|
||||
// A frame was received which is not permitted in the current state.
|
||||
QUICHE_H3_ERR_FRAME_UNEXPECTED = -9,
|
||||
|
||||
// Frame violated layout or size rules.
|
||||
QUICHE_H3_ERR_FRAME_ERROR = -10,
|
||||
|
||||
// QPACK Header block decompression failure.
|
||||
QUICHE_H3_ERR_QPACK_DECOMPRESSION_FAILED = -11,
|
||||
|
||||
// -12 was previously used for TransportError, skip it
|
||||
|
||||
// The underlying QUIC stream (or connection) doesn't have enough capacity
|
||||
// for the operation to complete. The application should retry later on.
|
||||
QUICHE_H3_ERR_STREAM_BLOCKED = -13,
|
||||
|
||||
// Error in the payload of a SETTINGS frame.
|
||||
QUICHE_H3_ERR_SETTINGS_ERROR = -14,
|
||||
|
||||
// Server rejected request.
|
||||
QUICHE_H3_ERR_REQUEST_REJECTED = -15,
|
||||
|
||||
// Request or its response cancelled.
|
||||
QUICHE_H3_ERR_REQUEST_CANCELLED = -16,
|
||||
|
||||
// Client's request stream terminated without containing a full-formed
|
||||
// request.
|
||||
QUICHE_H3_ERR_REQUEST_INCOMPLETE = -17,
|
||||
|
||||
// An HTTP message was malformed and cannot be processed.
|
||||
QUICHE_H3_ERR_MESSAGE_ERROR = -18,
|
||||
|
||||
// The TCP connection established in response to a CONNECT request was
|
||||
// reset or abnormally closed.
|
||||
QUICHE_H3_ERR_CONNECT_ERROR = -19,
|
||||
|
||||
// The requested operation cannot be served over HTTP/3. Peer should retry
|
||||
// over HTTP/1.1.
|
||||
QUICHE_H3_ERR_VERSION_FALLBACK = -20,
|
||||
|
||||
// The following QUICHE_H3_TRANSPORT_ERR_* errors are propagated
|
||||
// from the QUIC transport layer.
|
||||
|
||||
// See QUICHE_ERR_DONE.
|
||||
QUICHE_H3_TRANSPORT_ERR_DONE = QUICHE_ERR_DONE - 1000,
|
||||
|
||||
// See QUICHE_ERR_BUFFER_TOO_SHORT.
|
||||
QUICHE_H3_TRANSPORT_ERR_BUFFER_TOO_SHORT = QUICHE_ERR_BUFFER_TOO_SHORT - 1000,
|
||||
|
||||
// See QUICHE_ERR_UNKNOWN_VERSION.
|
||||
QUICHE_H3_TRANSPORT_ERR_UNKNOWN_VERSION = QUICHE_ERR_UNKNOWN_VERSION - 1000,
|
||||
|
||||
// See QUICHE_ERR_INVALID_FRAME.
|
||||
QUICHE_H3_TRANSPORT_ERR_INVALID_FRAME = QUICHE_ERR_INVALID_FRAME - 1000,
|
||||
|
||||
// See QUICHE_ERR_INVALID_PACKET.
|
||||
QUICHE_H3_TRANSPORT_ERR_INVALID_PACKET = QUICHE_ERR_INVALID_PACKET - 1000,
|
||||
|
||||
// See QUICHE_ERR_INVALID_STATE.
|
||||
QUICHE_H3_TRANSPORT_ERR_INVALID_STATE = QUICHE_ERR_INVALID_STATE - 1000,
|
||||
|
||||
// See QUICHE_ERR_INVALID_STREAM_STATE.
|
||||
QUICHE_H3_TRANSPORT_ERR_INVALID_STREAM_STATE = QUICHE_ERR_INVALID_STREAM_STATE - 1000,
|
||||
|
||||
// See QUICHE_ERR_INVALID_TRANSPORT_PARAM.
|
||||
QUICHE_H3_TRANSPORT_ERR_INVALID_TRANSPORT_PARAM = QUICHE_ERR_INVALID_TRANSPORT_PARAM - 1000,
|
||||
|
||||
// See QUICHE_ERR_CRYPTO_FAIL.
|
||||
QUICHE_H3_TRANSPORT_ERR_CRYPTO_FAIL = QUICHE_ERR_CRYPTO_FAIL - 1000,
|
||||
|
||||
// See QUICHE_ERR_TLS_FAIL.
|
||||
QUICHE_H3_TRANSPORT_ERR_TLS_FAIL = QUICHE_ERR_TLS_FAIL - 1000,
|
||||
|
||||
// See QUICHE_ERR_FLOW_CONTROL.
|
||||
QUICHE_H3_TRANSPORT_ERR_FLOW_CONTROL = QUICHE_ERR_FLOW_CONTROL - 1000,
|
||||
|
||||
// See QUICHE_ERR_STREAM_LIMIT.
|
||||
QUICHE_H3_TRANSPORT_ERR_STREAM_LIMIT = QUICHE_ERR_STREAM_LIMIT - 1000,
|
||||
|
||||
// See QUICHE_ERR_STREAM_STOPPED.
|
||||
QUICHE_H3_TRANSPORT_ERR_STREAM_STOPPED = QUICHE_ERR_STREAM_STOPPED - 1000,
|
||||
|
||||
// See QUICHE_ERR_STREAM_RESET.
|
||||
QUICHE_H3_TRANSPORT_ERR_STREAM_RESET = QUICHE_ERR_STREAM_RESET - 1000,
|
||||
|
||||
// See QUICHE_ERR_FINAL_SIZE.
|
||||
QUICHE_H3_TRANSPORT_ERR_FINAL_SIZE = QUICHE_ERR_FINAL_SIZE - 1000,
|
||||
|
||||
// See QUICHE_ERR_CONGESTION_CONTROL.
|
||||
QUICHE_H3_TRANSPORT_ERR_CONGESTION_CONTROL = QUICHE_ERR_CONGESTION_CONTROL - 1000,
|
||||
};
|
||||
|
||||
// Stores configuration shared between multiple connections.
|
||||
typedef struct quiche_h3_config quiche_h3_config;
|
||||
|
||||
// Creates an HTTP/3 config object with default settings values.
|
||||
quiche_h3_config *quiche_h3_config_new(void);
|
||||
|
||||
// Sets the `SETTINGS_MAX_FIELD_SECTION_SIZE` setting.
|
||||
void quiche_h3_config_set_max_field_section_size(quiche_h3_config *config, uint64_t v);
|
||||
|
||||
// Sets the `SETTINGS_QPACK_MAX_TABLE_CAPACITY` setting.
|
||||
void quiche_h3_config_set_qpack_max_table_capacity(quiche_h3_config *config, uint64_t v);
|
||||
|
||||
// Sets the `SETTINGS_QPACK_BLOCKED_STREAMS` setting.
|
||||
void quiche_h3_config_set_qpack_blocked_streams(quiche_h3_config *config, uint64_t v);
|
||||
|
||||
// Sets the `SETTINGS_ENABLE_CONNECT_PROTOCOL` setting.
|
||||
void quiche_h3_config_enable_extended_connect(quiche_h3_config *config, bool enabled);
|
||||
|
||||
// Frees the HTTP/3 config object.
|
||||
void quiche_h3_config_free(quiche_h3_config *config);
|
||||
|
||||
// An HTTP/3 connection.
|
||||
typedef struct quiche_h3_conn quiche_h3_conn;
|
||||
|
||||
// Creates a new server-side connection.
|
||||
quiche_h3_conn *quiche_h3_accept(quiche_conn *quiche_conn,
|
||||
quiche_h3_config *config);
|
||||
|
||||
// Creates a new HTTP/3 connection using the provided QUIC connection.
|
||||
quiche_h3_conn *quiche_h3_conn_new_with_transport(quiche_conn *quiche_conn,
|
||||
quiche_h3_config *config);
|
||||
|
||||
enum quiche_h3_event_type {
|
||||
QUICHE_H3_EVENT_HEADERS,
|
||||
QUICHE_H3_EVENT_DATA,
|
||||
QUICHE_H3_EVENT_FINISHED,
|
||||
QUICHE_H3_EVENT_DATAGRAM,
|
||||
QUICHE_H3_EVENT_GOAWAY,
|
||||
QUICHE_H3_EVENT_RESET,
|
||||
QUICHE_H3_EVENT_PRIORITY_UPDATE,
|
||||
};
|
||||
|
||||
typedef struct quiche_h3_event quiche_h3_event;
|
||||
|
||||
// Processes HTTP/3 data received from the peer.
|
||||
int64_t quiche_h3_conn_poll(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
quiche_h3_event **ev);
|
||||
|
||||
// Returns the type of the event.
|
||||
enum quiche_h3_event_type quiche_h3_event_type(quiche_h3_event *ev);
|
||||
|
||||
// Iterates over the headers in the event.
|
||||
//
|
||||
// The `cb` callback will be called for each header in `ev`. `cb` should check
|
||||
// the validity of pseudo-headers and headers. If `cb` returns any value other
|
||||
// than `0`, processing will be interrupted and the value is returned to the
|
||||
// caller.
|
||||
int quiche_h3_event_for_each_header(quiche_h3_event *ev,
|
||||
int (*cb)(uint8_t *name, size_t name_len,
|
||||
uint8_t *value, size_t value_len,
|
||||
void *argp),
|
||||
void *argp);
|
||||
|
||||
// Iterates over the peer's HTTP/3 settings.
|
||||
//
|
||||
// The `cb` callback will be called for each setting in `conn`.
|
||||
// If `cb` returns any value other than `0`, processing will be interrupted and
|
||||
// the value is returned to the caller.
|
||||
int quiche_h3_for_each_setting(quiche_h3_conn *conn,
|
||||
int (*cb)(uint64_t identifier,
|
||||
uint64_t value, void *argp),
|
||||
void *argp);
|
||||
|
||||
// Check whether data will follow the headers on the stream.
|
||||
bool quiche_h3_event_headers_has_body(quiche_h3_event *ev);
|
||||
|
||||
// Check whether or not extended connection is enabled by the peer
|
||||
bool quiche_h3_extended_connect_enabled_by_peer(quiche_h3_conn *conn);
|
||||
|
||||
// Frees the HTTP/3 event object.
|
||||
void quiche_h3_event_free(quiche_h3_event *ev);
|
||||
|
||||
typedef struct {
|
||||
const uint8_t *name;
|
||||
size_t name_len;
|
||||
|
||||
const uint8_t *value;
|
||||
size_t value_len;
|
||||
} quiche_h3_header;
|
||||
|
||||
// Extensible Priorities parameters.
|
||||
typedef struct {
|
||||
uint8_t urgency;
|
||||
bool incremental;
|
||||
} quiche_h3_priority;
|
||||
|
||||
// Sends an HTTP/3 request.
|
||||
int64_t quiche_h3_send_request(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
quiche_h3_header *headers, size_t headers_len,
|
||||
bool fin);
|
||||
|
||||
// Sends an HTTP/3 response on the specified stream with default priority.
|
||||
int quiche_h3_send_response(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
uint64_t stream_id, quiche_h3_header *headers,
|
||||
size_t headers_len, bool fin);
|
||||
|
||||
// Sends an HTTP/3 response on the specified stream with specified priority.
|
||||
int quiche_h3_send_response_with_priority(quiche_h3_conn *conn,
|
||||
quiche_conn *quic_conn, uint64_t stream_id,
|
||||
quiche_h3_header *headers, size_t headers_len,
|
||||
quiche_h3_priority *priority, bool fin);
|
||||
|
||||
// Sends an HTTP/3 body chunk on the given stream.
|
||||
ssize_t quiche_h3_send_body(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
uint64_t stream_id, uint8_t *body, size_t body_len,
|
||||
bool fin);
|
||||
|
||||
// Reads request or response body data into the provided buffer.
|
||||
ssize_t quiche_h3_recv_body(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
uint64_t stream_id, uint8_t *out, size_t out_len);
|
||||
|
||||
// Try to parse an Extensible Priority field value.
|
||||
int quiche_h3_parse_extensible_priority(uint8_t *priority,
|
||||
size_t priority_len,
|
||||
quiche_h3_priority *parsed);
|
||||
|
||||
/// Sends a PRIORITY_UPDATE frame on the control stream with specified
|
||||
/// request stream ID and priority.
|
||||
int quiche_h3_send_priority_update_for_request(quiche_h3_conn *conn,
|
||||
quiche_conn *quic_conn,
|
||||
uint64_t stream_id,
|
||||
quiche_h3_priority *priority);
|
||||
|
||||
// Take the last received PRIORITY_UPDATE frame for a stream.
|
||||
//
|
||||
// The `cb` callback will be called once. `cb` should check the validity of
|
||||
// priority field value contents. If `cb` returns any value other than `0`,
|
||||
// processing will be interrupted and the value is returned to the caller.
|
||||
int quiche_h3_take_last_priority_update(quiche_h3_conn *conn,
|
||||
uint64_t prioritized_element_id,
|
||||
int (*cb)(uint8_t *priority_field_value,
|
||||
uint64_t priority_field_value_len,
|
||||
void *argp),
|
||||
void *argp);
|
||||
|
||||
// Returns whether the peer enabled HTTP/3 DATAGRAM frame support.
|
||||
bool quiche_h3_dgram_enabled_by_peer(quiche_h3_conn *conn,
|
||||
quiche_conn *quic_conn);
|
||||
|
||||
// Writes data to the DATAGRAM send queue.
|
||||
ssize_t quiche_h3_send_dgram(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
uint64_t flow_id, uint8_t *data, size_t data_len);
|
||||
|
||||
// Reads data from the DATAGRAM receive queue.
|
||||
ssize_t quiche_h3_recv_dgram(quiche_h3_conn *conn, quiche_conn *quic_conn,
|
||||
uint64_t *flow_id, size_t *flow_id_len,
|
||||
uint8_t *out, size_t out_len);
|
||||
|
||||
// Frees the HTTP/3 connection object.
|
||||
void quiche_h3_conn_free(quiche_h3_conn *conn);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
} // extern C
|
||||
#endif
|
||||
|
||||
#endif // QUICHE_H
|
7369
csbindgen-tests/src/bullet3.rs
Normal file
7369
csbindgen-tests/src/bullet3.rs
Normal file
File diff suppressed because it is too large
Load Diff
6821
csbindgen-tests/src/bullet3_ffi.rs
Normal file
6821
csbindgen-tests/src/bullet3_ffi.rs
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,29 @@
|
||||
#[allow(dead_code)]
|
||||
#[allow(non_snake_case)]
|
||||
#[allow(non_camel_case_types)]
|
||||
#[allow(non_upper_case_globals)]
|
||||
mod lz4;
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[allow(non_snake_case)]
|
||||
#[allow(non_camel_case_types)]
|
||||
mod ffi;
|
||||
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
// #[allow(dead_code)]
|
||||
// #[allow(non_snake_case)]
|
||||
// #[allow(non_camel_case_types)]
|
||||
// #[allow(non_upper_case_globals)]
|
||||
// mod lz4;
|
||||
|
||||
// #[allow(dead_code)]
|
||||
// #[allow(non_snake_case)]
|
||||
// #[allow(non_camel_case_types)]
|
||||
// mod ffi;
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
//let n = ffi::Cysharp_LZ4_versionNumber();
|
||||
//println!("{}", n);
|
||||
fn build_test() {
|
||||
let path = std::env::current_dir().unwrap();
|
||||
println!("starting dir: {}", path.display()); // csbindgen/csbindgen-tests
|
||||
|
||||
// unsafe {
|
||||
// let num = lz4::LZ4_versionNumber();
|
||||
// println!("lz4 num: {}", num);
|
||||
// }
|
||||
|
||||
csbindgen::Builder::new()
|
||||
.input_bindgen_file("src/quiche.rs")
|
||||
.rust_method_prefix("csbindgen_quiche_")
|
||||
.csharp_class_name("LibQuiche")
|
||||
.csharp_dll_name("libquiche")
|
||||
.generate_to_file("src/quiche_ffi.rs", "../dotnet-sandbox/quiche_bindgen.cs")
|
||||
.unwrap();
|
||||
}
|
||||
|
329473
csbindgen-tests/src/quiche.rs
Normal file
329473
csbindgen-tests/src/quiche.rs
Normal file
File diff suppressed because it is too large
Load Diff
101623
csbindgen-tests/src/quiche_ffi.rs
Normal file
101623
csbindgen-tests/src/quiche_ffi.rs
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ use ::std::os::raw::*;
|
||||
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen___va_start(
|
||||
pub extern "C" fn csbindgen_zstd___va_start(
|
||||
arg1: *mut *mut c_char
|
||||
)
|
||||
{
|
||||
@ -19,7 +19,7 @@ pub extern "C" fn csbindgen___va_start(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen___security_init_cookie(
|
||||
pub extern "C" fn csbindgen_zstd___security_init_cookie(
|
||||
|
||||
)
|
||||
{
|
||||
@ -31,7 +31,7 @@ pub extern "C" fn csbindgen___security_init_cookie(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen___security_check_cookie(
|
||||
pub extern "C" fn csbindgen_zstd___security_check_cookie(
|
||||
_StackCookie: usize
|
||||
)
|
||||
{
|
||||
@ -43,7 +43,7 @@ pub extern "C" fn csbindgen___security_check_cookie(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_versionNumber(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_versionNumber(
|
||||
|
||||
) -> c_uint
|
||||
{
|
||||
@ -55,7 +55,7 @@ pub extern "C" fn csbindgen_ZSTD_versionNumber(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_versionString(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_versionString(
|
||||
|
||||
) -> *const c_char
|
||||
{
|
||||
@ -67,7 +67,7 @@ pub extern "C" fn csbindgen_ZSTD_versionString(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compress(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compress(
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
src: *const c_void,
|
||||
@ -87,7 +87,7 @@ pub extern "C" fn csbindgen_ZSTD_compress(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_decompress(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_decompress(
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
src: *const c_void,
|
||||
@ -105,7 +105,7 @@ pub extern "C" fn csbindgen_ZSTD_decompress(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getFrameContentSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getFrameContentSize(
|
||||
src: *const c_void,
|
||||
srcSize: usize
|
||||
) -> c_ulonglong
|
||||
@ -119,7 +119,7 @@ pub extern "C" fn csbindgen_ZSTD_getFrameContentSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getDecompressedSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getDecompressedSize(
|
||||
src: *const c_void,
|
||||
srcSize: usize
|
||||
) -> c_ulonglong
|
||||
@ -133,7 +133,7 @@ pub extern "C" fn csbindgen_ZSTD_getDecompressedSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_findFrameCompressedSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_findFrameCompressedSize(
|
||||
src: *const c_void,
|
||||
srcSize: usize
|
||||
) -> usize
|
||||
@ -147,7 +147,7 @@ pub extern "C" fn csbindgen_ZSTD_findFrameCompressedSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compressBound(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compressBound(
|
||||
srcSize: usize
|
||||
) -> usize
|
||||
{
|
||||
@ -159,7 +159,7 @@ pub extern "C" fn csbindgen_ZSTD_compressBound(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_isError(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_isError(
|
||||
code: usize
|
||||
) -> c_uint
|
||||
{
|
||||
@ -171,7 +171,7 @@ pub extern "C" fn csbindgen_ZSTD_isError(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getErrorName(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getErrorName(
|
||||
code: usize
|
||||
) -> *const c_char
|
||||
{
|
||||
@ -183,7 +183,7 @@ pub extern "C" fn csbindgen_ZSTD_getErrorName(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_minCLevel(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_minCLevel(
|
||||
|
||||
) -> c_int
|
||||
{
|
||||
@ -195,7 +195,7 @@ pub extern "C" fn csbindgen_ZSTD_minCLevel(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_maxCLevel(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_maxCLevel(
|
||||
|
||||
) -> c_int
|
||||
{
|
||||
@ -207,7 +207,7 @@ pub extern "C" fn csbindgen_ZSTD_maxCLevel(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_defaultCLevel(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_defaultCLevel(
|
||||
|
||||
) -> c_int
|
||||
{
|
||||
@ -219,7 +219,7 @@ pub extern "C" fn csbindgen_ZSTD_defaultCLevel(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createCCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createCCtx(
|
||||
|
||||
) -> *mut ZSTD_CCtx
|
||||
{
|
||||
@ -231,7 +231,7 @@ pub extern "C" fn csbindgen_ZSTD_createCCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeCCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeCCtx(
|
||||
cctx: *mut ZSTD_CCtx
|
||||
) -> usize
|
||||
{
|
||||
@ -243,7 +243,7 @@ pub extern "C" fn csbindgen_ZSTD_freeCCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compressCCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compressCCtx(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -265,7 +265,7 @@ pub extern "C" fn csbindgen_ZSTD_compressCCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createDCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createDCtx(
|
||||
|
||||
) -> *mut ZSTD_DCtx
|
||||
{
|
||||
@ -277,7 +277,7 @@ pub extern "C" fn csbindgen_ZSTD_createDCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeDCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeDCtx(
|
||||
dctx: *mut ZSTD_DCtx
|
||||
) -> usize
|
||||
{
|
||||
@ -289,7 +289,7 @@ pub extern "C" fn csbindgen_ZSTD_freeDCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_decompressDCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_decompressDCtx(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -309,7 +309,7 @@ pub extern "C" fn csbindgen_ZSTD_decompressDCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_cParam_getBounds(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_cParam_getBounds(
|
||||
cParam: ZSTD_cParameter
|
||||
) -> ZSTD_bounds
|
||||
{
|
||||
@ -321,7 +321,7 @@ pub extern "C" fn csbindgen_ZSTD_cParam_getBounds(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_setParameter(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_setParameter(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
param: ZSTD_cParameter,
|
||||
value: c_int
|
||||
@ -337,7 +337,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_setParameter(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_setPledgedSrcSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_setPledgedSrcSize(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
pledgedSrcSize: c_ulonglong
|
||||
) -> usize
|
||||
@ -351,7 +351,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_setPledgedSrcSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_reset(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_reset(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
reset: ZSTD_ResetDirective
|
||||
) -> usize
|
||||
@ -365,7 +365,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_reset(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compress2(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compress2(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -385,7 +385,7 @@ pub extern "C" fn csbindgen_ZSTD_compress2(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_dParam_getBounds(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_dParam_getBounds(
|
||||
dParam: ZSTD_dParameter
|
||||
) -> ZSTD_bounds
|
||||
{
|
||||
@ -397,7 +397,7 @@ pub extern "C" fn csbindgen_ZSTD_dParam_getBounds(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DCtx_setParameter(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DCtx_setParameter(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
param: ZSTD_dParameter,
|
||||
value: c_int
|
||||
@ -413,7 +413,7 @@ pub extern "C" fn csbindgen_ZSTD_DCtx_setParameter(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DCtx_reset(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DCtx_reset(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
reset: ZSTD_ResetDirective
|
||||
) -> usize
|
||||
@ -427,7 +427,7 @@ pub extern "C" fn csbindgen_ZSTD_DCtx_reset(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createCStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createCStream(
|
||||
|
||||
) -> *mut ZSTD_CStream
|
||||
{
|
||||
@ -439,7 +439,7 @@ pub extern "C" fn csbindgen_ZSTD_createCStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeCStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeCStream(
|
||||
zcs: *mut ZSTD_CStream
|
||||
) -> usize
|
||||
{
|
||||
@ -451,7 +451,7 @@ pub extern "C" fn csbindgen_ZSTD_freeCStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compressStream2(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compressStream2(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
output: *mut ZSTD_outBuffer,
|
||||
input: *mut ZSTD_inBuffer,
|
||||
@ -469,7 +469,7 @@ pub extern "C" fn csbindgen_ZSTD_compressStream2(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CStreamInSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CStreamInSize(
|
||||
|
||||
) -> usize
|
||||
{
|
||||
@ -481,7 +481,7 @@ pub extern "C" fn csbindgen_ZSTD_CStreamInSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CStreamOutSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CStreamOutSize(
|
||||
|
||||
) -> usize
|
||||
{
|
||||
@ -493,7 +493,7 @@ pub extern "C" fn csbindgen_ZSTD_CStreamOutSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_initCStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_initCStream(
|
||||
zcs: *mut ZSTD_CStream,
|
||||
compressionLevel: c_int
|
||||
) -> usize
|
||||
@ -507,7 +507,7 @@ pub extern "C" fn csbindgen_ZSTD_initCStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compressStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compressStream(
|
||||
zcs: *mut ZSTD_CStream,
|
||||
output: *mut ZSTD_outBuffer,
|
||||
input: *mut ZSTD_inBuffer
|
||||
@ -523,7 +523,7 @@ pub extern "C" fn csbindgen_ZSTD_compressStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_flushStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_flushStream(
|
||||
zcs: *mut ZSTD_CStream,
|
||||
output: *mut ZSTD_outBuffer
|
||||
) -> usize
|
||||
@ -537,7 +537,7 @@ pub extern "C" fn csbindgen_ZSTD_flushStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_endStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_endStream(
|
||||
zcs: *mut ZSTD_CStream,
|
||||
output: *mut ZSTD_outBuffer
|
||||
) -> usize
|
||||
@ -551,7 +551,7 @@ pub extern "C" fn csbindgen_ZSTD_endStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createDStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createDStream(
|
||||
|
||||
) -> *mut ZSTD_DStream
|
||||
{
|
||||
@ -563,7 +563,7 @@ pub extern "C" fn csbindgen_ZSTD_createDStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeDStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeDStream(
|
||||
zds: *mut ZSTD_DStream
|
||||
) -> usize
|
||||
{
|
||||
@ -575,7 +575,7 @@ pub extern "C" fn csbindgen_ZSTD_freeDStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_initDStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_initDStream(
|
||||
zds: *mut ZSTD_DStream
|
||||
) -> usize
|
||||
{
|
||||
@ -587,7 +587,7 @@ pub extern "C" fn csbindgen_ZSTD_initDStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_decompressStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_decompressStream(
|
||||
zds: *mut ZSTD_DStream,
|
||||
output: *mut ZSTD_outBuffer,
|
||||
input: *mut ZSTD_inBuffer
|
||||
@ -603,7 +603,7 @@ pub extern "C" fn csbindgen_ZSTD_decompressStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DStreamInSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DStreamInSize(
|
||||
|
||||
) -> usize
|
||||
{
|
||||
@ -615,7 +615,7 @@ pub extern "C" fn csbindgen_ZSTD_DStreamInSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DStreamOutSize(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DStreamOutSize(
|
||||
|
||||
) -> usize
|
||||
{
|
||||
@ -627,7 +627,7 @@ pub extern "C" fn csbindgen_ZSTD_DStreamOutSize(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compress_usingDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compress_usingDict(
|
||||
ctx: *mut ZSTD_CCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -653,7 +653,7 @@ pub extern "C" fn csbindgen_ZSTD_compress_usingDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_decompress_usingDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_decompress_usingDict(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -677,7 +677,7 @@ pub extern "C" fn csbindgen_ZSTD_decompress_usingDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createCDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createCDict(
|
||||
dictBuffer: *const c_void,
|
||||
dictSize: usize,
|
||||
compressionLevel: c_int
|
||||
@ -693,7 +693,7 @@ pub extern "C" fn csbindgen_ZSTD_createCDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeCDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeCDict(
|
||||
CDict: *mut ZSTD_CDict
|
||||
) -> usize
|
||||
{
|
||||
@ -705,7 +705,7 @@ pub extern "C" fn csbindgen_ZSTD_freeCDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_compress_usingCDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_compress_usingCDict(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -727,7 +727,7 @@ pub extern "C" fn csbindgen_ZSTD_compress_usingCDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_createDDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_createDDict(
|
||||
dictBuffer: *const c_void,
|
||||
dictSize: usize
|
||||
) -> *mut ZSTD_DDict
|
||||
@ -741,7 +741,7 @@ pub extern "C" fn csbindgen_ZSTD_createDDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_freeDDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_freeDDict(
|
||||
ddict: *mut ZSTD_DDict
|
||||
) -> usize
|
||||
{
|
||||
@ -753,7 +753,7 @@ pub extern "C" fn csbindgen_ZSTD_freeDDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_decompress_usingDDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_decompress_usingDDict(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
dst: *mut c_void,
|
||||
dstCapacity: usize,
|
||||
@ -775,7 +775,7 @@ pub extern "C" fn csbindgen_ZSTD_decompress_usingDDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getDictID_fromDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getDictID_fromDict(
|
||||
dict: *const c_void,
|
||||
dictSize: usize
|
||||
) -> c_uint
|
||||
@ -789,7 +789,7 @@ pub extern "C" fn csbindgen_ZSTD_getDictID_fromDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getDictID_fromCDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getDictID_fromCDict(
|
||||
cdict: *const ZSTD_CDict
|
||||
) -> c_uint
|
||||
{
|
||||
@ -801,7 +801,7 @@ pub extern "C" fn csbindgen_ZSTD_getDictID_fromCDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getDictID_fromDDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getDictID_fromDDict(
|
||||
ddict: *const ZSTD_DDict
|
||||
) -> c_uint
|
||||
{
|
||||
@ -813,7 +813,7 @@ pub extern "C" fn csbindgen_ZSTD_getDictID_fromDDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_getDictID_fromFrame(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_getDictID_fromFrame(
|
||||
src: *const c_void,
|
||||
srcSize: usize
|
||||
) -> c_uint
|
||||
@ -827,7 +827,7 @@ pub extern "C" fn csbindgen_ZSTD_getDictID_fromFrame(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_loadDictionary(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_loadDictionary(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
dict: *const c_void,
|
||||
dictSize: usize
|
||||
@ -843,7 +843,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_loadDictionary(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_refCDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_refCDict(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
cdict: *const ZSTD_CDict
|
||||
) -> usize
|
||||
@ -857,7 +857,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_refCDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_CCtx_refPrefix(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_CCtx_refPrefix(
|
||||
cctx: *mut ZSTD_CCtx,
|
||||
prefix: *const c_void,
|
||||
prefixSize: usize
|
||||
@ -873,7 +873,7 @@ pub extern "C" fn csbindgen_ZSTD_CCtx_refPrefix(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DCtx_loadDictionary(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DCtx_loadDictionary(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
dict: *const c_void,
|
||||
dictSize: usize
|
||||
@ -889,7 +889,7 @@ pub extern "C" fn csbindgen_ZSTD_DCtx_loadDictionary(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DCtx_refDDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DCtx_refDDict(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
ddict: *const ZSTD_DDict
|
||||
) -> usize
|
||||
@ -903,7 +903,7 @@ pub extern "C" fn csbindgen_ZSTD_DCtx_refDDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_DCtx_refPrefix(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_DCtx_refPrefix(
|
||||
dctx: *mut ZSTD_DCtx,
|
||||
prefix: *const c_void,
|
||||
prefixSize: usize
|
||||
@ -919,7 +919,7 @@ pub extern "C" fn csbindgen_ZSTD_DCtx_refPrefix(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_CCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_CCtx(
|
||||
cctx: *const ZSTD_CCtx
|
||||
) -> usize
|
||||
{
|
||||
@ -931,7 +931,7 @@ pub extern "C" fn csbindgen_ZSTD_sizeof_CCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_DCtx(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_DCtx(
|
||||
dctx: *const ZSTD_DCtx
|
||||
) -> usize
|
||||
{
|
||||
@ -943,7 +943,7 @@ pub extern "C" fn csbindgen_ZSTD_sizeof_DCtx(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_CStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_CStream(
|
||||
zcs: *const ZSTD_CStream
|
||||
) -> usize
|
||||
{
|
||||
@ -955,7 +955,7 @@ pub extern "C" fn csbindgen_ZSTD_sizeof_CStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_DStream(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_DStream(
|
||||
zds: *const ZSTD_DStream
|
||||
) -> usize
|
||||
{
|
||||
@ -967,7 +967,7 @@ pub extern "C" fn csbindgen_ZSTD_sizeof_DStream(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_CDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_CDict(
|
||||
cdict: *const ZSTD_CDict
|
||||
) -> usize
|
||||
{
|
||||
@ -979,7 +979,7 @@ pub extern "C" fn csbindgen_ZSTD_sizeof_CDict(
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn csbindgen_ZSTD_sizeof_DDict(
|
||||
pub extern "C" fn csbindgen_zstd_ZSTD_sizeof_DDict(
|
||||
ddict: *const ZSTD_DDict
|
||||
) -> usize
|
||||
{
|
||||
|
@ -82,6 +82,21 @@ impl Builder {
|
||||
pub fn rust_method_prefix<T: Into<String>>(mut self, rust_method_prefix: T) -> Builder {
|
||||
self.options.rust_method_prefix = rust_method_prefix.into();
|
||||
self
|
||||
|
||||
}
|
||||
|
||||
/// configure C# class name(default is `NativeMethods`),
|
||||
/// `public static unsafe partial class {csharp_class_name}`
|
||||
pub fn csharp_class_name<T: Into<String>>(mut self, csharp_class_name: T) -> Builder {
|
||||
self.options.csharp_class_name = csharp_class_name.into();
|
||||
self
|
||||
}
|
||||
|
||||
/// configure C# load dll name,
|
||||
/// `[DllImport({csharp_dll_name})]`
|
||||
pub fn csharp_dll_name<T: Into<String>>(mut self, csharp_dll_name: T) -> Builder {
|
||||
self.options.csharp_dll_name = csharp_dll_name.into();
|
||||
self
|
||||
}
|
||||
|
||||
// pub fn generate_csharp_file<T: AsRef<Path>>(&self, csharp_output_path: T) -> io::Result<()> {
|
||||
@ -103,11 +118,11 @@ impl Builder {
|
||||
rust_output_path: P,
|
||||
csharp_output_path: P,
|
||||
) -> Result<(), Box<dyn Error>> {
|
||||
let (rust, csharp) = generate(&self.options)?;
|
||||
|
||||
let mut rust_file = make_file(rust_output_path)?;
|
||||
let mut csharp_file = make_file(csharp_output_path)?;
|
||||
|
||||
let (rust, csharp) = generate(&self.options)?;
|
||||
|
||||
rust_file.write_all(rust.as_bytes())?;
|
||||
rust_file.flush()?;
|
||||
|
||||
|
@ -89,14 +89,14 @@ pub fn emit_csharp(
|
||||
for item in methods {
|
||||
let method_name = &item.method_name;
|
||||
let return_type = match &item.return_type {
|
||||
Some(x) => x.to_csharp_string(&options),
|
||||
Some(x) => x.to_csharp_string(&options, &aliases),
|
||||
None => "void".to_string(),
|
||||
};
|
||||
|
||||
let parameters = item
|
||||
.parameters
|
||||
.iter()
|
||||
.map(|p| format!("{} {}", p.rust_type.to_csharp_string(&options), p.name))
|
||||
.map(|p| format!("{} {}", p.rust_type.to_csharp_string(&options, &aliases), p.escape_name()))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
|
||||
@ -109,15 +109,6 @@ pub fn emit_csharp(
|
||||
method_list_string.push_str("\n");
|
||||
}
|
||||
|
||||
let mut alias_string = String::new();
|
||||
let mut aliases: Vec<_> = aliases.iter().collect();
|
||||
aliases.sort_by_key(|x| x.0);
|
||||
for (name, rust_type) in aliases {
|
||||
alias_string.push_str_ln(
|
||||
format!(" using {} = {};", name, rust_type.to_csharp_string(&options)).as_str(),
|
||||
);
|
||||
}
|
||||
|
||||
let mut structs_string = String::new();
|
||||
for item in structs {
|
||||
let name = &item.struct_name;
|
||||
@ -138,7 +129,7 @@ pub fn emit_csharp(
|
||||
structs_string.push_str(
|
||||
format!(
|
||||
" public {} {}",
|
||||
field.rust_type.to_csharp_string(&options),
|
||||
field.rust_type.to_csharp_string(&options, &aliases),
|
||||
field.name
|
||||
)
|
||||
.as_str(),
|
||||
@ -168,8 +159,6 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace {namespace}
|
||||
{{
|
||||
{alias_string}
|
||||
|
||||
public static unsafe partial class {class_name}
|
||||
{{
|
||||
const string __DllName = \"{dll_name}\";
|
||||
|
@ -50,3 +50,17 @@ pub(crate) fn generate(options: &BindgenOptions) -> Result<(String, String), Box
|
||||
|
||||
return Ok((rust, csharp));
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn test() {
|
||||
// let path = std::env::current_dir().unwrap();
|
||||
// println!("starting dir: {}", path.display()); // csbindgen/csbindgen
|
||||
|
||||
// Builder::new()
|
||||
// .input_bindgen_file("../csbindgen-tests/src/quiche.rs")
|
||||
// .rust_method_prefix("csbindgen_quiche_")
|
||||
// .csharp_class_name("LibQuiche")
|
||||
// .csharp_dll_name("libquiche")
|
||||
// .generate_to_file("../csbindgen-tests/src/quiche_ffi.rs", "../csbindgen-tests/../dotnet-sandbox/quiche_bindgen.cs")
|
||||
// .unwrap();
|
||||
// }
|
||||
|
@ -1,5 +1,5 @@
|
||||
use std::collections::{HashSet, HashMap};
|
||||
use crate::type_meta::*;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use syn::{ForeignItem, Item, Pat, ReturnType};
|
||||
|
||||
pub fn collect_method(ast: &syn::File) -> Vec<ExternMethod> {
|
||||
@ -63,10 +63,25 @@ pub fn collect_type_alias(ast: &syn::File) -> Vec<(String, RustType)> {
|
||||
if let Item::Type(t) = item {
|
||||
let name = t.ident.to_string();
|
||||
let alias = parse_type(&t.ty);
|
||||
|
||||
// pointer can not use alias.
|
||||
if !alias.is_pointer || !alias.is_pointer_pointer {
|
||||
result.push((name, alias));
|
||||
result.push((name, alias));
|
||||
} else if let Item::Use(t) = item {
|
||||
if let syn::UseTree::Path(t) = &t.tree {
|
||||
if let syn::UseTree::Rename(t) = &*t.tree {
|
||||
let name = t.rename.to_string();
|
||||
let alias = t.ident.to_string();
|
||||
result.push((
|
||||
name,
|
||||
RustType {
|
||||
is_const: false,
|
||||
is_fixed_array: false,
|
||||
is_mut: false,
|
||||
is_pointer: false,
|
||||
is_pointer_pointer: false,
|
||||
fixed_array_digits : "".to_string(),
|
||||
type_name: alias.to_string(),
|
||||
},
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::builder::BindgenOptions;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@ -6,6 +8,26 @@ pub struct Parameter {
|
||||
pub rust_type: RustType,
|
||||
}
|
||||
|
||||
impl Parameter {
|
||||
pub fn escape_name(&self) -> String {
|
||||
match self.name.as_str() {
|
||||
// C# keywords: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/
|
||||
"abstract" | "as" | "base" | "bool" | "break" | "byte" | "case" | "catch" | "char"
|
||||
| "checked" | "class" | "const" | "continue" | "decimal" | "default" | "delegate"
|
||||
| "do" | "double" | "else" | "enum" | "event" | "explicit" | "extern" | "false"
|
||||
| "finally" | "fixed" | "float" | "for" | "foreach" | "goto" | "if" | "implicit"
|
||||
| "in" | "int" | "interface" | "internal" | "is" | "lock" | "long" | "namespace"
|
||||
| "new" | "null" | "object" | "operator" | "out" | "override" | "params"
|
||||
| "private" | "protected" | "public" | "readonly" | "ref" | "return" | "sbyte"
|
||||
| "sealed" | "short" | "sizeof" | "stackalloc" | "static" | "string" | "struct"
|
||||
| "switch" | "this" | "throw" | "true" | "try" | "typeof" | "uint" | "ulong"
|
||||
| "unchecked" | "unsafe" | "ushort" | "using" | "virtual" | "void" | "volatile"
|
||||
| "while" => "@".to_string() + self.name.as_str(),
|
||||
x => x.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct FieldMember {
|
||||
pub name: String,
|
||||
@ -80,53 +102,81 @@ impl RustType {
|
||||
sb
|
||||
}
|
||||
|
||||
pub fn to_csharp_string(&self, options: &BindgenOptions) -> String {
|
||||
pub fn to_csharp_string(
|
||||
&self,
|
||||
options: &BindgenOptions,
|
||||
alias_map: &HashMap<String, RustType>,
|
||||
) -> String {
|
||||
fn convert_type_name(type_name: &str, options: &BindgenOptions) -> String {
|
||||
let name = match type_name {
|
||||
// std::os::raw https://doc.rust-lang.org/std/os/raw/index.html
|
||||
"c_char" => "Byte",
|
||||
"c_schar" => "SByte",
|
||||
"c_uchar" => "Byte",
|
||||
"c_short" => "Int16",
|
||||
"c_ushort" => "UInt16",
|
||||
"c_int" => "Int32",
|
||||
"c_uint" => "UInt32",
|
||||
"c_char" => "byte",
|
||||
"c_schar" => "sbyte",
|
||||
"c_uchar" => "byte",
|
||||
"c_short" => "short",
|
||||
"c_ushort" => "ushort",
|
||||
"c_int" => "int",
|
||||
"c_uint" => "uint",
|
||||
"c_long" => &options.csharp_c_long_convert,
|
||||
"c_ulong" => &options.csharp_c_ulong_convert,
|
||||
"c_longlong" => "Int64",
|
||||
"c_ulonglong" => "UInt64",
|
||||
"c_float" => "Float",
|
||||
"c_double" => "Double",
|
||||
"c_longlong" => "long",
|
||||
"c_ulonglong" => "ulong",
|
||||
"c_float" => "float",
|
||||
"c_double" => "double",
|
||||
"c_void" => "void",
|
||||
// rust primitives
|
||||
"i8" => "SByte",
|
||||
"i16" => "Int16",
|
||||
"i32" => "Int32",
|
||||
"i64" => "Int64",
|
||||
"i8" => "sbyte",
|
||||
"i16" => "short",
|
||||
"i32" => "int",
|
||||
"i64" => "long",
|
||||
"i128" => "Int128", // .NET 7
|
||||
"isize" => "IntPtr",
|
||||
"u8" => "Byte",
|
||||
"u16" => "UInt16",
|
||||
"u32" => "UInt32",
|
||||
"u64" => "UInt64",
|
||||
"u8" => "byte",
|
||||
"u16" => "ushort",
|
||||
"u32" => "uint",
|
||||
"u64" => "ulong",
|
||||
"u128" => "UInt128", // .NET 7
|
||||
"f32" => "Float",
|
||||
"f64" => "Double",
|
||||
"bool" => "Boolean",
|
||||
"f32" => "float",
|
||||
"f64" => "double",
|
||||
"bool" => "bool",
|
||||
"usize" => "UIntPtr",
|
||||
"()" => "void", // if type is parameter, can't use in C#
|
||||
"()" => "void",
|
||||
_ => type_name, // as is
|
||||
};
|
||||
name.to_string()
|
||||
}
|
||||
|
||||
// resolve alias
|
||||
let (use_type, use_alias) = match alias_map.get(&self.type_name) {
|
||||
Some(x) => (x, true),
|
||||
None => (self, false),
|
||||
};
|
||||
|
||||
let mut sb = String::new();
|
||||
|
||||
if self.is_fixed_array {
|
||||
sb.push_str("fixed ");
|
||||
sb.push_str(convert_type_name(self.type_name.as_str(), &options).as_str());
|
||||
|
||||
let type_name = convert_type_name(use_type.type_name.as_str(), &options);
|
||||
let type_name = match type_name.as_str() {
|
||||
// C# fixed allow types
|
||||
"bool" | "byte" | "short" | "int" | "long" | "char" | "sbyte" | "ushort"
|
||||
| "uint" | "ulong" | "float" | "double" => type_name,
|
||||
_ => format!("byte/* {}, this length is invalid so must keep pointer and can't edit from C# */", type_name)
|
||||
};
|
||||
|
||||
sb.push_str(type_name.as_str());
|
||||
} else {
|
||||
sb.push_str(convert_type_name(self.type_name.as_str(), &options).as_str());
|
||||
sb.push_str(convert_type_name(use_type.type_name.as_str(), &options).as_str());
|
||||
if use_alias {
|
||||
if use_type.is_pointer {
|
||||
sb.push_str("*");
|
||||
}
|
||||
if use_type.is_pointer_pointer {
|
||||
sb.push_str("**");
|
||||
}
|
||||
}
|
||||
|
||||
if self.is_pointer {
|
||||
sb.push_str("*");
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
// See https://aka.ms/new-console-template for more information
|
||||
using Csbindgen;
|
||||
//using Csbindgen;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
unsafe
|
||||
{
|
||||
var v = NativeMethods.csbindgen_LZ4_versionString();
|
||||
//var v = NativeMethods.csbindgen_LZ4_versionString();
|
||||
|
||||
|
||||
//var bytes = new byte[] { 1, 10, 100, 100, 100, 100, 100, 100 };
|
||||
@ -19,8 +19,8 @@ unsafe
|
||||
//}
|
||||
|
||||
|
||||
var vvv = new string((sbyte*)v);
|
||||
// var vvv = new string((sbyte*)v);
|
||||
|
||||
Console.WriteLine(vvv);
|
||||
// Console.WriteLine(vvv);
|
||||
|
||||
}
|
||||
|
@ -7,87 +7,81 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace CsBindgen
|
||||
{
|
||||
using LZ4_byte = Byte;
|
||||
using LZ4_streamDecode_t = LZ4_streamDecode_u;
|
||||
using LZ4_stream_t = LZ4_stream_u;
|
||||
using LZ4_u32 = UInt32;
|
||||
|
||||
|
||||
public static unsafe partial class NativeMethods
|
||||
public static unsafe partial class LibLz4
|
||||
{
|
||||
const string __DllName = "";
|
||||
const string __DllName = "liblz4";
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_versionNumber();
|
||||
public static extern int LZ4_versionNumber();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Byte* LZ4_versionString();
|
||||
public static extern byte* LZ4_versionString();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_default(Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity);
|
||||
public static extern int LZ4_compress_default(byte* src, byte* dst, int srcSize, int dstCapacity);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe(Byte* src, Byte* dst, Int32 compressedSize, Int32 dstCapacity);
|
||||
public static extern int LZ4_decompress_safe(byte* src, byte* dst, int compressedSize, int dstCapacity);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compressBound(Int32 inputSize);
|
||||
public static extern int LZ4_compressBound(int inputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_fast(Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity, Int32 acceleration);
|
||||
public static extern int LZ4_compress_fast(byte* src, byte* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_sizeofState();
|
||||
public static extern int LZ4_sizeofState();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_fast_extState(void* state, Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity, Int32 acceleration);
|
||||
public static extern int LZ4_compress_fast_extState(void* state, byte* src, byte* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_destSize(Byte* src, Byte* dst, Int32* srcSizePtr, Int32 targetDstSize);
|
||||
public static extern int LZ4_compress_destSize(byte* src, byte* dst, int* srcSizePtr, int targetDstSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe_partial(Byte* src, Byte* dst, Int32 srcSize, Int32 targetOutputSize, Int32 dstCapacity);
|
||||
public static extern int LZ4_decompress_safe_partial(byte* src, byte* dst, int srcSize, int targetOutputSize, int dstCapacity);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern LZ4_stream_t* LZ4_createStream();
|
||||
public static extern LZ4_stream_u* LZ4_createStream();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_freeStream(LZ4_stream_t* streamPtr);
|
||||
public static extern int LZ4_freeStream(LZ4_stream_u* streamPtr);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void LZ4_resetStream_fast(LZ4_stream_t* streamPtr);
|
||||
public static extern void LZ4_resetStream_fast(LZ4_stream_u* streamPtr);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_loadDict(LZ4_stream_t* streamPtr, Byte* dictionary, Int32 dictSize);
|
||||
public static extern int LZ4_loadDict(LZ4_stream_u* streamPtr, byte* dictionary, int dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_fast_continue(LZ4_stream_t* streamPtr, Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity, Int32 acceleration);
|
||||
public static extern int LZ4_compress_fast_continue(LZ4_stream_u* streamPtr, byte* src, byte* dst, int srcSize, int dstCapacity, int acceleration);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_saveDict(LZ4_stream_t* streamPtr, Byte* safeBuffer, Int32 maxDictSize);
|
||||
public static extern int LZ4_saveDict(LZ4_stream_u* streamPtr, byte* safeBuffer, int maxDictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern LZ4_streamDecode_t* LZ4_createStreamDecode();
|
||||
public static extern LZ4_streamDecode_u* LZ4_createStreamDecode();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_freeStreamDecode(LZ4_streamDecode_t* LZ4_stream);
|
||||
public static extern int LZ4_freeStreamDecode(LZ4_streamDecode_u* LZ4_stream);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_setStreamDecode(LZ4_streamDecode_t* LZ4_streamDecode, Byte* dictionary, Int32 dictSize);
|
||||
public static extern int LZ4_setStreamDecode(LZ4_streamDecode_u* LZ4_streamDecode, byte* dictionary, int dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decoderRingBufferSize(Int32 maxBlockSize);
|
||||
public static extern int LZ4_decoderRingBufferSize(int maxBlockSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe_continue(LZ4_streamDecode_t* LZ4_streamDecode, Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity);
|
||||
public static extern int LZ4_decompress_safe_continue(LZ4_streamDecode_u* LZ4_streamDecode, byte* src, byte* dst, int srcSize, int dstCapacity);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe_usingDict(Byte* src, Byte* dst, Int32 srcSize, Int32 dstCapacity, Byte* dictStart, Int32 dictSize);
|
||||
public static extern int LZ4_decompress_safe_usingDict(byte* src, byte* dst, int srcSize, int dstCapacity, byte* dictStart, int dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe_partial_usingDict(Byte* src, Byte* dst, Int32 compressedSize, Int32 targetOutputSize, Int32 maxOutputSize, Byte* dictStart, Int32 dictSize);
|
||||
public static extern int LZ4_decompress_safe_partial_usingDict(byte* src, byte* dst, int compressedSize, int targetOutputSize, int maxOutputSize, byte* dictStart, int dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void __va_start(Byte** arg1);
|
||||
public static extern void __va_start(byte** arg1);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void __security_init_cookie();
|
||||
@ -96,61 +90,61 @@ namespace CsBindgen
|
||||
public static extern void __security_check_cookie(UIntPtr _StackCookie);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern LZ4_stream_t* LZ4_initStream(void* buffer, UIntPtr size);
|
||||
public static extern LZ4_stream_u* LZ4_initStream(void* buffer, UIntPtr size);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress(Byte* src, Byte* dest, Int32 srcSize);
|
||||
public static extern int LZ4_compress(byte* src, byte* dest, int srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_limitedOutput(Byte* src, Byte* dest, Int32 srcSize, Int32 maxOutputSize);
|
||||
public static extern int LZ4_compress_limitedOutput(byte* src, byte* dest, int srcSize, int maxOutputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_withState(void* state, Byte* source, Byte* dest, Int32 inputSize);
|
||||
public static extern int LZ4_compress_withState(void* state, byte* source, byte* dest, int inputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_limitedOutput_withState(void* state, Byte* source, Byte* dest, Int32 inputSize, Int32 maxOutputSize);
|
||||
public static extern int LZ4_compress_limitedOutput_withState(void* state, byte* source, byte* dest, int inputSize, int maxOutputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_continue(LZ4_stream_t* LZ4_streamPtr, Byte* source, Byte* dest, Int32 inputSize);
|
||||
public static extern int LZ4_compress_continue(LZ4_stream_u* LZ4_streamPtr, byte* source, byte* dest, int inputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_compress_limitedOutput_continue(LZ4_stream_t* LZ4_streamPtr, Byte* source, Byte* dest, Int32 inputSize, Int32 maxOutputSize);
|
||||
public static extern int LZ4_compress_limitedOutput_continue(LZ4_stream_u* LZ4_streamPtr, byte* source, byte* dest, int inputSize, int maxOutputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_uncompress(Byte* source, Byte* dest, Int32 outputSize);
|
||||
public static extern int LZ4_uncompress(byte* source, byte* dest, int outputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_uncompress_unknownOutputSize(Byte* source, Byte* dest, Int32 isize_, Int32 maxOutputSize);
|
||||
public static extern int LZ4_uncompress_unknownOutputSize(byte* source, byte* dest, int isize_, int maxOutputSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void* LZ4_create(Byte* inputBuffer);
|
||||
public static extern void* LZ4_create(byte* inputBuffer);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_sizeofStreamState();
|
||||
public static extern int LZ4_sizeofStreamState();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_resetStreamState(void* state, Byte* inputBuffer);
|
||||
public static extern int LZ4_resetStreamState(void* state, byte* inputBuffer);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Byte* LZ4_slideInputBuffer(void* state);
|
||||
public static extern byte* LZ4_slideInputBuffer(void* state);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_safe_withPrefix64k(Byte* src, Byte* dst, Int32 compressedSize, Int32 maxDstSize);
|
||||
public static extern int LZ4_decompress_safe_withPrefix64k(byte* src, byte* dst, int compressedSize, int maxDstSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_fast_withPrefix64k(Byte* src, Byte* dst, Int32 originalSize);
|
||||
public static extern int LZ4_decompress_fast_withPrefix64k(byte* src, byte* dst, int originalSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_fast(Byte* src, Byte* dst, Int32 originalSize);
|
||||
public static extern int LZ4_decompress_fast(byte* src, byte* dst, int originalSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_fast_continue(LZ4_streamDecode_t* LZ4_streamDecode, Byte* src, Byte* dst, Int32 originalSize);
|
||||
public static extern int LZ4_decompress_fast_continue(LZ4_streamDecode_u* LZ4_streamDecode, byte* src, byte* dst, int originalSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 LZ4_decompress_fast_usingDict(Byte* src, Byte* dst, Int32 originalSize, Byte* dictStart, Int32 dictSize);
|
||||
public static extern int LZ4_decompress_fast_usingDict(byte* src, byte* dst, int originalSize, byte* dictStart, int dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void LZ4_resetStream(LZ4_stream_t* streamPtr);
|
||||
public static extern void LZ4_resetStream(LZ4_stream_u* streamPtr);
|
||||
|
||||
|
||||
}
|
||||
@ -158,19 +152,19 @@ namespace CsBindgen
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct LZ4_stream_t_internal
|
||||
{
|
||||
public fixed LZ4_u32 hashTable[4096];
|
||||
public LZ4_byte* dictionary;
|
||||
public fixed uint hashTable[4096];
|
||||
public byte* dictionary;
|
||||
public LZ4_stream_t_internal* dictCtx;
|
||||
public LZ4_u32 currentOffset;
|
||||
public LZ4_u32 tableType;
|
||||
public LZ4_u32 dictSize;
|
||||
public uint currentOffset;
|
||||
public uint tableType;
|
||||
public uint dictSize;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Explicit)]
|
||||
public unsafe struct LZ4_stream_u
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public fixed Byte minStateSize[16416];
|
||||
public fixed byte minStateSize[16416];
|
||||
[FieldOffset(0)]
|
||||
public LZ4_stream_t_internal internal_donotuse;
|
||||
}
|
||||
@ -178,8 +172,8 @@ namespace CsBindgen
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct LZ4_streamDecode_t_internal
|
||||
{
|
||||
public LZ4_byte* externalDict;
|
||||
public LZ4_byte* prefixEnd;
|
||||
public byte* externalDict;
|
||||
public byte* prefixEnd;
|
||||
public UIntPtr extDictSize;
|
||||
public UIntPtr prefixSize;
|
||||
}
|
||||
@ -188,7 +182,7 @@ namespace CsBindgen
|
||||
public unsafe struct LZ4_streamDecode_u
|
||||
{
|
||||
[FieldOffset(0)]
|
||||
public fixed Byte minStateSize[32];
|
||||
public fixed byte minStateSize[32];
|
||||
[FieldOffset(0)]
|
||||
public LZ4_streamDecode_t_internal internal_donotuse;
|
||||
}
|
||||
|
1813
dotnet-sandbox/bullet3_bindgen.cs
Normal file
1813
dotnet-sandbox/bullet3_bindgen.cs
Normal file
File diff suppressed because it is too large
Load Diff
37643
dotnet-sandbox/quiche_bindgen.cs
Normal file
37643
dotnet-sandbox/quiche_bindgen.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -7,26 +7,12 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace CsBindgen
|
||||
{
|
||||
using ZSTD_CCtx = ZSTD_CCtx_s;
|
||||
using ZSTD_CDict = ZSTD_CDict_s;
|
||||
using ZSTD_CStream = ZSTD_CCtx_s;
|
||||
using ZSTD_DCtx = ZSTD_DCtx_s;
|
||||
using ZSTD_DDict = ZSTD_DDict_s;
|
||||
using ZSTD_DStream = ZSTD_DCtx_s;
|
||||
using ZSTD_EndDirective = Int32;
|
||||
using ZSTD_ResetDirective = Int32;
|
||||
using ZSTD_cParameter = Int32;
|
||||
using ZSTD_dParameter = Int32;
|
||||
using ZSTD_inBuffer = ZSTD_inBuffer_s;
|
||||
using ZSTD_outBuffer = ZSTD_outBuffer_s;
|
||||
|
||||
|
||||
public static unsafe partial class NativeMethods
|
||||
public static unsafe partial class LibZstd
|
||||
{
|
||||
const string __DllName = "";
|
||||
const string __DllName = "libzsd";
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void __va_start(Byte** arg1);
|
||||
public static extern void __va_start(byte** arg1);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern void __security_init_cookie();
|
||||
@ -35,22 +21,22 @@ namespace CsBindgen
|
||||
public static extern void __security_check_cookie(UIntPtr _StackCookie);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_versionNumber();
|
||||
public static extern uint ZSTD_versionNumber();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Byte* ZSTD_versionString();
|
||||
public static extern byte* ZSTD_versionString();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, Int32 compressionLevel);
|
||||
public static extern UIntPtr ZSTD_compress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_decompress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr compressedSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt64 ZSTD_getFrameContentSize(void* src, UIntPtr srcSize);
|
||||
public static extern ulong ZSTD_getFrameContentSize(void* src, UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt64 ZSTD_getDecompressedSize(void* src, UIntPtr srcSize);
|
||||
public static extern ulong ZSTD_getDecompressedSize(void* src, UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_findFrameCompressedSize(void* src, UIntPtr srcSize);
|
||||
@ -59,70 +45,70 @@ namespace CsBindgen
|
||||
public static extern UIntPtr ZSTD_compressBound(UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_isError(UIntPtr code);
|
||||
public static extern uint ZSTD_isError(UIntPtr code);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Byte* ZSTD_getErrorName(UIntPtr code);
|
||||
public static extern byte* ZSTD_getErrorName(UIntPtr code);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 ZSTD_minCLevel();
|
||||
public static extern int ZSTD_minCLevel();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 ZSTD_maxCLevel();
|
||||
public static extern int ZSTD_maxCLevel();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern Int32 ZSTD_defaultCLevel();
|
||||
public static extern int ZSTD_defaultCLevel();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_CCtx* ZSTD_createCCtx();
|
||||
public static extern ZSTD_CCtx_s* ZSTD_createCCtx();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeCCtx(ZSTD_CCtx* cctx);
|
||||
public static extern UIntPtr ZSTD_freeCCtx(ZSTD_CCtx_s* cctx);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compressCCtx(ZSTD_CCtx* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, Int32 compressionLevel);
|
||||
public static extern UIntPtr ZSTD_compressCCtx(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_DCtx* ZSTD_createDCtx();
|
||||
public static extern ZSTD_DCtx_s* ZSTD_createDCtx();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
||||
public static extern UIntPtr ZSTD_freeDCtx(ZSTD_DCtx_s* dctx);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_decompressDCtx(ZSTD_DCtx* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
|
||||
public static extern UIntPtr ZSTD_decompressDCtx(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam);
|
||||
public static extern ZSTD_bounds ZSTD_cParam_getBounds(int cParam);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, Int32 value);
|
||||
public static extern UIntPtr ZSTD_CCtx_setParameter(ZSTD_CCtx_s* cctx, int param, int value);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, UInt64 pledgedSrcSize);
|
||||
public static extern UIntPtr ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx_s* cctx, ulong pledgedSrcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset);
|
||||
public static extern UIntPtr ZSTD_CCtx_reset(ZSTD_CCtx_s* cctx, int reset);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compress2(ZSTD_CCtx* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
|
||||
public static extern UIntPtr ZSTD_compress2(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_bounds ZSTD_dParam_getBounds(ZSTD_dParameter dParam);
|
||||
public static extern ZSTD_bounds ZSTD_dParam_getBounds(int dParam);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DCtx_setParameter(ZSTD_DCtx* dctx, ZSTD_dParameter param, Int32 value);
|
||||
public static extern UIntPtr ZSTD_DCtx_setParameter(ZSTD_DCtx_s* dctx, int param, int value);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DCtx_reset(ZSTD_DCtx* dctx, ZSTD_ResetDirective reset);
|
||||
public static extern UIntPtr ZSTD_DCtx_reset(ZSTD_DCtx_s* dctx, int reset);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_CStream* ZSTD_createCStream();
|
||||
public static extern ZSTD_CCtx_s* ZSTD_createCStream();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeCStream(ZSTD_CStream* zcs);
|
||||
public static extern UIntPtr ZSTD_freeCStream(ZSTD_CCtx_s* zcs);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compressStream2(ZSTD_CCtx* cctx, ZSTD_outBuffer* output, ZSTD_inBuffer* input, ZSTD_EndDirective endOp);
|
||||
public static extern UIntPtr ZSTD_compressStream2(ZSTD_CCtx_s* cctx, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input, int endOp);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CStreamInSize();
|
||||
@ -131,28 +117,28 @@ namespace CsBindgen
|
||||
public static extern UIntPtr ZSTD_CStreamOutSize();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_initCStream(ZSTD_CStream* zcs, Int32 compressionLevel);
|
||||
public static extern UIntPtr ZSTD_initCStream(ZSTD_CCtx_s* zcs, int compressionLevel);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||
public static extern UIntPtr ZSTD_compressStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
||||
public static extern UIntPtr ZSTD_flushStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
||||
public static extern UIntPtr ZSTD_endStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_DStream* ZSTD_createDStream();
|
||||
public static extern ZSTD_DCtx_s* ZSTD_createDStream();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeDStream(ZSTD_DStream* zds);
|
||||
public static extern UIntPtr ZSTD_freeDStream(ZSTD_DCtx_s* zds);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_initDStream(ZSTD_DStream* zds);
|
||||
public static extern UIntPtr ZSTD_initDStream(ZSTD_DCtx_s* zds);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||
public static extern UIntPtr ZSTD_decompressStream(ZSTD_DCtx_s* zds, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DStreamInSize();
|
||||
@ -161,76 +147,76 @@ namespace CsBindgen
|
||||
public static extern UIntPtr ZSTD_DStreamOutSize();
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compress_usingDict(ZSTD_CCtx* ctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize, Int32 compressionLevel);
|
||||
public static extern UIntPtr ZSTD_compress_usingDict(ZSTD_CCtx_s* ctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize, int compressionLevel);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_decompress_usingDict(ZSTD_DCtx* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize);
|
||||
public static extern UIntPtr ZSTD_decompress_usingDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_CDict* ZSTD_createCDict(void* dictBuffer, UIntPtr dictSize, Int32 compressionLevel);
|
||||
public static extern ZSTD_CDict_s* ZSTD_createCDict(void* dictBuffer, UIntPtr dictSize, int compressionLevel);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeCDict(ZSTD_CDict* CDict);
|
||||
public static extern UIntPtr ZSTD_freeCDict(ZSTD_CDict_s* CDict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_compress_usingCDict(ZSTD_CCtx* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_CDict* cdict);
|
||||
public static extern UIntPtr ZSTD_compress_usingCDict(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_CDict_s* cdict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ZSTD_DDict* ZSTD_createDDict(void* dictBuffer, UIntPtr dictSize);
|
||||
public static extern ZSTD_DDict_s* ZSTD_createDDict(void* dictBuffer, UIntPtr dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_freeDDict(ZSTD_DDict* ddict);
|
||||
public static extern UIntPtr ZSTD_freeDDict(ZSTD_DDict_s* ddict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_decompress_usingDDict(ZSTD_DCtx* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_DDict* ddict);
|
||||
public static extern UIntPtr ZSTD_decompress_usingDDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_DDict_s* ddict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_getDictID_fromDict(void* dict, UIntPtr dictSize);
|
||||
public static extern uint ZSTD_getDictID_fromDict(void* dict, UIntPtr dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_getDictID_fromCDict(ZSTD_CDict* cdict);
|
||||
public static extern uint ZSTD_getDictID_fromCDict(ZSTD_CDict_s* cdict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_getDictID_fromDDict(ZSTD_DDict* ddict);
|
||||
public static extern uint ZSTD_getDictID_fromDDict(ZSTD_DDict_s* ddict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UInt32 ZSTD_getDictID_fromFrame(void* src, UIntPtr srcSize);
|
||||
public static extern uint ZSTD_getDictID_fromFrame(void* src, UIntPtr srcSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, void* dict, UIntPtr dictSize);
|
||||
public static extern UIntPtr ZSTD_CCtx_loadDictionary(ZSTD_CCtx_s* cctx, void* dict, UIntPtr dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, ZSTD_CDict* cdict);
|
||||
public static extern UIntPtr ZSTD_CCtx_refCDict(ZSTD_CCtx_s* cctx, ZSTD_CDict_s* cdict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_CCtx_refPrefix(ZSTD_CCtx* cctx, void* prefix, UIntPtr prefixSize);
|
||||
public static extern UIntPtr ZSTD_CCtx_refPrefix(ZSTD_CCtx_s* cctx, void* prefix, UIntPtr prefixSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DCtx_loadDictionary(ZSTD_DCtx* dctx, void* dict, UIntPtr dictSize);
|
||||
public static extern UIntPtr ZSTD_DCtx_loadDictionary(ZSTD_DCtx_s* dctx, void* dict, UIntPtr dictSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DCtx_refDDict(ZSTD_DCtx* dctx, ZSTD_DDict* ddict);
|
||||
public static extern UIntPtr ZSTD_DCtx_refDDict(ZSTD_DCtx_s* dctx, ZSTD_DDict_s* ddict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_DCtx_refPrefix(ZSTD_DCtx* dctx, void* prefix, UIntPtr prefixSize);
|
||||
public static extern UIntPtr ZSTD_DCtx_refPrefix(ZSTD_DCtx_s* dctx, void* prefix, UIntPtr prefixSize);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_CCtx(ZSTD_CCtx* cctx);
|
||||
public static extern UIntPtr ZSTD_sizeof_CCtx(ZSTD_CCtx_s* cctx);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_DCtx(ZSTD_DCtx* dctx);
|
||||
public static extern UIntPtr ZSTD_sizeof_DCtx(ZSTD_DCtx_s* dctx);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_CStream(ZSTD_CStream* zcs);
|
||||
public static extern UIntPtr ZSTD_sizeof_CStream(ZSTD_CCtx_s* zcs);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_DStream(ZSTD_DStream* zds);
|
||||
public static extern UIntPtr ZSTD_sizeof_DStream(ZSTD_DCtx_s* zds);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_CDict(ZSTD_CDict* cdict);
|
||||
public static extern UIntPtr ZSTD_sizeof_CDict(ZSTD_CDict_s* cdict);
|
||||
|
||||
[DllImport(__DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern UIntPtr ZSTD_sizeof_DDict(ZSTD_DDict* ddict);
|
||||
public static extern UIntPtr ZSTD_sizeof_DDict(ZSTD_DDict_s* ddict);
|
||||
|
||||
|
||||
}
|
||||
@ -238,21 +224,21 @@ namespace CsBindgen
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct ZSTD_CCtx_s
|
||||
{
|
||||
public fixed Byte _unused[1];
|
||||
public fixed byte _unused[1];
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct ZSTD_DCtx_s
|
||||
{
|
||||
public fixed Byte _unused[1];
|
||||
public fixed byte _unused[1];
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct ZSTD_bounds
|
||||
{
|
||||
public UIntPtr error;
|
||||
public Int32 lowerBound;
|
||||
public Int32 upperBound;
|
||||
public int lowerBound;
|
||||
public int upperBound;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@ -274,13 +260,13 @@ namespace CsBindgen
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct ZSTD_CDict_s
|
||||
{
|
||||
public fixed Byte _unused[1];
|
||||
public fixed byte _unused[1];
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct ZSTD_DDict_s
|
||||
{
|
||||
public fixed Byte _unused[1];
|
||||
public fixed byte _unused[1];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user