mariadb/storage/archive/archive_test.c
unknown e03f8ef25a Remove compiler warnings
Fixed wrong table flags type in ndbcluster that caused previous commit to fail


client/mysqltest.c:
  Portability fix
mysys/my_bitmap.c:
  Remove compiler warning
mysys/my_handler.c:
  Remove compiler warning
mysys/thr_lock.c:
  Remove compiler warning
plugin/fulltext/plugin_example.c:
  Remove compiler warning
sql/ha_ndbcluster.h:
  Fixed wrong of handler flags (caused previous commit to fail)
sql/ha_ndbcluster_binlog.cc:
  Remove compiler warning
sql/handler.cc:
  Indentation cleanups
sql/mysql_priv.h:
  Changed log_output_options to ulong to remove compiler warning (and wrong test on 64 bit machines)
sql/mysqld.cc:
  Changed log_output_options to ulong to remove compiler warning (and wrong test on 64 bit machines)
  Split initialization of variables of different types to remove compiler warning
sql/set_var.cc:
  Fixed indentation
sql/set_var.h:
  sys_var_log_output now takes a pointer to ulong
storage/archive/archive_test.c:
  Remove compiler warning
2006-06-23 02:49:19 +03:00

48 lines
1.1 KiB
C

#include "azlib.h"
#include <stdio.h>
#define TEST_STRING "This is a test"
#define BUFFER_LEN 1024
int main(int argc __attribute__((unused)), char *argv[])
{
int ret;
azio_stream foo, foo1;
char buffer[BUFFER_LEN];
MY_INIT(argv[0]);
if (!(ret= azopen(&foo, "test", O_CREAT|O_WRONLY|O_TRUNC|O_BINARY)))
{
printf("Could not create test file\n");
return 0;
}
azwrite(&foo, TEST_STRING, sizeof(TEST_STRING));
azflush(&foo, Z_FINISH);
if (!(ret= azopen(&foo1, "test", O_RDONLY|O_BINARY)))
{
printf("Could not open test file\n");
return 0;
}
ret= azread(&foo1, buffer, BUFFER_LEN);
printf("Read %d bytes\n", ret);
printf("%s\n", buffer);
azrewind(&foo1);
azclose(&foo);
if (!(ret= azopen(&foo, "test", O_APPEND|O_WRONLY|O_BINARY)))
{
printf("Could not create test file\n");
return 0;
}
azwrite(&foo, TEST_STRING, sizeof(TEST_STRING));
azflush(&foo, Z_FINISH);
ret= azread(&foo1, buffer, BUFFER_LEN);
printf("Read %d bytes\n", ret);
printf("%s\n", buffer);
azclose(&foo);
azclose(&foo1);
/* unlink("test"); */
return 0;
}