text:
// MIT License
//
// Copyright (c) 2019 Remy Noulin
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#pragma once

#include "string.h"

// Class smallString
typedef struct smallString smallStringt;

/**
 * help text for this class
 * It is public declaration so that child classes can add their help text easily:
 * ret "Child help text \n\n" helpTextSmallString;
 */
#define helpTextSmallString "TODO smallString help brief, class description /*, definitions,*/ methods, examples"

// for object inheriting smallString, cast to smallString to be able to use this class functions and generics
#define cSt(self) ( (smallStringt*) self )

typedef void     (*freeSmallStringFt)      (smallStringt *self);
typedef void     (*terminateSmallStringFt) (smallStringt **self);
typedef char*    (*toStringSmallStringFt)  (smallStringt *self);
typedef smallStringt* (*duplicateSmallStringFt) (smallStringt *self);

// smallString functions
/**
 * free self but not the smallString buffer
 *
 * Useful when smallString buffer is shared or
 * when the buffer holds a static smallString
 */
typedef void     (*smashSmallStringFt)     (smallStringt **self);

/**
 * free container
 */
typedef void     (*finishSmallStringFt)    (smallStringt **self);

typedef const char* (*helpSmallStringFt)   (smallStringt *self);

/**
 * get a pointer to the string in smallString
 *
 * \return
 *   char*
 */
typedef char*    (*getSmallStringFt)       (smallStringt *self);

/**
 * set smallString
 *
 * \param
 *   string buffer to store in object (the buffer is duplicated)
 */
typedef smallStringt*     (*setSmallStringFt)           (smallStringt *self, const char *string);
typedef smallStringt*     (*setCharSmallStringFt)       (smallStringt *self, char c);
typedef smallStringt*     (*setNFreeSmallStringFt)      (smallStringt *self, char *string);

typedef smallStringt*     (*setBoolSmallStringFt)       (smallStringt* self, bool p2);
typedef smallStringt*     (*setDoubleSmallStringFt)     (smallStringt* self, double p2);
typedef smallStringt*     (*setInt64SmallStringFt)      (smallStringt* self, int64_t p2);
typedef smallStringt*     (*setInt32SmallStringFt)      (smallStringt* self, int32_t p2);
typedef smallStringt*     (*setUint32SmallStringFt)     (smallStringt* self, uint32_t p2);
typedef smallStringt*     (*setUint64SmallStringFt)     (smallStringt* self, uint64_t p2);
typedef smallStringt*     (*setSmallArraySmallStringFt) (smallStringt* self, smallArrayt* p2);
typedef smallStringt*     (*setFromSmallDictSmallStringFt)(smallStringt* self, smallDictt* p2);
typedef smallStringt*     (*setFromSmallJsonSmallStringFt)(smallStringt* self, smallJsont* p2);
typedef smallStringt*     (*setSmallBoolSmallStringFt)  (smallStringt* self, smallBoolt* p2);
typedef smallStringt*     (*setSmallDoubleSmallStringFt)(smallStringt* self, smallDoublet* p2);
typedef smallStringt*     (*setSmallIntSmallStringFt)   (smallStringt* self, smallIntt* p2);
typedef smallStringt*     (*setSmallJsonSmallStringFt)  (smallStringt* self, smallJsont* p2);
typedef smallStringt*     (*setSmallStringSmallStringFt)(smallStringt* self, smallStringt* p2);

/**
 * append smallString to self
 *
 * \param
 *  smallString smallString to append at the end of self
 */
typedef smallStringt*     (*appendSmallStringFt)               (smallStringt *self, smallStringt *string);
typedef smallStringt*     (*appendSmallJsonSmallStringFt)      (smallStringt *self, smallJsont *string);
typedef smallStringt*     (*appendSSmallStringFt)              (smallStringt *self, char *string);
typedef smallStringt*     (*appendCharSmallStringFt)           (smallStringt *self, char c);
typedef smallStringt*     (*appendNSmashSmallStringFt)         (smallStringt *self, smallStringt *string);
typedef smallStringt*     (*appendNSmashSmallJsonSmallStringFt)(smallStringt *self, smallJsont *string);
typedef smallStringt*     (*appendNSmashSSmallStringFt)        (smallStringt *self, char *string);

/**
 * prepend string
 * append string at the beginning of the list
 * when string is NULL, the operation is canceled
 *
 * \param
 *   string: string to prepend
 */
typedef smallStringt*     (*prependSmallStringFt)               (smallStringt *self, smallStringt *string);
typedef smallStringt*     (*prependSmallJsonSmallStringFt)      (smallStringt *self, smallJsont *json);
typedef smallStringt*     (*prependSSmallStringFt)              (smallStringt *self, char *string);
typedef smallStringt*     (*prependCharSmallStringFt)           (smallStringt *self, char c);
typedef smallStringt*     (*prependNSmashSmallStringFt)         (smallStringt *self, smallStringt *string);
typedef smallStringt*     (*prependNSmashSmallJsonSmallStringFt)(smallStringt *self, smallJsont *json);
typedef smallStringt*     (*prependNSmashSSmallStringFt)        (smallStringt *self, char *string);

/**
 * cat string
 *
 * append all strings in the list to self
 *
 * \param
 *   arbitrary list of strings seperated by commas
 */
typedef smallStringt*      (*catSmallStringFt)          (smallStringt *self, ...);
typedef smallStringt*      (*catSSmallStringFt)         (smallStringt *self, ...);

/**
 * push many strings and free
 *
 * \param
 *   arbitrary list of smallStringt or char* strings seperated by commas
 */
typedef smallStringt*      (*pushNFreeManySmallStringFt) (smallStringt *self, ...);
typedef smallStringt*      (*pushNFreeManySSmallStringFt)(smallStringt *self, ...);

/**
 * replace
 * the olds smallString is replaced with the news smallString max times in the result
 * 0 for max means replace all olds smallStrings
 *
 * \param
 *   olds: old smallString to be replaced in self
 * \param
 *   news: new smallString replacing olds in self
 * \param
 *   max: number of times to replace olds, 0 to replace all found olds
 * \return
 *   0  modified self
 *   -1 s not modified when self buffer is NULL or empty and when olds is empty
 */
typedef smallStringt*      (*replaceSmallStringFt)                      (smallStringt *self, const char *olds, const char *news, size_t max);
typedef smallStringt*      (*replaceCharSSmallStringFt)                 (smallStringt *self, char olds, const char *news, size_t max);
typedef smallStringt*      (*replaceSCharSmallStringFt)                 (smallStringt *self, const char *olds, char news, size_t max);
typedef smallStringt*      (*replaceCharCharSmallStringFt)              (smallStringt *self, char olds, char news, size_t max);
typedef smallStringt*      (*replaceSmallJsonSmallJsonSmallStringFt)    (smallStringt *self, smallJsont *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*replaceSmallJsonSmallStringSmallStringFt)  (smallStringt *self, smallJsont *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*replaceSmallJsonSSmallStringFt)            (smallStringt *self, smallJsont *olds, const char *news, size_t max);
typedef smallStringt*      (*replaceSmallJsonCharSmallStringFt)         (smallStringt *self, smallJsont *olds, char news, size_t max);
typedef smallStringt*      (*replaceSmallStringSmallJsonSmallStringFt)  (smallStringt *self, smallStringt *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*replaceSmallStringSmallStringSmallStringFt)(smallStringt *self, smallStringt *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*replaceSmallStringSSmallStringFt)          (smallStringt *self, smallStringt *olds, const char *news, size_t max);
typedef smallStringt*      (*replaceSmallStringCharSmallStringFt)       (smallStringt *self, smallStringt *olds, char news, size_t max);
typedef smallStringt*      (*replaceSSmallJsonSmallStringFt)            (smallStringt *self, const char *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*replaceSSmallStringSmallStringFt)          (smallStringt *self, const char *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*replaceCharSmallJsonSmallStringFt)         (smallStringt *self, char olds, smallJsont *news, size_t max);
typedef smallStringt*      (*replaceCharSmallStringSmallStringFt)       (smallStringt *self, char olds, smallStringt *news, size_t max);

/**
 * replace Many Strings
 * the olds string is replaced with the news string max times in the result
 *
 * Example:
 * replaceMany(self, "s",  "BNM", "a",  "AAA")
 *                          ^olds ^news  ^olds ^news
 *
 * \param
 *   self
 *   olds: old string to be replaced in s
 *   news: new string replacing olds in s
 *   ...
 * \return
 *   0  modified string
 *   -1 not modified when s is empty, when s is NULL, when only 2 parameters are given,
 *     when any olds is empty
 */
typedef smallStringt*      (*replaceManySmallStringFt)(smallStringt *self, const char *paramType, ...);

/**
 * ignore case replace
 * the olds smallString is replaced with the news smallString max times in the result
 * 0 for max means replace all olds smallStrings
 *
 * \param
 *   olds: old smallString to be replaced in self
 * \param
 *   news: new smallString replacing olds in self
 * \param
 *   max: number of times to replace olds, 0 to replace all found olds
 * \return
 *   0  modified self
 *   -1 s not modified when self buffer is NULL or empty and when olds is empty
 */
typedef smallStringt*      (*icReplaceSmallStringFt)                      (smallStringt *self, const char *olds, const char *news, size_t max);
typedef smallStringt*      (*icReplaceCharSSmallStringFt)                 (smallStringt *self, char olds, const char *news, size_t max);
typedef smallStringt*      (*icReplaceSCharSmallStringFt)                 (smallStringt *self, const char *olds, char news, size_t max);
typedef smallStringt*      (*icReplaceCharCharSmallStringFt)              (smallStringt *self, char olds, char news, size_t max);
typedef smallStringt*      (*icReplaceSmallJsonSmallJsonSmallStringFt)    (smallStringt *self, smallJsont *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*icReplaceSmallJsonSmallStringSmallStringFt)  (smallStringt *self, smallJsont *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*icReplaceSmallJsonSSmallStringFt)            (smallStringt *self, smallJsont *olds, const char *news, size_t max);
typedef smallStringt*      (*icReplaceSmallJsonCharSmallStringFt)         (smallStringt *self, smallJsont *olds, char news, size_t max);
typedef smallStringt*      (*icReplaceSmallStringSmallJsonSmallStringFt)  (smallStringt *self, smallStringt *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*icReplaceSmallStringSmallStringSmallStringFt)(smallStringt *self, smallStringt *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*icReplaceSmallStringSSmallStringFt)          (smallStringt *self, smallStringt *olds, const char *news, size_t max);
typedef smallStringt*      (*icReplaceSmallStringCharSmallStringFt)       (smallStringt *self, smallStringt *olds, char news, size_t max);
typedef smallStringt*      (*icReplaceSSmallJsonSmallStringFt)            (smallStringt *self, const char *olds, smallJsont *news, size_t max);
typedef smallStringt*      (*icReplaceSSmallStringSmallStringFt)          (smallStringt *self, const char *olds, smallStringt *news, size_t max);
typedef smallStringt*      (*icReplaceCharSmallJsonSmallStringFt)         (smallStringt *self, char olds, smallJsont *news, size_t max);
typedef smallStringt*      (*icReplaceCharSmallStringSmallStringFt)       (smallStringt *self, char olds, smallStringt *news, size_t max);

/**
 * ignore case replace Many Strings
 * the olds string is replaced with the news string max times in the result
 *
 * Example:
 * replaceMany(self, "s",  "BNM", "a",  "AAA")
 *                          ^olds ^news  ^olds ^news
 *
 * \param
 *   self
 *   olds: old string to be replaced in s
 *   news: new string replacing olds in s
 *   ...
 * \return
 *   0  modified string
 *   -1 not modified when s is empty, when s is NULL, when only 2 parameters are given,
 *     when any olds is empty
 */
typedef smallStringt*      (*icReplaceManySmallStringFt)(smallStringt *self, const char *paramType, ...);

/**
 * equal
 * compare self to smallString
 *
 * \param
 *   smallString to compare
 * \return
 *   true the smallStrings have identical content
 *   false they differ
 */
