| 108 |
return -1; |
return -1; |
| 109 |
} |
} |
| 110 |
|
|
| 111 |
if (block_count > ARTICLE_BLOCK_PER_POOL) |
if (block_count <= 0 || block_count > ARTICLE_BLOCK_PER_POOL) |
| 112 |
{ |
{ |
| 113 |
log_error("article_block_count exceed limit %d\n", ARTICLE_BLOCK_PER_POOL); |
log_error("article_block_count exceed limit %d\n", ARTICLE_BLOCK_PER_POOL); |
| 114 |
return -2; |
return -2; |
| 1138 |
return last_aid; |
return last_aid; |
| 1139 |
} |
} |
| 1140 |
|
|
| 1141 |
|
int article_block_article_count(void) |
| 1142 |
|
{ |
| 1143 |
|
int ret; |
| 1144 |
|
|
| 1145 |
|
if (p_article_block_pool == NULL || p_article_block_pool->block_count <= 0) |
| 1146 |
|
{ |
| 1147 |
|
return -1; |
| 1148 |
|
} |
| 1149 |
|
|
| 1150 |
|
ret = (p_article_block_pool->block_count - 1) * ARTICLE_PER_BLOCK + |
| 1151 |
|
p_article_block_pool->p_block[p_article_block_pool->block_count - 1]->article_count; |
| 1152 |
|
|
| 1153 |
|
return ret; |
| 1154 |
|
} |
| 1155 |
|
|
| 1156 |
int article_count_of_topic(int32_t aid) |
int article_count_of_topic(int32_t aid) |
| 1157 |
{ |
{ |
| 1158 |
ARTICLE *p_article; |
ARTICLE *p_article; |