ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.xs
(Generate patch)

Comparing BDB/BDB.xs (file contents):
Revision 1.63 by root, Tue Oct 21 02:21:25 2008 UTC vs.
Revision 1.64 by root, Wed Nov 12 16:52:51 2008 UTC

1162 } 1162 }
1163 } 1163 }
1164 1164
1165 return 0; 1165 return 0;
1166} 1166}
1167
1168/*****************************************************************************/
1169
1170#if 0
1171static int
1172bt_pfxc_compare (DB *db, const DBT *dbt1, const DBT *dbt2)
1173{
1174 ssize_t size1 = dbt1->size;
1175 ssize_t size2 = dbt2->size;
1176 int res = memcmp ((void *)dbt1->data, (void *)dbt2->data,
1177 size1 <= size2 ? size1 : size2);
1178
1179 if (res)
1180 return res;
1181 else if (size1 - size2)
1182 return size1 - size2;
1183 else
1184 return 0;
1185}
1186
1187static size_t
1188bt_pfxc_prefix_x (DB *db, const DBT *dbt1, const DBT *dbt2)
1189{
1190 ssize_t size1 = dbt1->size;
1191 ssize_t size2 = dbt2->size;
1192 u_int8_t *p1 = (u_int8_t *)dbt1->data;
1193 u_int8_t *p2 = (u_int8_t *)dbt2->data;
1194 u_int8_t *pe = p1 + (size1 <= size2 ? size1 : size2);
1195
1196 while (p1 < pe)
1197 if (*p1++ != *p2++)
1198 return p1 - (u_int8_t *)dbt1->data - 1;
1199
1200 if (size1 < size2) return size1 + 1;
1201 if (size1 > size2) return size2 + 1;
1202
1203 return size1;
1204}
1205#endif
1206
1207/*****************************************************************************/
1167 1208
1168/* stupid windows defines CALLBACK as well */ 1209/* stupid windows defines CALLBACK as well */
1169#undef CALLBACK 1210#undef CALLBACK
1170#define CALLBACK SV *cb = pop_callback (&items, ST (items - 1)); 1211#define CALLBACK SV *cb = pop_callback (&items, ST (items - 1));
1171 1212

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines