Giter VIP home page Giter VIP logo

fast-swap-for-c's Introduction

Fast Swap for C

Github releases Documentation Status Manual Build Status codecov.io Coverage Status Code Climate

Fast swap for C, any types to any types (gcc required), use only the header file fswap.h.

A functional combine producing swap objects of any types.

  • Automatic calculation of the size of the item to be exchanged (swapped)
  • Check the dimension of both elements.
  • Checking the identity of both elements.
  • High speed of data processing.
  • Support C99 and above.

Using

To connect to your project, you need to declare a one header file:

#include "fswap.h"

Call swap method:

/* obj1, obj2 - any C types. */
__swap_fast(obj1, obj2);

Add new types

If you use own structures in an array format, you will need to add their description to fswap.h, example:

 __builtin_choose_expr( \
   __builtin_types_compatible_p(__typeof__(A), struct my_struct[]), __swap_p(A, B, sizeof(A), sizeof(B)), \

Support types

Array full size swap types:
int[] const int[] unsigned int[] const unsigned int[]
short[] const short[] unsigned short[] const unsigned short[]
long[] const long[] unsigned long[] const unsigned long[]
long long[] const long long[] unsigned long long[] unsigned const long long[]
char[] const char[] unsigned char[] const unsigned char[]
Swap only pointer, types:
char* const char* unsigned char* const unsigned char*
void* const void* void*[] const void*[]
Full size swap types:
all other pointer C types

Inspire: ru.stackoverflow.com
OnLine example: coliru.stacked-crooked.com
Git repository: github
Web: home
Docs: readthedocs
Man: manual(3)

fast-swap-for-c's People

Contributors

peterssharp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.