Git Product home page Git Product logo

corec's Introduction

CoreC

GitHub license

C libraries that provide convenience APIs to common system and language functions

Purpose

C is very fast. But it is barebones. This library backports common Javascript functions to C.

Library APIs

ArrayHelper

/** Returns a generic array that contains the elements inputArray[start] ... inputArray[end] inclusively */
void* arraySlice(const void* inputArray, int startIndex, int endIndex, int sizePerElement);

StringHelper

/** Structure that allows 2D arrays (with the number of Strings) to be passed by value */
typedef struct Array {
    int length;
    char** values;
} StringArray;

/** Returns a String which contains a format for the values of each individual variable */
char* stringBuild(const char *format, ...);

/** A procedure that takes elements of a given string and put their values into individual variables */
void stringDisassemble(const char* input, const char* format, ...);

/** Returns the character values in the string */
char* stringCopy(const char* input);

/** If the substring is found in the searchString then return the index of the first character in the searchString. Otherwise, return -1. Note: This is case-sensitive */
int stringFind(const char* searchString, const char* subString);

/** Returns a new string with all matches of the old substring replaced by the new substring */
char* stringReplace(char* input, const char* oldSubString, const char* newSubString);

/** Returns a structure with: the array of strings split at each point where the separator occurs in the given input String and the number of strings in a 2D array. */
StringArray stringSplit(char* inputString, const char* seperatorString);

/** Returns the number of characters in the string */
int stringLength(const char* input);

/** Frees the memory used by a given StringArray input. Upon successful free-ing, num = -1. */
void freeStringArray(StringArray* input);

License

All source code in this repository is released under the MIT license. See LICENSE for details.

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.