摘要:
#ifndef STRING_H#define STRING_H#define STRING_DEFAULT_CHUNK_SIZE 256typedef struct { char *value; int length; int capacity; int chunk_size;} String;String *string_construct(const char *value);String *string_construct_from_int(int value);void string_destroy(String *string);void string_se... 阅读全文
摘要:
栈实际应用现场:先入后出(顺序栈)#include "linkedlist.h"#include <stdlib.h>#include <stdio.h>#ifdef DMALLOC#include "dmalloc.h"#endiftypedef struct { LinkedList *list;} StackStack *stack_construct() { Stack *stack = NULL; stack = calloc(1, sizeof(Stack));if (stack == NULL) { return N 阅读全文
摘要:
#include "logger.h"#include <stdio.h>#include <sys/types.h>#include <time.h>#include <ctype.h>#include <sys/time.h>#include <time.h>#include <stdlib.h>#include <string.h>#define tAGO 257#define tDAY 258#define tDAY_UNIT 259#define tDAYZONE 26 阅读全文
摘要:
#include <time.h>#include "date.h"#include "gettimestamp.h"#include "logger.h"#include <time.h>#include <locale.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#ifdef DMALLOC#include "dmalloc.h"#endiftypedef struct 阅读全文
摘要:
队列实际应用现场:先入先出#include "queue.h"#include "linkedlist.h"#include <stdlib.h>#include <stdio.h>#ifdef DMALLOC#include "dmalloc.h"#endiftypedef struct { LinkedList *list;} Queue;Queue *queue_construct() { Queue *queue = NULL; /* * Allocate space for the object an 阅读全文
摘要:
#ifndef FILE_H#define FILE_H#include "descriptor.h"#include "date.h"#include "dictionary.h"#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/time.h>#include <sys/types.h>#include <time.h>#include <unistd.h& 阅读全文
摘要:
#ifndef LINKED_LIST_H#define LINKED_LIST_Htypedef struct LinkedListNode { const void *data; struct LinkedListNode *prev; struct LinkedListNode *next;} LinkedListNode; typedef struct { LinkedListNode *head; LinkedListNode *current; LinkedListNode *tail; int size;} LinkedList;#define... 阅读全文
摘要:
#include <string.h>#include <stdlib.h>typedef struct LinkedList { char *s; struct LinkedList *next;} LinkedList;void freell(LinkedList *list){ LinkedList *cur = list; if(list == NULL) return; freell(list->next); free(list->s); free(list);}LinkedList *createll(char *s){ LinkedList * 阅读全文
摘要:
typedef struct _list { struct _list* plPrev; struct _list* plNext; void* p;} list;int ListCreate( list *pl ) { pl->plPrev = pl->plNext = pl; pl->p = NULL; return 0;}list *ListInsert( list *pl, void *p ) { list *plNew; if ( (plNew = (list*)malloc( sizeof( *plNew ))) == NULL )return NULL; plN 阅读全文
摘要:
#ifdef HAVE_CONFIG_H# include <config.h>#endif#include <errno.h>#include <stdlib.h>#include <string.h>#include <list0.h>#include <iterator0.h>#include <mailutils/errno.h>intmu_list_create (mu_list_t *plist){ mu_list_t list; int status; if (plist == NULL) ret 阅读全文