⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tcadbex.c

📁 高性能嵌入式数据库在高并发的环境下使用最好是64位系统比较好
💻 C
字号:
#include <tcutil.h>#include <tcadb.h>#include <stdlib.h>#include <stdbool.h>#include <stdint.h>int main(int argc, char **argv){  TCADB *adb;  char *key, *value;  /* create the object */  adb = tcadbnew();  /* open the database */  if(!tcadbopen(adb, "casket.tch")){    fprintf(stderr, "open error\n");  }  /* store records */  if(!tcadbput2(adb, "foo", "hop") ||     !tcadbput2(adb, "bar", "step") ||     !tcadbput2(adb, "baz", "jump")){    fprintf(stderr, "put error\n");  }  /* retrieve records */  value = tcadbget2(adb, "foo");  if(value){    printf("%s\n", value);    free(value);  } else {    fprintf(stderr, "get error\n");  }  /* traverse records */  tcadbiterinit(adb);  while((key = tcadbiternext2(adb)) != NULL){    value = tcadbget2(adb, key);    if(value){      printf("%s:%s\n", key, value);      free(value);    }    free(key);  }  /* close the database */  if(!tcadbclose(adb)){    fprintf(stderr, "close error\n");  }  /* delete the object */  tcadbdel(adb);  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -