Coder Social home page Coder Social logo

c-list's Introduction

####API

/**
 * return value: if the API function has return value.return 0 for fail.return 1 for success.
**/

void list_init(list_t *list); 

int list_len(list_t *list); 

void list_append(list_t *list, void *data); 

int list_get(list_t *list, int position, void **data_ptr); 

int list_set(list_t *list, int pos, void *data); 

int list_pop_tail(list_t *list); 

int list_pop(list_t *list, int position); 

int list_iter(list_t *list, void **data_ptr, int *pos_ptr); //iterator for list, get value and index in loop

void list_extend(list_t *list_a, list_t *list_b); 

int list_swap(list_t *list, int pos_a, int pos_b); 

void list_reverse(list_t *list); 

int list_index(list_t *list, void *data); //lookup data in list.if found success, return its first found position, else return -1; 

void list_cycle(list_t *list, void **data_ptr, int *pos_ptr); //cycle iter for list.infinite iterator

int list_from_array(list_t *list, void *ptr, int size, int len); //make a list from array.

data type

list_t

Structure

typedef struct node {
	void *data;
	struct node *next;
} node_t; 

typedef struct list {
	node_t *head; 
} list_t; 

wiki

中文wiki见:http://hit9.org/wiki/C-list/

c-list's People

Contributors

hit9 avatar voidhug avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.