typedef bool     (*equalSmallStringFt)        (smallStringt *self, smallStringt *string);

/**
 * equal
 * compare self to smallString
 *
 * \param
 *   smallString to compare
 * \return
 *   true the smallStrings have identical content
 *   false they differ
 */
typedef bool     (*equalSSmallStringFt)       (smallStringt *self, const char *string);
typedef bool     (*equalCharSmallStringFt)    (smallStringt *self, char c);

typedef bool     (*equalSmallStringBaseFt)    (smallStringt* self, baset* p2);
typedef bool     (*equalSmallStringBoolFt)    (smallStringt* self, bool p2);
typedef bool     (*equalSmallStringDoubleFt)  (smallStringt* self, double p2);
typedef bool     (*equalSmallStringInt64Ft)   (smallStringt* self, int64_t p2);
typedef bool     (*equalSmallStringInt32Ft)   (smallStringt* self, int32_t p2);
typedef bool     (*equalSmallStringUint32Ft)  (smallStringt* self, uint32_t p2);
typedef bool     (*equalSmallStringUint64Ft)  (smallStringt* self, uint64_t p2);
typedef bool     (*equalSmallStringSmallBoolFt)(smallStringt* self, smallBoolt* p2);
typedef bool     (*equalSmallStringSmallBytesFt)(smallStringt* self, smallBytest* p2);
typedef bool     (*equalSmallStringSmallDoubleFt)(smallStringt* self, smallDoublet* p2);
typedef bool     (*equalSmallStringSmallIntFt)(smallStringt* self, smallIntt* p2);
typedef bool     (*equalSmallStringSmallJsonFt)(smallStringt* self, smallJsont* p2);

/**
 * ignore case equal
 * compare self to smallString
 *
 * \param
 *   smallString to compare
 * \return
 *   true the smallStrings have identical content
 *   false they differ
 */
typedef bool     (*icEqualSmallStringFt)        (smallStringt *self, smallStringt *string);

/**
 * ignore case equal
 * compare self to smallString
 *
 * \param
 *   smallString to compare
 * \return
 *   true the smallStrings have identical content
 *   false they differ
 */
typedef bool     (*icEqualSSmallStringFt)       (smallStringt *self, const char *string);
typedef bool     (*icEqualCharSmallStringFt)    (smallStringt *self, char c);

typedef bool     (*icEqualSmallStringBaseFt)     (smallStringt* self, baset* p2);
typedef bool     (*icEqualSmallStringSmallJsonFt)(smallStringt* self, smallJsont* p2);

/**
 * equal at Index
 * compare self at index to smallString
 *
 * \param
 *   smallString to compare
 * \return
 *   true smallString at index is equal to string
 *   false they differ
 */
typedef bool     (*equalISSmallStringFt)          (smallStringt *self, const char *string, intmax_t index);
typedef bool     (*equalICharSmallStringFt)       (smallStringt *self, char c, intmax_t index);
typedef bool     (*equalISmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string, intmax_t index);
typedef bool     (*equalISmallStringSmallStringFt)(smallStringt *self, smallStringt *string, intmax_t index);

/**
 * starts With String
 * compare start of self with string
 *
 * \param
 *   string
 * \return
 *   true when self starts with string
 *   false for other cases
 */
