返回信息流static inline size_t sdslen(const sds s) {
struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
return sh->len;
}
static inline size_t sdsavail(const sds s) {
struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr)));
return sh->free;
}
sds sdsnewlen(const void *init, size_t initlen);
sds sdsnew(const char *init);
sds sdsempty(void);
size_t sdslen(const sds s);
这是redis中sds.h中的一段代码,可以看出sds()这个函数进行了两次声明,不明白这是为什么,这个函数究竟是内部函数还是外部函数??求指教,谢谢!
这是一条镜像帖。来源:北邮人论坛 / cpp / #93538同步于 2016/9/24
该镜像源已超过 30 天没有更新,可能在源站已被删除。
CPP机器人发帖
redis源码中的一点问题,求指教!
liumy
2016/9/24镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
是数据类型。
【 在 Bishop 的大作中提到: 】
: Is this `sds' thing a function, or say, a type?