23
23
* Boston, MA 02110-1301, USA.
24
24
*/
25
25
26
- #include "common.h"
27
- #include "git2/object.h"
28
- #include "hash.h"
29
- #include "odb.h"
30
-
31
- #include "git2/odb_backend.h"
32
-
33
- #ifdef GIT2_MYSQL_BACKEND
26
+ #include <assert.h>
27
+ #include <string.h>
28
+ #include <git2.h>
29
+ #include <git2/odb_backend.h>
34
30
35
31
/* MySQL C Api docs:
36
32
* http://dev.mysql.com/doc/refman/5.1/en/c-api-function-overview.html
@@ -177,7 +173,7 @@ int mysql_backend__read(void **data_p, size_t *len_p, git_otype *type_p, git_odb
177
173
// return GIT_ERROR;
178
174
179
175
if (data_len > 0 ) {
180
- * data_p = git__malloc (data_len );
176
+ * data_p = malloc (data_len );
181
177
result_buffers [2 ].buffer = * data_p ;
182
178
result_buffers [2 ].buffer_length = data_len ;
183
179
@@ -425,7 +421,7 @@ int git_odb_backend_mysql(git_odb_backend **backend_out, const char *mysql_host,
425
421
int error ;
426
422
my_bool reconnect ;
427
423
428
- backend = git__calloc (1 , sizeof (mysql_backend ));
424
+ backend = calloc (1 , sizeof (mysql_backend ));
429
425
if (backend == NULL )
430
426
return GIT_ENOMEM ;
431
427
@@ -462,22 +458,3 @@ int git_odb_backend_mysql(git_odb_backend **backend_out, const char *mysql_host,
462
458
mysql_backend__free ((git_odb_backend * )backend );
463
459
return GIT_ERROR ;
464
460
}
465
-
466
- #else
467
-
468
- int git_odb_backend_mysql (git_odb_backend * * GIT_UNUSED (backend_out ), const char * GIT_UNUSED (mysql_host ),
469
- const char * GIT_UNUSED (mysql_user ), const char * GIT_UNUSED (mysql_passwd ), const char * GIT_UNUSED (mysql_db ),
470
- unsigned int GIT_UNUSED (mysql_port ), const char * GIT_UNUSED (mysql_unix_socket ), unsigned long GIT_UNUSED (mysql_client_flag ))
471
- {
472
- GIT_UNUSED_ARG (backend_out );
473
- GIT_UNUSED_ARG (mysql_host );
474
- GIT_UNUSED_ARG (mysql_user );
475
- GIT_UNUSED_ARG (mysql_passwd );
476
- GIT_UNUSED_ARG (mysql_db );
477
- GIT_UNUSED_ARG (mysql_port );
478
- GIT_UNUSED_ARG (mysql_unix_socket );
479
- GIT_UNUSED_ARG (mysql_client_flag );
480
- return GIT_ENOTIMPLEMENTED ;
481
- }
482
-
483
- #endif /* HAVE_MYSQL */
0 commit comments