typedef bool     (*startsWithSSmallStringFt)          (smallStringt *self, const char *string);
typedef bool     (*startsWithCharSmallStringFt)       (smallStringt *self, char c);
typedef bool     (*startsWithSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef bool     (*startsWithSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * ends With String
 * compare end of self with string
 *
 * \param
 *   string
 * \return
 *   true when self ends with string2
 *   false for other cases
 */
typedef bool     (*endsWithSSmallStringFt)          (smallStringt *self, const char *string);
typedef bool     (*endsWithCharSmallStringFt)       (smallStringt *self, char c);
typedef bool     (*endsWithSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef bool     (*endsWithSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * count String
 * count number of (non-overlapping) occurrences of a substring
 *
 * Example:
 *   assert(countS("aaa aaa", "a") == 6);
 *   assert(countS("aaa aaa", "ab") == 0);
 *   assert(countS("aaa aaa", "aa") == 2);
 *
 * \param
 *   string
 * \return
 *   string count
 *   -1 when there is an error
 */
typedef ssize_t  (*countSSmallStringFt)          (smallStringt *self, const char *string);
typedef ssize_t  (*countCharSmallStringFt)       (smallStringt *self, char c);
typedef ssize_t  (*countSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef ssize_t  (*countSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * ignore case starts With String
 * compare start of self with string
 *
 * \param
 *   string
 * \return
 *   true when self starts with string
 *   false for other cases
 */
typedef bool     (*icStartsWithSSmallStringFt)          (smallStringt *self, const char *string);
typedef bool     (*icStartsWithCharSmallStringFt)       (smallStringt *self, char c);
typedef bool     (*icStartsWithSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef bool     (*icStartsWithSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * ignore case ends With String
 * compare end of self with string
 *
 * \param
 *   string
 * \return
 *   true when self ends with string2
 *   false for other cases
 */
typedef bool     (*icEndsWithSSmallStringFt)          (smallStringt *self, const char *string);
typedef bool     (*icEndsWithCharSmallStringFt)       (smallStringt *self, char c);
typedef bool     (*icEndsWithSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef bool     (*icEndsWithSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * ignore case count String
 * count number of (non-overlapping) occurrences of a substring
 *
 * Example:
 *   assert(countS("aaa aaa", "a") == 6);
 *   assert(countS("aaa aaa", "ab") == 0);
 *   assert(countS("aaa aaa", "aa") == 2);
 *
 * \param
 *   string
 * \return
 *   string count
 *   -1 when there is an error
 */
typedef ssize_t  (*icCountSSmallStringFt)          (smallStringt *self, const char *string);
typedef ssize_t  (*icCountCharSmallStringFt)       (smallStringt *self, char c);
typedef ssize_t  (*icCountSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *string);
typedef ssize_t  (*icCountSmallStringSmallStringFt)(smallStringt *self, smallStringt *string);

/**
 * is Number (integer or float) String
 *
 * 1, -12
 * 1e+4, .44E-1
 *
 * \param
 *   string
 * \return
 *   true when string is a number
 *   false when string is not a number or string is empty or NULL
 */
typedef bool (*isNumberSmallStringFt) (smallStringt *self);

/**
 * is Integer String
 *
 * \param
 *   string
 * \return
 *   true when string is an integer
 *   false when string is not an integer or string is empty or NULL
 */
typedef bool (*isIntSmallStringFt) (smallStringt *self);

/**
 * convert self to decimal integer
 *
 * \return
 *   int64_t
 *   0 when smallString represents 0 or doesnt represent a number or the input is NULL
 *   INTMAX_MAX or INTMAX_MIN for strtoimax parse errors.
 */
typedef intmax_t (*parseIntSmallStringFt)  (smallStringt *self);

/**
 * convert self to double
 *
 * \return
 *   double
 *   0 when smallString represents 0 or doesnt represent a number or the input is NULL
 */
typedef double (*parseDoubleSmallStringFt)  (smallStringt *self);

/**
 * int To SmallString
 *
 * convert int to smallString, assign result to self
 *
 * \param
 *   intmax_t number
 */
typedef smallStringt*     (*intToSmallStringFt)     (smallStringt *self, intmax_t n);

/**
 * double To String
 *
 * convert int to string
 *
 * \param
 *   double number
 */
typedef smallStringt*     (*doubleToSmallStringFt)             (smallStringt *self, double n);

/**
 * length
 * \return
 *   smallString length
 */
typedef size_t   (*lenSmallStringFt)       (smallStringt *self);

/**
 * upper case self
 */
typedef smallStringt*      (*upperSmallStringFt)     (smallStringt *self);

/**
 * lower case self
 */
typedef smallStringt*      (*lowerSmallStringFt)     (smallStringt *self);

/**
 * remove leading and trailing white spaces (spaces and tabs) in self
 */
typedef smallStringt*      (*trimSmallStringFt)      (smallStringt *self);
typedef smallStringt*      (*lTrimSmallStringFt)     (smallStringt *self);
typedef smallStringt*      (*rTrimSmallStringFt)     (smallStringt *self);

/**
 * uniq String
 *
 * remove successive repetitions of char c
 *
 * \param
 *   string
 *   c character to remove
 * \return
 *   string without successive repetitions of char c
 *   0 ok
 *   -1 error
 */
typedef smallStringt*      (*uniqSmallStringFt)      (smallStringt *self, char c);

/**
 * ignore case uniq String
 *
 * remove successive repetitions of char c
 *
 * \param
 *   string
 *   c character to remove
 * \return
 *   string without successive repetitions of char c
 *   0 ok
 *   -1 error
 */
typedef smallStringt*      (*icUniqSmallStringFt)    (smallStringt *self, char c);

/**
 * get char at python index
 */
typedef char     (*getAtSmallStringFt)     (smallStringt *self, intmax_t index);

/**
 * set char at python index
 */
typedef smallStringt*      (*setAtSmallStringFt)     (smallStringt *self, intmax_t index, char c);

/**
 * slice self
 * self becomes the smallString between start and end
 * negative indexes are allowed
 *
 * \param
 *   start: start index, must be in the smallString
 * \param
 *   end: end index, must be in the smallString after start
 * \return
 *   0  sliced smallString
 *      "" when start=end
 *   -1 unchanged smallString when start and end are not set correctly
 */
typedef smallStringt*      (*sliceSmallStringFt)     (smallStringt *self, intmax_t start, intmax_t end);

/**
 * copy string between start and end
 * self becomes the smallString between start and end
 * negative indexes are allowed
 *
 * \param
 *   start: start index, must be in the smallString
 * \param
 *   end: end index, must be in the smallString after start
 * \return
 *   new sliced smallString
 *      "" when start=end
 *   NULL when start and end are not set correctly
 */
typedef smallStringt* (*copySmallStringFt) (smallStringt *self, intmax_t start, intmax_t end);

/**
 * insert smallString in self at index
 *
 * return smallString with toInsert at index
 * negative indexes are allowed
 * index -1 is the end of the array and is equivalent to index len
 *
 * \param
 *   index in smallString
 * \param
 *   toInsert smallString
 * \return
 *   self smallString
 *   NULL unchanged smallString when smallString is NULL or invalid index
 */
typedef smallStringt*      (*insertSmallStringFt)              (smallStringt *self, intmax_t index, smallStringt *toInsert);
typedef smallStringt*      (*insertSmallJsonSmallStringFt)     (smallStringt *self, intmax_t index, smallJsont *toInsert);
typedef smallStringt*      (*insertSSmallStringFt)             (smallStringt *self, intmax_t index, const char *toInsert);
typedef smallStringt*      (*insertNFreeSmallStringFt)         (smallStringt *self, intmax_t index, smallStringt *toInsert);
typedef smallStringt*      (*insertNFreeSmallJsonSmallStringFt)(smallStringt *self, intmax_t index, smallJsont *toInsert);
typedef smallStringt*      (*insertSNFreeSmallStringFt)        (smallStringt *self, intmax_t index, char *toInsert);

/**
 * inject a char in self at index
 *
 * return smallString with toInject at index
 * negative indexes are allowed
 * index -1 is the end of the array and is equivalent to index len
 *
 * \param
 *   index in smallString
 * \param
 *   toInject char
 * \return
 *   self smallString
 *   NULL unchanged smallString when smallString is NULL or invalid index
 */
typedef smallStringt*      (*injectSmallStringFt)    (smallStringt *self, intmax_t index, char toInject);

/**
 * delete smallString
 *
 * delete the smallString between start and end in self
 * negative indexes are allowed
 *
 * \param
 *   start: start index, must be in the smallString
 * \param
 *   end: end index, must be in the smallString after start
 * \return
 *   0  sliced smallString
 *      unchanged smallString when start=end
 *   -1 when start and end are not set correctly
 *        or when input smallString is NULL or when malloc failed or when end is under start
 */
typedef smallStringt*      (*delSmallStringFt)       (smallStringt *self, intmax_t start, intmax_t end);
typedef smallStringt*      (*delElemSmallStringFt)   (smallStringt *self, intmax_t index);

/**
 * has SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   pointer to first occurence of needle in smallString
 *   NULL when needle is not found
 *   NULL when smallString or needle are NULL
 */
typedef char*    (*hasSmallStringFt)           (smallStringt *self, const char *needle);
typedef char*    (*hasCharSmallStringFt)       (smallStringt *self, char c);
typedef char*    (*hasSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef char*    (*hasSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * find SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   new smallStringt smallString of first occurence of needle in smallString
 *   NULL when needle is not found
 *   NULL when smallString or needle are NULL
 */
typedef smallStringt* (*findSmallStringFt)           (smallStringt *self, const char *needle);
typedef smallStringt* (*findCharSmallStringFt)       (smallStringt *self, char c);
typedef smallStringt* (*findSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef smallStringt* (*findSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * indexOf SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   index of first occurence of needle in smallString
 *   -1 when needle is not found
 *   -1 when smallString or needle are NULL
 */
typedef ssize_t (*indexOfSmallStringFt)           (smallStringt *self, const char *needle);
typedef ssize_t (*indexOfCharSmallStringFt)       (smallStringt *self, char c);
typedef ssize_t (*indexOfSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef ssize_t (*indexOfSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * ignore case has SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   pointer to first occurence of needle in smallString
 *   NULL when needle is not found
 *   NULL when smallString or needle are NULL
 */
typedef char*    (*icHasSmallStringFt)           (smallStringt *self, const char *needle);
typedef char*    (*icHasCharSmallStringFt)       (smallStringt *self, char c);
typedef char*    (*icHasSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef char*    (*icHasSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * ignore case find SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   new smallStringt smallString of first occurence of needle in smallString
 *   NULL when needle is not found
 *   NULL when smallString or needle are NULL
 */
typedef smallStringt* (*icFindSmallStringFt)           (smallStringt *self, const char *needle);
typedef smallStringt* (*icFindCharSmallStringFt)       (smallStringt *self, char c);
typedef smallStringt* (*icFindSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef smallStringt* (*icFindSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * ignore case indexOf SmallString
 *
 * \param
 *   needle: smallString to find
 * \return
 *   index of first occurence of needle in smallString
 *   -1 when needle is not found
 *   -1 when smallString or needle are NULL
 */
typedef ssize_t (*icIndexOfSmallStringFt)           (smallStringt *self, const char *needle);
typedef ssize_t (*icIndexOfCharSmallStringFt)       (smallStringt *self, char c);
typedef ssize_t (*icIndexOfSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *needle);
typedef ssize_t (*icIndexOfSmallStringSmallStringFt)(smallStringt *self, smallStringt *needle);

/**
 * empty self
 *
 * free self and set empty smallString
 */
typedef smallStringt*      (*emptySmallStringFt)     (smallStringt *self);

/**
 * is Empty SmallString
 *
 * \return
 *   false when there are characters in the smallString
 *   true when smallString is empty
 *   true when smallString is NULL
 */
typedef bool     (*isEmptySmallStringFt)   (smallStringt *self);

/**
 * is Blank SmallString
 *
 * \return
 *   false when there are non white space characters in the smallString
 *   true when there are only white spaces in the smallString
 *   true when smallString is empty
 *   true when smallString is NULL
 */
typedef bool     (*isBlankSmallStringFt)   (smallStringt *self);

/**
 * split self with delim smallString
 * return smallStringArray
 *
 * \param
 *   delim delimiter
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef smallArrayt* (*splitSmallStringFt)           (smallStringt *self, const char *delim);
typedef smallArrayt* (*splitCharSmallStringFt)       (smallStringt *self, char c);
typedef smallArrayt* (*splitSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *delim);
typedef smallArrayt* (*splitSmallStringSmallStringFt)(smallStringt *self, smallStringt *delim);

/**
 * split self with delim smallString
 * return list
 *
 * \param
 *   delim delimiter
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef char**   (*splitSSmallStringFt)           (smallStringt *self, const char *delim);
typedef char**   (*splitCharSSmallStringFt)       (smallStringt *self, char c);
typedef char**   (*splitSmallJsonSSmallStringFt)  (smallStringt *self, smallJsont *delim);
typedef char**   (*splitSmallStringSSmallStringFt)(smallStringt *self, smallStringt *delim);

/**
 * extract string between delim1 and delim2 strings
 * return list
 *
 * \param
 *   string to split
 *   delim1 first delimiter
 *   delim2 second delimiter, has to be different from delim1
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef smallArrayt* (*extractSmallStringFt)        (smallStringt *self, const char* delim1, const char* delim2);
typedef smallArrayt* (*extractCharSSmallStringFt)   (smallStringt *self, char delim1, const char* delim2);
typedef smallArrayt* (*extractSCharSmallStringFt)   (smallStringt *self, const char* delim1, char delim2);
typedef smallArrayt* (*extractCharCharSmallStringFt)(smallStringt *self, char delim1, char delim2);
typedef smallArrayt* (*extractSmallJsonSmallJsonSmallStringFt)    (smallStringt *self, smallJsont* delim1, smallJsont* delim2);
typedef smallArrayt* (*extractSmallJsonSmallStringSmallStringFt)  (smallStringt *self, smallJsont* delim1, smallStringt* delim2);
typedef smallArrayt* (*extractSmallJsonSSmallStringFt)            (smallStringt *self, smallJsont* delim1, const char* delim2);
typedef smallArrayt* (*extractSmallJsonCharSmallStringFt)         (smallStringt *self, smallJsont* delim1, char delim2);
typedef smallArrayt* (*extractSmallStringSmallJsonSmallStringFt)  (smallStringt *self, smallStringt* delim1, smallJsont* delim2);
typedef smallArrayt* (*extractSmallStringSmallStringSmallStringFt)(smallStringt *self, smallStringt* delim1, smallStringt* delim2);
typedef smallArrayt* (*extractSmallStringSSmallStringFt)          (smallStringt *self, smallStringt* delim1, const char* delim2);
typedef smallArrayt* (*extractSmallStringCharSmallStringFt)       (smallStringt *self, smallStringt* delim1, char delim2);
typedef smallArrayt* (*extractSSmallJsonSmallStringFt)            (smallStringt *self, const char* delim1, smallJsont* delim2);
typedef smallArrayt* (*extractSSmallStringSmallStringFt)          (smallStringt *self, const char* delim1, smallStringt* delim2);
typedef smallArrayt* (*extractCharSmallJsonSmallStringFt)         (smallStringt *self, char delim1, smallJsont* delim2);
typedef smallArrayt* (*extractCharSmallStringSmallStringFt)       (smallStringt *self, char delim1, smallStringt* delim2);

/**
 * ignore case split self with delim smallString
 * return smallStringArray
 *
 * \param
 *   delim delimiter
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef smallArrayt* (*icSplitSmallStringFt)           (smallStringt *self, const char *delim);
typedef smallArrayt* (*icSplitCharSmallStringFt)       (smallStringt *self, char c);
typedef smallArrayt* (*icSplitSmallJsonSmallStringFt)  (smallStringt *self, smallJsont *delim);
typedef smallArrayt* (*icSplitSmallStringSmallStringFt)(smallStringt *self, smallStringt *delim);

/**
 * ignore case split self with delim smallString
 * return list
 *
 * \param
 *   delim delimiter
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef char**   (*icSplitSSmallStringFt)           (smallStringt *self, const char *delim);
typedef char**   (*icSplitCharSSmallStringFt)       (smallStringt *self, char c);
typedef char**   (*icSplitSmallJsonSSmallStringFt)  (smallStringt *self, smallJsont *delim);
typedef char**   (*icSplitSmallStringSSmallStringFt)(smallStringt *self, smallStringt *delim);

/**
 * ignore case extract string between delim1 and delim2 strings
 * return list
 *
 * \param
 *   string to split
 *   delim1 first delimiter
 *   delim2 second delimiter, has to be different from delim1
 * \return
 *   list of tokens
 *   NULL when list or delim are NULL
 */
typedef smallArrayt* (*icExtractSmallStringFt)        (smallStringt *self, const char* delim1, const char* delim2);
typedef smallArrayt* (*icExtractCharSSmallStringFt)   (smallStringt *self, char delim1, const char* delim2);
typedef smallArrayt* (*icExtractSCharSmallStringFt)   (smallStringt *self, const char* delim1, char delim2);
typedef smallArrayt* (*icExtractCharCharSmallStringFt)(smallStringt *self, char delim1, char delim2);
typedef smallArrayt* (*icExtractSmallJsonSmallJsonSmallStringFt)    (smallStringt *self, smallJsont* delim1, smallJsont* delim2);
typedef smallArrayt* (*icExtractSmallJsonSmallStringSmallStringFt)  (smallStringt *self, smallJsont* delim1, smallStringt* delim2);
typedef smallArrayt* (*icExtractSmallJsonSSmallStringFt)            (smallStringt *self, smallJsont* delim1, const char* delim2);
typedef smallArrayt* (*icExtractSmallJsonCharSmallStringFt)         (smallStringt *self, smallJsont* delim1, char delim2);
typedef smallArrayt* (*icExtractSmallStringSmallJsonSmallStringFt)  (smallStringt *self, smallStringt* delim1, smallJsont* delim2);
typedef smallArrayt* (*icExtractSmallStringSmallStringSmallStringFt)(smallStringt *self, smallStringt* delim1, smallStringt* delim2);
typedef smallArrayt* (*icExtractSmallStringSSmallStringFt)          (smallStringt *self, smallStringt* delim1, const char* delim2);
typedef smallArrayt* (*icExtractSmallStringCharSmallStringFt)       (smallStringt *self, smallStringt* delim1, char delim2);
typedef smallArrayt* (*icExtractSSmallJsonSmallStringFt)            (smallStringt *self, const char* delim1, smallJsont* delim2);
typedef smallArrayt* (*icExtractSSmallStringSmallStringFt)          (smallStringt *self, const char* delim1, smallStringt* delim2);
typedef smallArrayt* (*icExtractCharSmallJsonSmallStringFt)         (smallStringt *self, char delim1, smallJsont* delim2);
typedef smallArrayt* (*icExtractCharSmallStringSmallStringFt)       (smallStringt *self, char delim1, smallStringt* delim2);

/**
 * color self for terminal
 *
 * Use the color/effect defines in this file for the color parameter.
 * Effects and colors can be combined.
 *
 * \param
 *   color color/effect code
 */
typedef smallStringt*     (*colorSmallStringFt)     (smallStringt *self, const char *colr);

/**
 * color self for terminal
 *
 * Use the color/effect defines in this file for the color parameter.
 * Effects and colors can be combined.
 *
 * \param
 *   color color/effect code
 * \return
 *   duplicated self with colors
 */
typedef char*    (*colordSmallStringFt)    (smallStringt *self, const char *color);

/**
 * read file to string
 *
 * 0 is added at the end to terminate the string
 *
 * \param
 *   filePath: path to file
 * \return
 *   0 data in file
 *   -1 an error occured
 */
typedef smallStringt* (*readFileSmallStringFt)(smallStringt *self, const char *filePath);
typedef smallStringt* (*readFileSmallJsonSmallStringFt)(smallStringt *self, smallJsont *filePath);
typedef smallStringt* (*readFileSmallStringSmallStringFt)(smallStringt *self, smallStringt *filePath);
typedef smallStringt* (*readStreamSmallStringFt)(smallStringt *self, FILE *fp);

/**
 * write string to file
 *
 * \param
 *   filePath path to file
 *   string
 * \return
 *   1 success
 *   0 error
 */
typedef int (*writeFileSmallStringFt)(smallStringt *self, const char *filePath);
typedef int (*writeFileSmallJsonSmallStringFt)(smallStringt *self, smallJsont *filePath);
typedef int (*writeFileSmallStringSmallStringFt)(smallStringt *self, smallStringt *filePath);
typedef int (*writeStreamSmallStringFt)(smallStringt *self, FILE *fp);

/**
 * append string to filePath
 *
 * \param
 *   filePath
 *   list
 * \return
 *   true success
 *   false failed, filePath or string are NULL
 */
typedef int (*appendFileSmallStringFt)(smallStringt *self, const char *filePath);
typedef int (*appendFileSmallStringSmallStringFt)(smallStringt *self, smallStringt *filePath);

/**
 * class functions
 * allocated once for all objects
 *
 * freed with finalizeSmallString or finalizeLibsheepy
 */

/**
 * use this define in child classes and add the new function after this class functions
 *
 * in this define, add the methods after <finishClassTemplateFt    finish;>
 *
 * Example:
 * #define RINGFUNCTIONST \
 *   CLASSTEMPLATEFUNCTIONST; \
 *   setSizeRingFt           setSize
 */
#define SMALLSTRINGFUNCTIONST \
  helpSmallStringFt                     help;\
  getSmallStringFt                      get;\
  setSmallStringFt                      set;\
  setBoolSmallStringFt                  setBool;\
  setDoubleSmallStringFt                setDouble;\
  setInt64SmallStringFt                 setInt64;\
  setInt32SmallStringFt                 setInt32;\
  setUint32SmallStringFt                setUint32;\
  setUint64SmallStringFt                setUint64;\
  setSmallArraySmallStringFt            setSmallArray;\
  setCharSmallStringFt                  setChar;\
  setFromSmallDictSmallStringFt         setFromSmallDict;\
  setFromSmallJsonSmallStringFt         setFromSmallJson;\
  setSmallBoolSmallStringFt             setSmallBool;\
  setSmallDoubleSmallStringFt           setSmallDouble;\
  setSmallIntSmallStringFt              setSmallInt;\
  setSmallJsonSmallStringFt             setSmallJson;\
  setSmallStringSmallStringFt           setSmallString;\
  setNFreeSmallStringFt                 setNFree;\
  appendSmallStringFt                   append;\
  appendSmallJsonSmallStringFt          appendSmallJson;\
  appendSSmallStringFt                  appendS;\
  appendNSmashSmallStringFt             appendNSmash;\
  appendNSmashSmallJsonSmallStringFt    appendNSmashSmallJson;\
  appendNSmashSSmallStringFt            appendNSmashS;\
  appendCharSmallStringFt               appendChar;\
  appendSSmallStringFt                  push;\
  catSmallStringFt                      pushMany;\
  catSSmallStringFt                     pushManyS;\
  pushNFreeManySmallStringFt            pushNFreeMany;\
  pushNFreeManySSmallStringFt           pushNFreeManyS;\
  prependSmallStringFt                  prepend;\
  prependSmallJsonSmallStringFt         prependSmallJson;\
  prependSSmallStringFt                 prependS;\
  prependCharSmallStringFt              prependChar;\
  prependNSmashSmallStringFt            prependNSmash;\
  prependNSmashSmallJsonSmallStringFt   prependNSmashSmallJson;\
  prependNSmashSSmallStringFt           prependNSmashS;\
  catSmallStringFt                      cat;\
  catSSmallStringFt                     catSt;\
  replaceSmallStringFt                  replace;\
  replaceCharSSmallStringFt             replaceCharS;\
  replaceSCharSmallStringFt             replaceSChar;\
  replaceCharCharSmallStringFt          replaceCharChar;\
  replaceSmallJsonSmallJsonSmallStringFt replaceSmallJsonSmallJson;\
  replaceSmallJsonSmallStringSmallStringFt replaceSmallJsonSmallString;\
  replaceSmallJsonSSmallStringFt        replaceSmallJsonS;\
  replaceSmallJsonCharSmallStringFt     replaceSmallJsonChar;\
  replaceSmallStringSmallJsonSmallStringFt replaceSmallStringSmallJson;\
  replaceSmallStringSmallStringSmallStringFt replaceSmallStringSmallString;\
  replaceSmallStringSSmallStringFt      replaceSmallStringS;\
  replaceSmallStringCharSmallStringFt   replaceSmallStringChar;\
  replaceSSmallJsonSmallStringFt        replaceSSmallJson;\
  replaceSSmallStringSmallStringFt      replaceSSmallString;\
  replaceCharSmallJsonSmallStringFt     replaceCharSmallJson;\
  replaceCharSmallStringSmallStringFt   replaceCharSmallString;\
  replaceManySmallStringFt              replaceMany;\
  icReplaceSmallStringFt                icReplace;\
  icReplaceCharSSmallStringFt           icReplaceCharS;\
  icReplaceSCharSmallStringFt           icReplaceSChar;\
  icReplaceCharCharSmallStringFt        icReplaceCharChar;\
  icReplaceSmallJsonSmallJsonSmallStringFt icReplaceSmallJsonSmallJson;\
  icReplaceSmallJsonSmallStringSmallStringFt icReplaceSmallJsonSmallString;\
  icReplaceSmallJsonSSmallStringFt      icReplaceSmallJsonS;\
  icReplaceSmallJsonCharSmallStringFt   icReplaceSmallJsonChar;\
  icReplaceSmallStringSmallJsonSmallStringFt icReplaceSmallStringSmallJson;\
  icReplaceSmallStringSmallStringSmallStringFt icReplaceSmallStringSmallString;\
  icReplaceSmallStringSSmallStringFt    icReplaceSmallStringS;\
  icReplaceSmallStringCharSmallStringFt icReplaceSmallStringChar;\
  icReplaceSSmallJsonSmallStringFt      icReplaceSSmallJson;\
  icReplaceSSmallStringSmallStringFt    icReplaceSSmallString;\
  icReplaceCharSmallJsonSmallStringFt   icReplaceCharSmallJson;\
  icReplaceCharSmallStringSmallStringFt icReplaceCharSmallString;\
  icReplaceManySmallStringFt            icReplaceMany;\
  equalSmallStringFt                    equal;\
  equalSSmallStringFt                   equalS;\
  equalCharSmallStringFt                equalChar;\
  equalSmallStringBaseFt                equalBase;\
  equalSmallStringBoolFt                equalBool;\
  equalSmallStringDoubleFt              equalDouble;\
  equalSmallStringInt64Ft               equalInt64;\
  equalSmallStringInt32Ft               equalInt32;\
  equalSmallStringUint32Ft              equalUint32;\
  equalSmallStringUint64Ft              equalUint64;\
  equalSmallStringSmallBoolFt           equalSmallBool;\
  equalSmallStringSmallBytesFt          equalSmallBytes;\
  equalSmallStringSmallDoubleFt         equalSmallDouble;\
  equalSmallStringSmallIntFt            equalSmallInt;\
  equalSmallStringSmallJsonFt           equalSmallJson;\
  icEqualSmallStringFt                  icEqual;\
  icEqualSSmallStringFt                 icEqualS;\
  icEqualCharSmallStringFt              icEqualChar;\
  icEqualSmallStringBaseFt              icEqualBase;\
  icEqualSmallStringSmallJsonFt         icEqualSmallJson;\
  equalISSmallStringFt                  equalIS;\
  equalICharSmallStringFt               equalIChar;\
  equalISmallJsonSmallStringFt          equalISmallJson;\
  equalISmallStringSmallStringFt        equalISmallString;\
  startsWithSSmallStringFt              startsWithS;\
  startsWithCharSmallStringFt           startsWithChar;\
  startsWithSmallJsonSmallStringFt      startsWithSmallJson;\
  startsWithSmallStringSmallStringFt    startsWithSmallString;\
  endsWithSSmallStringFt                endsWithS;\
  endsWithCharSmallStringFt             endsWithChar;\
  endsWithSmallJsonSmallStringFt        endsWithSmallJson;\
  endsWithSmallStringSmallStringFt      endsWithSmallString;\
  countSSmallStringFt                   countS;\
  countCharSmallStringFt                countChar;\
  countSmallJsonSmallStringFt           countSmallJson;\
  countSmallStringSmallStringFt         countSmallString;\
  icStartsWithSSmallStringFt            icStartsWithS;\
  icStartsWithCharSmallStringFt         icStartsWithChar;\
  icStartsWithSmallJsonSmallStringFt    icStartsWithSmallJson;\
  icStartsWithSmallStringSmallStringFt  icStartsWithSmallString;\
  icEndsWithSSmallStringFt              icEndsWithS;\
  icEndsWithCharSmallStringFt           icEndsWithChar;\
  icEndsWithSmallJsonSmallStringFt      icEndsWithSmallJson;\
  icEndsWithSmallStringSmallStringFt    icEndsWithSmallString;\
  icCountSSmallStringFt                 icCountS;\
  icCountCharSmallStringFt              icCountChar;\
  icCountSmallJsonSmallStringFt         icCountSmallJson;\
  icCountSmallStringSmallStringFt       icCountSmallString;\
  isNumberSmallStringFt                 isNumber;\
  isIntSmallStringFt                    isInt;\
  parseIntSmallStringFt                 parseInt;\
  parseDoubleSmallStringFt              parseDouble;\
  intToSmallStringFt                    intTo;\
  doubleToSmallStringFt                 doubleTo;\
  lenSmallStringFt                      len;\
  upperSmallStringFt                    upper;\
  lowerSmallStringFt                    lower;\
  trimSmallStringFt                     trim;\
  lTrimSmallStringFt                    lTrim;\
  rTrimSmallStringFt                    rTrim;\
  uniqSmallStringFt                     uniq;\
  icUniqSmallStringFt                   icUniq;\
  getAtSmallStringFt                    getAt;\
  setAtSmallStringFt                    setAt;\
  sliceSmallStringFt                    slice;\
  copySmallStringFt                     copy;\
  insertSmallStringFt                   insert;\
  insertSmallJsonSmallStringFt          insertSmallJson;\
  insertSSmallStringFt                  insertS;\
  insertNFreeSmallJsonSmallStringFt     insertNFreeSmallJson;\
  insertNFreeSmallStringFt              insertNFree;\
  insertSNFreeSmallStringFt             insertSNFree;\
  injectSmallStringFt                   inject;\
  delSmallStringFt                      del;\
  delElemSmallStringFt                  delElem;\
  hasSmallStringFt                      has;\
  hasCharSmallStringFt                  hasChar;\
  hasSmallJsonSmallStringFt             hasSmallJson;\
  hasSmallStringSmallStringFt           hasSmallString;\
  findSmallStringFt                     find;\
  findCharSmallStringFt                 findChar;\
  findSmallJsonSmallStringFt            findSmallJson;\
  findSmallStringSmallStringFt          findSmallString;\
  indexOfSmallStringFt                  indexOf;\
  indexOfCharSmallStringFt              indexOfChar;\
  indexOfSmallJsonSmallStringFt         indexOfSmallJson;\
  indexOfSmallStringSmallStringFt       indexOfSmallString;\
  icHasSmallStringFt                    icHas;\
  icHasCharSmallStringFt                icHasChar;\
  icHasSmallJsonSmallStringFt           icHasSmallJson;\
  icHasSmallStringSmallStringFt         icHasSmallString;\
  icFindSmallStringFt                   icFind;\
  icFindCharSmallStringFt               icFindChar;\
  icFindSmallJsonSmallStringFt          icFindSmallJson;\
  icFindSmallStringSmallStringFt        icFindSmallString;\
  icIndexOfSmallStringFt                icIndexOf;\
  icIndexOfCharSmallStringFt            icIndexOfChar;\
  icIndexOfSmallJsonSmallStringFt       icIndexOfSmallJson;\
  icIndexOfSmallStringSmallStringFt     icIndexOfSmallString;\
  emptySmallStringFt                    empty;\
  isEmptySmallStringFt                  isEmpty;\
  isBlankSmallStringFt                  isBlank;\
  splitSmallStringFt                    split;\
  splitCharSmallStringFt                splitChar;\
  splitSmallJsonSmallStringFt           splitSmallJson;\
  splitSmallStringSmallStringFt         splitSmallString;\
  splitSSmallStringFt                   splitS;\
  splitCharSSmallStringFt               splitCharS;\
  splitSmallJsonSSmallStringFt          splitSmallJsonS;\
  splitSmallStringSSmallStringFt        splitSmallStringS;\
  extractSmallStringFt                  extract;\
  extractCharSSmallStringFt             extractCharS;\
  extractSCharSmallStringFt             extractSChar;\
  extractCharCharSmallStringFt          extractCharChar;\
  extractSmallJsonSmallJsonSmallStringFt   extractSmallJsonSmallJson;\
  extractSmallJsonSmallStringSmallStringFt extractSmallJsonSmallString;\
  extractSmallJsonSSmallStringFt           extractSmallJsonS;\
  extractSmallJsonCharSmallStringFt        extractSmallJsonChar;\
  extractSmallStringSmallJsonSmallStringFt   extractSmallStringSmallJson;\
  extractSmallStringSmallStringSmallStringFt extractSmallStringSmallString;\
  extractSmallStringSSmallStringFt      extractSmallStringS;\
  extractSmallStringCharSmallStringFt   extractSmallStringChar;\
  extractSSmallJsonSmallStringFt        extractSSmallJson;\
  extractSSmallStringSmallStringFt      extractSSmallString;\
  extractCharSmallJsonSmallStringFt     extractCharSmallJson;\
  extractCharSmallStringSmallStringFt   extractCharSmallString;\
  icSplitSmallStringFt                  icSplit;\
  icSplitCharSmallStringFt              icSplitChar;\
  icSplitSmallJsonSmallStringFt         icSplitSmallJson;\
  icSplitSmallStringSmallStringFt       icSplitSmallString;\
  icSplitSSmallStringFt                 icSplitS;\
  icSplitCharSSmallStringFt             icSplitCharS;\
  icSplitSmallJsonSSmallStringFt        icSplitSmallJsonS;\
  icSplitSmallStringSSmallStringFt      icSplitSmallStringS;\
  icExtractSmallStringFt                icExtract;\
  icExtractCharSSmallStringFt           icExtractCharS;\
  icExtractSCharSmallStringFt           icExtractSChar;\
  icExtractCharCharSmallStringFt        icExtractCharChar;\
  icExtractSmallJsonSmallJsonSmallStringFt   icExtractSmallJsonSmallJson;\
  icExtractSmallJsonSmallStringSmallStringFt icExtractSmallJsonSmallString;\
  icExtractSmallJsonSSmallStringFt           icExtractSmallJsonS;\
  icExtractSmallJsonCharSmallStringFt        icExtractSmallJsonChar;\
  icExtractSmallStringSmallJsonSmallStringFt icExtractSmallStringSmallJson;\
  icExtractSmallStringSmallStringSmallStringFt icExtractSmallStringSmallString;\
  icExtractSmallStringSSmallStringFt           icExtractSmallStringS;\
  icExtractSmallStringCharSmallStringFt        icExtractSmallStringChar;\
  icExtractSSmallJsonSmallStringFt      icExtractSSmallJson;\
  icExtractSSmallStringSmallStringFt    icExtractSSmallString;\
  icExtractCharSmallJsonSmallStringFt   icExtractCharSmallJson;\
  icExtractCharSmallStringSmallStringFt icExtractCharSmallString;\
  colorSmallStringFt                    color;\
  colordSmallStringFt                   colord;\
  readFileSmallStringFt                 readFile;\
  readFileSmallJsonSmallStringFt        readFileSmallJson;\
  readFileSmallStringSmallStringFt      readFileSmallString;\
  readStreamSmallStringFt               readStream;\
  writeFileSmallStringFt                writeFile;\
  writeFileSmallJsonSmallStringFt       writeFileSmallJson;\
  writeFileSmallStringSmallStringFt     writeFileSmallString;\
  writeStreamSmallStringFt              writeStream;\
  appendFileSmallStringFt               appendFile;\
  appendFileSmallStringSmallStringFt    appendFileSmallString

typedef struct {
  freeSmallStringFt                     free;
  terminateSmallStringFt                terminate;
  toStringSmallStringFt                 toString;
  duplicateSmallStringFt                duplicate;
  smashSmallStringFt                    smash;
  finishSmallStringFt                   finish;
  SMALLSTRINGFUNCTIONST;
} smallStringFunctionst;

/**
 * class
 */
struct smallString {
  const char *type;
  smallStringFunctionst *f;

  // internal
  sStringt *data;
  size_t _len;
};

// base

#define createSmallString(obj) ;smallStringt obj; initiateSmallString(&obj)
#define createAllocateSmallString(obj) ;smallStringt *obj; initiateAllocateSmallString(&obj)

void initiateSmallString(smallStringt *self);
void initiateAllocateSmallString(smallStringt **self);
void finalizeRecycleSmallString(void *arg UNUSED);
void finalizeSmallString(void);

// initialize class methods, call registerMethodsSmallString from classes inheriting this class
void registerMethodsSmallString(smallStringFunctionst *f);

smallStringt* allocSmallString(const char *string);

/**
 * create String: f("qwd ", str," werr ", str2)
 * like catS, concatenate strings to a new smallString
 */
smallStringt* createSF(const char *paramType, ...);
#define createS(...) createSF("", __VA_ARGS__, NULL)

smallStringt* duplicateSmallStringG (smallStringt *self);

void freeSmallStringG          (smallStringt *self);

smallStringt* setBoolSmallStringG       (smallStringt* self, bool p2);
smallStringt* setDoubleSmallStringG     (smallStringt* self, double p2);
smallStringt* setInt64SmallStringG      (smallStringt* self, int64_t p2);
smallStringt* setInt32SmallStringG      (smallStringt* self, int32_t p2);
smallStringt* setUint32SmallStringG     (smallStringt* self, uint32_t p2);
smallStringt* setUint64SmallStringG     (smallStringt* self, uint64_t p2);
smallStringt* setCharSmallStringG       (smallStringt *self, char c);
smallStringt* setSmallStringG           (smallStringt* self, const char* p2);
smallStringt* setSmallArraySmallStringG (smallStringt* self, smallArrayt* p2);
smallStringt* setFromSmallDictSmallStringG(smallStringt* self, smallDictt* p2);
smallStringt* setFromSmallJsonSmallStringG(smallStringt* self, smallJsont* p2);
smallStringt* setSmallBoolSmallStringG  (smallStringt* self, smallBoolt* p2);
smallStringt* setSmallDoubleSmallStringG(smallStringt* self, smallDoublet* p2);
smallStringt* setSmallIntSmallStringG   (smallStringt* self, smallIntt* p2);
smallStringt* setSmallJsonSmallStringG  (smallStringt* self, smallJsont* p2);
smallStringt* setSmallStringSmallStringG(smallStringt* self, smallStringt* p2);

char getAtSmallStringG        (smallStringt *self, char retType UNUSED, intmax_t index);
smallStringt* setAtSmallStringG         (smallStringt *self, intmax_t index, char c);

smallStringt* appendSmallStringG               (smallStringt *self, smallStringt *string);
smallStringt* appendSmallJsonSmallStringG      (smallStringt *self, smallJsont *string);
smallStringt* appendSSmallStringG              (smallStringt *self, const char *string);
smallStringt* appendCharSmallStringG           (smallStringt *self, char c);
smallStringt* appendNSmashSmallStringG         (smallStringt *self, smallStringt *smallString);
smallStringt* appendNSmashSmallJsonSmallStringG(smallStringt *self, smallJsont *string);
smallStringt* appendNSmashSSmallStringG        (smallStringt *self, char *string);

smallStringt* prependSmallStringG      (smallStringt *self, smallStringt *string);
smallStringt* prependSmallJsonSmallStringG(smallStringt *self, smallJsont *json);
smallStringt* prependSSmallStringG     (smallStringt *self, const char *string);
smallStringt* prependCharSmallStringG  (smallStringt *self, char c);
smallStringt* prependNSmashSmallStringG(smallStringt *self, smallStringt *string);
smallStringt* prependNSmashSmallJsonSmallStringG(smallStringt *self, smallJsont *json);
smallStringt* prependNSmashSSmallStringG(smallStringt *self, char *string);
smallStringt* replaceSmallStringG      (smallStringt *self, const char *olds, const char *news, size_t max);
smallStringt* replaceCharSSmallStringG (smallStringt *self, char olds, const char *news, size_t max);
smallStringt* replaceSCharSmallStringG (smallStringt *self, const char *olds, char news, size_t max);
smallStringt* replaceCharCharSmallStringG(smallStringt *self, char olds, char news, size_t max);
smallStringt* replaceSmallJsonSmallJsonSmallStringG(smallStringt *self, smallJsont *olds, smallJsont *news, size_t max);
smallStringt* replaceSmallJsonSmallStringSmallStringG(smallStringt *self, smallJsont *olds, smallStringt *news, size_t max);
smallStringt* replaceSmallJsonSSmallStringG(smallStringt *self, smallJsont *olds, const char *news, size_t max);
smallStringt* replaceSmallJsonCharSmallStringG(smallStringt *self, smallJsont *olds, char news, size_t max);
smallStringt* replaceSmallStringSmallJsonSmallStringG(smallStringt *self, smallStringt *olds, smallJsont *news, size_t max);
smallStringt* replaceSmallStringSmallStringSmallStringG(smallStringt *self, smallStringt *olds, smallStringt *news, size_t max);
smallStringt* replaceSmallStringSSmallStringG(smallStringt *self, smallStringt *olds, const char *news, size_t max);
smallStringt* replaceSmallStringCharSmallStringG(smallStringt *self, smallStringt *olds, char news, size_t max);
smallStringt* replaceSSmallJsonSmallStringG(smallStringt *self, const char *olds, smallJsont *news, size_t max);
smallStringt* replaceSSmallStringSmallStringG(smallStringt *self, const char *olds, smallStringt *news, size_t max);
smallStringt* replaceCharSmallJsonSmallStringG(smallStringt *self, char olds, smallJsont *news, size_t max);
smallStringt* replaceCharSmallStringSmallStringG(smallStringt *self, char olds, smallStringt *news, size_t max);
smallStringt* icReplaceSmallStringG    (smallStringt *self, const char *olds, const char *news, size_t max);
smallStringt* icReplaceCharSSmallStringG(smallStringt *self, char olds, const char *news, size_t max);
smallStringt* icReplaceSCharSmallStringG(smallStringt *self, const char *olds, char news, size_t max);
smallStringt* icReplaceCharCharSmallStringG(smallStringt *self, char olds, char news, size_t max);
smallStringt* icReplaceSmallJsonSmallJsonSmallStringG(smallStringt *self, smallJsont *olds, smallJsont *news, size_t max);
smallStringt* icReplaceSmallJsonSmallStringSmallStringG(smallStringt *self, smallJsont *olds, smallStringt *news, size_t max);
smallStringt* icReplaceSmallJsonSSmallStringG(smallStringt *self, smallJsont *olds, const char *news, size_t max);
smallStringt* icReplaceSmallJsonCharSmallStringG(smallStringt *self, smallJsont *olds, char news, size_t max);
smallStringt* icReplaceSmallStringSmallJsonSmallStringG(smallStringt *self, smallStringt *olds, smallJsont *news, size_t max);
smallStringt* icReplaceSmallStringSmallStringSmallStringG(smallStringt *self, smallStringt *olds, smallStringt *news, size_t max);
smallStringt* icReplaceSmallStringSSmallStringG(smallStringt *self, smallStringt *olds, const char *news, size_t max);
smallStringt* icReplaceSmallStringCharSmallStringG(smallStringt *self, smallStringt *olds, char news, size_t max);
smallStringt* icReplaceSSmallJsonSmallStringG(smallStringt *self, const char *olds, smallJsont *news, size_t max);
smallStringt* icReplaceSSmallStringSmallStringG(smallStringt *self, const char *olds, smallStringt *news, size_t max);
smallStringt* icReplaceCharSmallJsonSmallStringG(smallStringt *self, char olds, smallJsont *news, size_t max);
smallStringt* icReplaceCharSmallStringSmallStringG(smallStringt *self, char olds, smallStringt *news, size_t max);
bool equalSmallStringBaseG    (smallStringt* self, baset* p2);
bool equalSmallStringBoolG    (smallStringt* self, bool p2);
bool equalSmallStringDoubleG  (smallStringt* self, double p2);
bool equalSmallStringInt64G   (smallStringt* self, int64_t p2);
bool equalSmallStringInt32G   (smallStringt* self, int32_t p2);
bool equalSmallStringUint32G  (smallStringt* self, uint32_t p2);
bool equalSmallStringUint64G  (smallStringt* self, uint64_t p2);
bool equalSmallStringSmallBoolG(smallStringt* self, smallBoolt* p2);
bool equalSmallStringSmallBytesG(smallStringt* self, smallBytest* p2);
bool equalSmallStringSmallDoubleG(smallStringt* self, smallDoublet* p2);
bool equalSmallStringSmallIntG(smallStringt* self, smallIntt* p2);
bool equalSmallStringSmallJsonG(smallStringt* self, smallJsont* p2);
bool equalSmallStringFG       (smallStringt* self, smallStringt* p2);
bool equalCharSmallStringG    (smallStringt *self, char c);
bool equalSSmallStringG       (smallStringt *self, const char *string);
bool icEqualSmallStringBaseG     (smallStringt* self, baset* p2);
bool icEqualSmallStringSmallJsonG(smallStringt* self, smallJsont* p2);
bool icEqualSmallStringFG        (smallStringt* self, smallStringt* p2);
bool icEqualCharSmallStringG     (smallStringt *self, char c);
bool icEqualSSmallStringG        (smallStringt *self, const char *string);
bool equalISSmallStringG      (smallStringt *self, const char *string, intmax_t index);
bool equalICharSmallStringG   (smallStringt *self, char c, intmax_t index);
bool equalISmallJsonSmallStringG(smallStringt *self, smallJsont *string, intmax_t index);
bool equalISmallStringSmallStringG(smallStringt *self, smallStringt *string, intmax_t index);
bool startsWithSSmallStringG          (smallStringt *self, const char *string);
bool startsWithCharSmallStringG       (smallStringt *self, char c);
bool startsWithSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
bool startsWithSmallStringSmallStringG(smallStringt *self, smallStringt *string);
bool endsWithSSmallStringG          (smallStringt *self, const char *string);
bool endsWithCharSmallStringG       (smallStringt *self, char c);
bool endsWithSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
bool endsWithSmallStringSmallStringG(smallStringt *self, smallStringt *string);
ssize_t countSSmallStringG          (smallStringt *self, const char *string);
ssize_t countCharSmallStringG       (smallStringt *self, char c);
ssize_t countSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
ssize_t countSmallStringSmallStringG(smallStringt *self, smallStringt *string);
bool icStartsWithSSmallStringG          (smallStringt *self, const char *string);
bool icStartsWithCharSmallStringG       (smallStringt *self, char c);
bool icStartsWithSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
bool icStartsWithSmallStringSmallStringG(smallStringt *self, smallStringt *string);
bool icEndsWithSSmallStringG          (smallStringt *self, const char *string);
bool icEndsWithCharSmallStringG       (smallStringt *self, char c);
bool icEndsWithSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
bool icEndsWithSmallStringSmallStringG(smallStringt *self, smallStringt *string);
ssize_t icCountSSmallStringG          (smallStringt *self, const char *string);
ssize_t icCountCharSmallStringG       (smallStringt *self, char c);
ssize_t icCountSmallJsonSmallStringG  (smallStringt *self, smallJsont *string);
ssize_t icCountSmallStringSmallStringG(smallStringt *self, smallStringt *string);
bool isNumberSmallStringG     (smallStringt *self);
bool isIntSmallStringG        (smallStringt *self);
intmax_t parseIntSmallStringG (smallStringt *self);
smallStringt* intToSmallStringG        (smallStringt *self, intmax_t n);
double   parseDoubleSmallStringG (smallStringt *self);
smallStringt* doubleToSmallStringG     (smallStringt *self, double n);
size_t lenSmallStringG        (smallStringt *self);
smallStringt*    upperSmallStringG      (smallStringt *self);
smallStringt*    lowerSmallStringG      (smallStringt *self);
smallStringt*    trimSmallStringG       (smallStringt *self);
smallStringt*    lTrimSmallStringG      (smallStringt *self);
smallStringt*    rTrimSmallStringG      (smallStringt *self);
smallStringt*    uniqSmallStringG       (smallStringt *self, char c);
smallStringt*    icUniqSmallStringG     (smallStringt *self, char c);
smallStringt*    sliceSmallStringG      (smallStringt *self, intmax_t start, intmax_t end);
smallStringt* copySmallStringG(smallStringt *self, intmax_t start, intmax_t end);
smallStringt*    insertSmallStringG              (smallStringt *self, intmax_t index, smallStringt *toInsert);
smallStringt*    insertSmallJsonSmallStringG     (smallStringt *self, intmax_t index, smallJsont *toInsert);
smallStringt*    insertSSmallStringG             (smallStringt *self, intmax_t index, const char *toInsert);
smallStringt*    insertNFreeSmallStringG         (smallStringt *self, intmax_t index, smallStringt *toInsert);
smallStringt*    insertNFreeSmallJsonSmallStringG(smallStringt *self, intmax_t index, smallJsont *toInsert);
smallStringt*    insertSNFreeSmallStringG        (smallStringt *self, intmax_t index, char *toInsert);
smallStringt*    injectSmallStringG     (smallStringt *self, intmax_t index, char toInject);
smallStringt*  delSmallStringG          (smallStringt *self, intmax_t start, intmax_t end);
smallStringt*  delElemSmallStringG      (smallStringt *self, intmax_t index);
char* hasSmallStringG           (smallStringt *self, const char *needle);
char* hasCharSmallStringG       (smallStringt *self, char c);
char* hasSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
char* hasSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
smallStringt* findSmallStringG           (smallStringt *self, const char *needle);
smallStringt* findCharSmallStringG       (smallStringt *self, char c);
smallStringt* findSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
smallStringt* findSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
ssize_t indexOfSmallStringG           (smallStringt *self, const char *needle);
ssize_t indexOfCharSmallStringG       (smallStringt *self, char c);
ssize_t indexOfSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
ssize_t indexOfSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
char* icHasSmallStringG           (smallStringt *self, const char *needle);
char* icHasCharSmallStringG       (smallStringt *self, char c);
char* icHasSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
char* icHasSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
smallStringt* icFindSmallStringG           (smallStringt *self, const char *needle);
smallStringt* icFindCharSmallStringG       (smallStringt *self, char c);
smallStringt* icFindSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
smallStringt* icFindSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
ssize_t icIndexOfSmallStringG           (smallStringt *self, const char *needle);
ssize_t icIndexOfCharSmallStringG       (smallStringt *self, char c);
ssize_t icIndexOfSmallJsonSmallStringG  (smallStringt *self, smallJsont *needle);
ssize_t icIndexOfSmallStringSmallStringG(smallStringt *self, smallStringt *needle);
smallStringt*    emptySmallStringG      (smallStringt *self);
bool   isEmptySmallStringG    (smallStringt *self);
bool   isBlankSmallStringG    (smallStringt *self);
smallArrayt* splitSmallStringG           (smallStringt *self, const char *delim);
smallArrayt* splitCharSmallStringG       (smallStringt *self, char c);
smallArrayt* splitSmallJsonSmallStringG  (smallStringt *self, smallJsont *delim);
smallArrayt* splitSmallStringSmallStringG(smallStringt *self, smallStringt *delim);
char** splitCharPSSmallStringG      (smallStringt *self, const char* delim);
char** splitCharSSmallStringG       (smallStringt *self, char c);
char** splitSmallJsonSSmallStringG  (smallStringt *self, smallJsont *delim);
char** splitSmallStringSSmallStringG(smallStringt *self, smallStringt *delim);
smallArrayt* extractSmallStringG(smallStringt *self, const char* delim1, const char* delim2);
smallArrayt* extractCharSSmallStringG                 (smallStringt *self, char delim1, const char* delim2);
smallArrayt* extractSCharSmallStringG                 (smallStringt *self, const char* delim1, char delim2);
smallArrayt* extractCharCharSmallStringG              (smallStringt *self, char delim1, char delim2);
smallArrayt* extractSmallJsonSmallJsonSmallStringG    (smallStringt *self, smallJsont* delim1, smallJsont* delim2);
smallArrayt* extractSmallJsonSmallStringSmallStringG  (smallStringt *self, smallJsont* delim1, smallStringt* delim2);
smallArrayt* extractSmallJsonSSmallStringG            (smallStringt *self, smallJsont* delim1, const char* delim2);
smallArrayt* extractSmallJsonCharSmallStringG         (smallStringt *self, smallJsont* delim1, char delim2);
smallArrayt* extractSmallStringSmallJsonSmallStringG  (smallStringt *self, smallStringt* delim1, smallJsont* delim2);
smallArrayt* extractSmallStringSmallStringSmallStringG(smallStringt *self, smallStringt* delim1, smallStringt* delim2);
smallArrayt* extractSmallStringSSmallStringG          (smallStringt *self, smallStringt* delim1, const char* delim2);
smallArrayt* extractSmallStringCharSmallStringG       (smallStringt *self, smallStringt* delim1, char delim2);
smallArrayt* extractSSmallJsonSmallStringG            (smallStringt *self, const char* delim1, smallJsont* delim2);
smallArrayt* extractSSmallStringSmallStringG          (smallStringt *self, const char* delim1, smallStringt* delim2);
smallArrayt* extractCharSmallJsonSmallStringG         (smallStringt *self, char delim1, smallJsont* delim2);
smallArrayt* extractCharSmallStringSmallStringG       (smallStringt *self, char delim1, smallStringt* delim2);
smallArrayt* icSplitSmallStringG           (smallStringt *self, const char *delim);
smallArrayt* icSplitCharSmallStringG       (smallStringt *self, char c);
smallArrayt* icSplitSmallJsonSmallStringG  (smallStringt *self, smallJsont *delim);
smallArrayt* icSplitSmallStringSmallStringG(smallStringt *self, smallStringt *delim);
char** icSplitCharPSSmallStringG      (smallStringt *self, char *delim);
char** icSplitCharSSmallStringG       (smallStringt *self, char c);
char** icSplitSmallJsonSSmallStringG  (smallStringt *self, smallJsont *delim);
char** icSplitSmallStringSSmallStringG(smallStringt *self, smallStringt *delim);
smallArrayt* icExtractSmallStringG(smallStringt *self, const char* delim1, const char* delim2);
smallArrayt* icExtractCharSSmallStringG                 (smallStringt *self, char delim1, const char* delim2);
smallArrayt* icExtractSCharSmallStringG                 (smallStringt *self, const char* delim1, char delim2);
smallArrayt* icExtractCharCharSmallStringG              (smallStringt *self, char delim1, char delim2);
smallArrayt* icExtractSmallJsonSmallJsonSmallStringG    (smallStringt *self, smallJsont* delim1, smallJsont* delim2);
smallArrayt* icExtractSmallJsonSmallStringSmallStringG  (smallStringt *self, smallJsont* delim1, smallStringt* delim2);
smallArrayt* icExtractSmallJsonSSmallStringG            (smallStringt *self, smallJsont* delim1, const char* delim2);
smallArrayt* icExtractSmallJsonCharSmallStringG         (smallStringt *self, smallJsont* delim1, char delim2);
smallArrayt* icExtractSmallStringSmallJsonSmallStringG  (smallStringt *self, smallStringt* delim1, smallJsont* delim2);
smallArrayt* icExtractSmallStringSmallStringSmallStringG(smallStringt *self, smallStringt* delim1, smallStringt* delim2);
smallArrayt* icExtractSmallStringSSmallStringG          (smallStringt *self, smallStringt* delim1, const char* delim2);
smallArrayt* icExtractSmallStringCharSmallStringG       (smallStringt *self, smallStringt* delim1, char delim2);
smallArrayt* icExtractSSmallJsonSmallStringG            (smallStringt *self, const char* delim1, smallJsont* delim2);
smallArrayt* icExtractSSmallStringSmallStringG          (smallStringt *self, const char* delim1, smallStringt* delim2);
smallArrayt* icExtractCharSmallJsonSmallStringG         (smallStringt *self, char delim1, smallJsont* delim2);
smallArrayt* icExtractCharSmallStringSmallStringG       (smallStringt *self, char delim1, smallStringt* delim2);
smallStringt* readFileSmallStringG           (smallStringt *self, const char *filePath);
smallStringt* readFileSmallJsonSmallStringG  (smallStringt *self, smallJsont *filePath);
smallStringt* readFileSmallStringSmallStringG(smallStringt *self, smallStringt *filePath);
smallStringt* readStreamSmallStringG         (smallStringt *self, FILE *fp);
int writeFileSmallStringG           (smallStringt *self, const char *filePath);
int writeFileSmallJsonSmallStringG  (smallStringt *self, smallJsont *filePath);
int writeFileSmallStringSmallStringG(smallStringt *self, smallStringt *filePath);
int writeStreamSmallStringG         (smallStringt *self, FILE *fp);
int appendFileSmallStringFG           (smallStringt *self, const char *filePath); //TODO remove F - oGMacros generates a macro making the compilation fail
int appendFileSmallStringSmallStringG(smallStringt *self, smallStringt *filePath);

// see libsheepy.h for colors and effects
// end class smallString


text:
package com.guoxiaoxing.music.ui.fragment;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.guoxiaoxing.music.R;
import com.guoxiaoxing.music.adapter.ArtistSongAdapter;
import com.guoxiaoxing.music.dataloader.ArtistSongLoader;
import com.guoxiaoxing.music.model.Song;
import com.guoxiaoxing.music.ui.base.BaseFragment;
import com.guoxiaoxing.music.util.Constants;
import com.guoxiaoxing.music.widget.DividerItemDecoration;

import java.util.ArrayList;

public class ArtistMusicFragment extends BaseFragment {

    public static RecyclerView songsRecyclerview;
    long artistID = -1;
    ArtistSongAdapter mSongAdapter;

    public static ArtistMusicFragment newInstance(long id) {
        ArtistMusicFragment fragment = new ArtistMusicFragment();
        Bundle args = new Bundle();
        args.putLong(Constants.ARTIST_ID, id);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            artistID = getArguments().getLong(Constants.ARTIST_ID);
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View rootView = inflater.inflate(
                R.layout.fragment_artist_music, container, false);
        songsRecyclerview = (RecyclerView) rootView.findViewById(R.id.recycler_view_songs);
        setUpSongs();
        return rootView;
    }

    private void setUpSongs() {
        songsRecyclerview.setLayoutManager(new LinearLayoutManager(getActivity()));

        ArrayList<Song> songList;
        songList = ArtistSongLoader.getSongsForArtist(getActivity(), artistID);

        // adding one dummy song to top of arraylist
        //there will be albums header at this position in recyclerview
        songList.add(0, new Song(-1, -1, -1, "dummy", "dummy", "dummy", -1, -1));

        mSongAdapter = new ArtistSongAdapter(getActivity(), songList, artistID);
        songsRecyclerview.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST));
        songsRecyclerview.setAdapter(mSongAdapter);
    }
}

redpajama_set_name: RedPajamaGithub


text:
#include <vector>
#include "Types.h"
#include "Stream.h"

class CXmlFileDecoder
{
public:
	static std::vector<uint8>	Decode(Framework::CStream&);

private:
	static void					ScrambleBuffer(uint8* buffer, size_t bufferSize);
};


text:
/**
 * Simple header class which is used for on {@link Ext.panel.Panel} and {@link Ext.window.Window}.
 */
Ext.define('Ext.panel.Header', {
    extend: 'Ext.container.Container',
    uses: ['Ext.panel.Tool', 'Ext.draw.Component', 'Ext.util.CSS', 'Ext.layout.component.Body', 'Ext.Img'],
    alias: 'widget.header',

    /**
     * @property {Boolean} isHeader
     * `true` in this class to identify an objact as an instantiated Header, or subclass thereof.
     */
    isHeader       : true,
    defaultType    : 'tool',
    indicateDrag   : false,
    weight         : -1,
    componentLayout: 'body',

    /**
     * @cfg {String} [titleAlign='left']
     * May be `"left"`, `"right"` or `"center"`.
     *
     * The alignment of the title text within the available space between the icon and the tools.
     */
    titleAlign: 'left',

    childEls: [
        'body'
    ],

    renderTpl: [
        '<div id="{id}-body" class="{baseCls}-body {bodyCls}',
        '<tpl for="uiCls"> {parent.baseCls}-body-{parent.ui}-{.}"</tpl>',
        '<tpl if="bodyStyle"> style="{bodyStyle}"</tpl>>',
            '{%this.renderContainer(out,values)%}',
        '
'
    ],

    headingTpl: '{title}',

    shrinkWrap: 3,

    /**
     * @cfg {String} title
     * The title text to display.
     */

    /**
     * @cfg {String} iconCls
     * CSS class for an icon in the header. Used for displaying an icon to the left of a title.
     */

    /**
     * @cfg {String} icon
     * Path to image for an icon in the header. Used for displaying an icon to the left of a title.
     */

    initComponent: function() {
        var me = this,
            ruleStyle,
            rule,
            style,
            ui,
            tempEl;

        me.addEvents(
            /**
             * @event click
             * Fires when the header is clicked. This event will not be fired
             * if the click was on a {@link Ext.panel.Tool}
             * @param {Ext.panel.Header} this
             * @param {Ext.EventObject} e
             */
            'click',

            /**
             * @event dblclick
             * Fires when the header is double clicked. This event will not
             * be fired if the click was on a {@link Ext.panel.Tool}
             * @param {Ext.panel.Header} this
             * @param {Ext.EventObject} e
             */
            'dblclick'
        );

        me.indicateDragCls = me.baseCls + '-draggable';
        me.title = me.title || ' ';
        me.tools = me.tools || [];
        me.items = me.items || [];
        me.orientation = me.orientation || 'horizontal';
        me.dock = (me.dock) ? me.dock : (me.orientation == 'horizontal') ? 'top' : 'left';

        //add the dock as a ui
        //this is so we support top/right/left/bottom headers
        me.addClsWithUI([me.orientation, me.dock]);

        if (me.indicateDrag) {
            me.addCls(me.indicateDragCls);
        }

        // Add Icon
        if (!Ext.isEmpty(me.iconCls) || !Ext.isEmpty(me.icon)) {
            me.initIconCmp();
            me.items.push(me.iconCmp);
        }

        // Add Title
        if (me.orientation == 'vertical') {
            me.layout = {
                type : 'vbox',
                align: 'center'
            };
            me.textConfig = {
                width: 16,
                cls: me.baseCls + '-text',
                type: 'text',
                text: me.title,
                rotate: {
                    degrees: 90
                }
            };
            ui = me.ui;
            if (Ext.isArray(ui)) {
                ui = ui[0];
            }
            ruleStyle = '.' + me.baseCls + '-text-' + ui;
            if (Ext.scopeResetCSS) {
                ruleStyle = '.' + Ext.baseCSSPrefix + 'reset ' + ruleStyle;
            }
            rule = Ext.util.CSS.getRule(ruleStyle);

            // We might have been disallowed access to the stylesheet: https://sencha.jira.com/browse/EXTJSIV-5084
            if (rule) {
                style = rule.style;
            } else {
                style = (tempEl = Ext.getBody().createChild({style: 'position:absolute', cls: me.baseCls + '-text-' + ui})).getStyles('fontFamily', 'fontWeight', 'fontSize', 'color');
                tempEl.remove();
            }
            if (style) {
                Ext.apply(me.textConfig, {
                    'font-family': style.fontFamily,
                    'font-weight': style.fontWeight,
                    'font-size': style.fontSize,
                    fill: style.color
                });
            }
            me.titleCmp = new Ext.draw.Component({
                width     : 16,
                ariaRole  : 'heading',
                focusable : false,
                viewBox   : false,
                flex      : 1,
                id        : me.id + '_hd',
                autoSize  : true,
                items     : me.textConfig,
                xhooks: {
                    setSize: function (width) {
                        // don't pass 2nd arg (height) on to setSize or we break 'flex:1'
                        this.callParent([width]);
                    }
                },
                // this is a bit of a cheat: we are not selecting an element of titleCmp
                // but rather of titleCmp.items[0]
                childEls  : [
                    { name: 'textEl', select: '.' + me.baseCls + '-text' }
                ]
            });
        } else {
            me.layout = {
                type : 'hbox',
                align: 'middle'
            };
            me.titleCmp = new Ext.Component({
                ariaRole  : 'heading',
                focusable : false,
                noWrap    : true,
                flex      : 1,
                id        : me.id + '_hd',
                style     : 'text-align:' + me.titleAlign,
                cls       : me.baseCls + '-text-container',
                renderTpl : me.getTpl('headingTpl'),
                renderData: {
                    title: me.title,
                    cls  : me.baseCls,
                    ui   : me.ui
                },
                childEls  : ['textEl']
            });
        }
        me.items.push(me.titleCmp);

        // Add Tools
        me.items = me.items.concat(me.tools);
        me.callParent();

        me.on({
            dblclick: me.onDblClick,
            click: me.onClick,
            element: 'el',
            scope: me
        });
    },

    initIconCmp: function() {
        var me = this,
            cfg = {
                focusable: false,
                src: Ext.BLANK_IMAGE_URL,
                cls: [me.baseCls + '-icon', me.iconCls],
                id: me.id + '-iconEl',
                iconCls: me.iconCls
            };

        if (!Ext.isEmpty(me.icon)) {
            delete cfg.iconCls;
            cfg.src = me.icon;
        }

        me.iconCmp = new Ext.Img(cfg);
    },

    afterRender: function() {
        this.el.unselectable();
        this.callParent();
    },

    // inherit docs
    addUIClsToElement: function(cls) {
        var me = this,
            result = me.callParent(arguments),
            classes = [me.baseCls + '-body-' + cls, me.baseCls + '-body-' + me.ui + '-' + cls],
            array, i;

        if (me.bodyCls) {
            array = me.bodyCls.split(' ');

            for (i = 0; i < classes.length; i++) {
                if (!Ext.Array.contains(array, classes[i])) {
                    array.push(classes[i]);
                }
            }

            me.bodyCls = array.join(' ');
        } else {
            me.bodyCls = classes.join(' ');
        }

        return result;
    },

    // inherit docs
    removeUIClsFromElement: function(cls) {
        var me = this,
            result = me.callParent(arguments),
            classes = [me.baseCls + '-body-' + cls, me.baseCls + '-body-' + me.ui + '-' + cls],
            array, i;

        if (me.bodyCls) {
            array = me.bodyCls.split(' ');

            for (i = 0; i < classes.length; i++) {
                Ext.Array.remove(array, classes[i]);
            }

            me.bodyCls = array.join(' ');
        }

        return result;
    },

    // inherit docs
    addUIToElement: function() {
        var me = this,
            array, cls;

        me.callParent(arguments);

        cls = me.baseCls + '-body-' + me.ui;
        if (me.rendered) {
            if (me.bodyCls) {
                me.body.addCls(me.bodyCls);
            } else {
                me.body.addCls(cls);
            }
        } else {
            if (me.bodyCls) {
                array = me.bodyCls.split(' ');

                if (!Ext.Array.contains(array, cls)) {
                    array.push(cls);
                }

                me.bodyCls = array.join(' ');
            } else {
                me.bodyCls = cls;
            }
        }

        if (me.titleCmp && me.titleCmp.rendered && me.titleCmp.textEl) {
            me.titleCmp.textEl.addCls(me.baseCls + '-text-' + me.ui);
        }
    },

    // inherit docs
    removeUIFromElement: function() {
        var me = this,
            array, cls;

        me.callParent(arguments);

        cls = me.baseCls + '-body-' + me.ui;
        if (me.rendered) {
            if (me.bodyCls) {
                me.body.removeCls(me.bodyCls);
            } else {
                me.body.removeCls(cls);
            }
        } else {
            if (me.bodyCls) {
                array = me.bodyCls.split(' ');
                Ext.Array.remove(array, cls);
                me.bodyCls = array.join(' ');
            } else {
                me.bodyCls = cls;
            }
        }

        if (me.titleCmp && me.titleCmp.rendered && me.titleCmp.textEl) {
            me.titleCmp.textEl.removeCls(me.baseCls + '-text-' + me.ui);
        }
    },

    onClick: function(e) {
        this.fireClickEvent('click', e);
    },

    onDblClick: function(e){
        this.fireClickEvent('dblclick', e);
    },

    fireClickEvent: function(type, e){
        var toolCls = '.' + Ext.panel.Tool.prototype.baseCls;
        if (!e.getTarget(toolCls)) {
            this.fireEvent(type, this, e);
        }
    },

    getFocusEl: function() {
        return this.el;
    },

    getTargetEl: function() {
        return this.body || this.frameBody || this.el;
    },

    /**
     * Sets the title of the header.
     * @param {String} title The title to be set
     */
    setTitle: function(title) {
        var me = this,
            sprite,
            surface;
        if (me.rendered) {
            if (me.titleCmp.rendered) {
                if (me.titleCmp.surface) {
                    me.title = title || '';
                    sprite = me.titleCmp.surface.items.items[0];
                    surface = me.titleCmp.surface;

                    surface.remove(sprite);
                    me.textConfig.type = 'text';
                    me.textConfig.text = title;
                    sprite = surface.add(me.textConfig);
                    sprite.setAttributes({
                        rotate: {
                            degrees: 90
                        }
                    }, true);
                    me.titleCmp.autoSizeSurface();
                } else {
                    me.title = title;
                    me.titleCmp.textEl.update(me.title || ' ');
                }
                me.titleCmp.updateLayout();
            } else {
                me.titleCmp.on({
                    render: function() {
                        me.setTitle(title);
                    },
                    single: true
                });
            }
        } else {
            me.title = title;
        }
    },

    /**
     * @private
     * Used when shrink wrapping a Panel to either content width or header width.
     * This returns the minimum width required to display the header, icon and tools.
     * **This is only intended for use with horizontal headers.**
     */
    getMinWidth: function() {
        var me = this,
            textEl = me.titleCmp.textEl.dom,
            result,
            tools = me.tools,
            l, i;

        // Measure text width as inline element so it doesn't stretch
        textEl.style.display = 'inline';
        result = textEl.offsetWidth;
        textEl.style.display = '';

        // Add tools width
        if (tools && (l = tools.length)) {
            for (i = 0; i < l; i++) {
                if (tools[i].el) {
                    result += tools[i].el.dom.offsetWidth;
                }
            }
        }

        // Add iconWidth
        if (me.iconCmp) {
            result += me.iconCmp.el.dom.offsetWidth;
        }

        // Return with some space between title and tools/end of header.
        return result + 10;
    },

    /**
     * Sets the CSS class that provides the icon image for this header.  This method will replace any existing
     * icon class if one has already been set.
     * @param {String} cls The new CSS class name
     */
    setIconCls: function(cls) {
        var me = this,
            isEmpty = !cls || !cls.length,
            iconCmp = me.iconCmp;

        me.iconCls = cls;
        if (!me.iconCmp && !isEmpty) {
            me.initIconCmp();
            me.insert(0, me.iconCmp);
        } else if (iconCmp) {
            if (isEmpty) {
                me.iconCmp.destroy();
                delete me.iconCmp;
            } else {
                iconCmp.removeCls(iconCmp.iconCls);
                iconCmp.addCls(cls);
                iconCmp.iconCls = cls;
            }
        }
    },

    /**
     * Sets the image path that provides the icon image for this header.  This method will replace any existing
     * icon if one has already been set.
     * @param {String} icon The new icon path
     */
    setIcon: function(icon) {
        var me = this,
            isEmpty = !icon || !icon.length,
            iconCmp = me.iconCmp;

        me.icon = icon;
        if (!me.iconCmp && !isEmpty) {
            me.initIconCmp();
            me.insert(0, me.iconCmp);
        } else if (iconCmp) {
            if (isEmpty) {
                me.iconCmp.destroy();
                delete me.iconCmp;
            } else {
                iconCmp.setSrc(me.icon);
            }
        }
    },

    /**
     * Add a tool to the header
     * @param {Object} tool
     */
    addTool: function(tool) {
        this.tools.push(this.add(tool));
    },

    /**
     * @protected
     * Set up the `tools.<tool type>` link in the owning Panel.
     * Bind the tool to its owning Panel.
     * @param component
     * @param index
     */
    onAdd: function(component, index) {
        this.callParent(arguments);
        if (component instanceof Ext.panel.Tool) {
            component.bindTo(this.ownerCt);
            this.tools[component.type] = component;
        }
    },

    /**
     * Add bodyCls to the renderData object
     * @return {Object} Object with keys and values that are going to be applied to the renderTpl
     * @private
     */
    initRenderData: function() {
        return Ext.applyIf(this.callParent(), {
            bodyCls: this.bodyCls
        });
    }
});


text:
import Ember from 'ember';

export default Ember.Controller.extend({
	needs: ['application'],
	tablesVisible: false,
	ordersVisible: false,
	reportsVisible: false,
	keyword: null,
	user: Ember.computed.alias('controllers.application.user'),
	availableOrders: Ember.computed.alias("controllers.application.orders"),
	onInit: function(){
		this.set('tablesVisible', true);
	}.on('init'),
	actions: {
		toggleTables: function(){
			this.set('reportsVisible', false);

			if(!Ember.isPresent(this.get('currentOrder'))){
				this.set('tablesVisible', true);
			}
			else{
				this.set('tablesVisible', !this.get('tablesVisible'));
			}

			this.send('refresh');
		},
		toggleReports: function(){
			this.set('tablesVisible', false);
			this.set('reportsVisible', !this.get('reportsVisible'));
			this.send('refresh');
		},
		lock: function(){
			window.location.reload();
		},
		selectTable: function(table){
			this.set('selectedTable', table);

			var order = this.get('availableOrders.content').filterBy('table.id', table.get('id'));

			if(order.length === 1){
				this.set('currentOrder', order[0]);
			}
			else{
				var order = this.store.createRecord('order', {
					'table': table,
					'discount': 0,
					'started': new Date(),
					'status': false,
					'reported': false,
					'total': 0,
					'openedBy': this.get('controllers.application.user'),
					'operatedBy': this.get('controllers.application.user')
				});

				var _this = this;
				order.save().then(function(newOrder){
					newOrder.get('table').set('taken', true);
					_this.set('currentOrder', newOrder);
				});
			}

			this.set('tablesVisible', false);
			this.set('selectedProduct', null);

			this.send('refresh');
		},
		selectCategory: function(category){
			this.set('selectedCategory', category);

			this.send('refresh');
		},
		selectProduct: function(product){
			if(this.get('lastItem.product.id') === product.get('id')){
				this.get('lastItem').set('quantity', this.get('lastItem').get('quantity') + 1);
			}
			else{
				var orderItem = this.store.createRecord('order-item', {
					'product': product,
					'quantity': 1,
					'entered': new Date(),
					'price': product.get('price'),
					'order': this.get('currentOrder'),
					'addedBy': this.get('controllers.application.user'),
					'sent': false,
					'reduced': 0
				});

				this.set('lastItem', orderItem);
			}

			this.send('refresh');
		},
		sendOrder: function(){
			var unsentOrderItems = this.get('currentOrder.items').filterBy('sent', false);

			unsentOrderItems.forEach(function(orderItem){
				orderItem.save();
			});

			this.send('refresh');
		},
		closeOrder: function(){
			var order = this.get('currentOrder');
			order.set('status', true);

			var _this = this;
			order.save().then(function(closedOrder){
				closedOrder.get('table').set('taken', false);
				_this.store.unloadRecord(closedOrder);
			});

			this.set('tablesVisible', true);

			this.send('refresh');
		},
		filterProducts: function(keyword){
			this.set('keyword', keyword);

			this.send('refresh');
		},
		confirm: function(keyword){
			this.set('keyword', keyword);

			this.send('refresh');
		}
	}
});


text:
using System;
using System.Collections.Generic;

namespace ChampsRoom.Models
{
    public class League
    {
        public League()
        {
            this.Id = System.Guid.NewGuid();
            this.Sets = 7;
            this.SetsNeededToWin = 4;
            this.MaxScore = 9999;
            this.MinScore = 0;

            this.Matches = new HashSet<Match>();
            this.Users = new HashSet<User>();
            this.Teams = new HashSet<Team>();
        }

        public Guid Id { get; set; }
        public string Name { get; set; }
        public string Slug { get; set; }
        public int Sets { get; set; }
        public int SetsNeededToWin { get; set; }
        public int MaxScore { get; set; }
        public int MinScore { get; set; }
        public string Rules { get; set; }

        public ICollection<Match> Matches { get; set; }
        public ICollection<User> Users { get; set; }
        public ICollection<Team> Teams { get; set; }
    }

}


text:
"""
This is an example implementation of an encryption/decryption module
for settings. The API for a module like this is very simple, it has:

1. :func:`decrypt` function that only takes one argument, the
   string to decrypt
2. :func:`encrypt` function that only takes one argument, the
   string to encrypt

If you need to pass in an argument to encrypt/decrypt that is handled
out of band of gocd-cli, unless someone comes up with a great way and
convinces the maintainer that's the way to do it. :)
"""
import codecs

def decrypt(ciphertext):
    return codecs.decode(ciphertext, 'rot13')

def encrypt(plaintext):
    return codecs.encode(plaintext, 'rot13')


text:
(function () {
  'use strict';

  var srcDeps = require('./index.js');

  var x = srcDeps({
    packagers: ['npm'],
    packagerData: {bower: {pkgDir: 'something_else'}},
    logOutput: true,
    rootDir: './fixture'
  });

  console.log(x);
})();


text:
package android.widget.listview;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.TextView;
import android.widget.ListView;

import com.android.frameworks.coretests.R;

/**
 * Exercises a list in a horizontal linear layout
 */
public class ListInHorizontal extends Activity {
    private ListView mListView;

    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setContentView(R.layout.list_in_horizontal);

        String values[] = new String[1000];
        for (int i = 0; i < 1000; i++) {
            values[i] = ((Integer) i).toString();
        }

        mListView = (ListView) findViewById(R.id.list);
        mListView.setAdapter(new ArrayAdapter<String>(this,
                android.R.layout.simple_list_item_1, values));

    }

    public ListView getListView() {
        return mListView;
    }
}


text:
using namespace seqan;

int main()
{
	Dna seq1 = "AAATGACGGATTG";
	Dna seq2 = "AGTCGGATCTACTG";

	typedef String<Dna> TSequence;
    typedef Align<TSequence,ArrayGaps> TAlign;

	TAlign align;
    resize(rows(align), 2);
    assignSource(row(align,0),seq1);
    assignSource(row(align,1),seq2);

	std::cout<<align;

	return 0;
}


text:
package com.hundredwordsgof.state;

/**
 * The interface for encapsulating the behavior associated with a particular
 * state of the Context.
 *
 */
public interface State {

  void handle();
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <stroke
        android:width="1dp"
        android:color="@color/font_4" />
    <size
        android:width="@dimen/point_guide_width"
        android:height="@dimen/point_guide_width" />
</shape>