예제 #1
0
파일: my_api.cpp 프로젝트: 0b1kn00b/hxcpp
MYSQL_RES *mysql_store_result( MYSQL *m ) {
	MYSQL_RES *r;
	MYSQL_PACKET *p = &m->packet;
	if( p->id != IS_QUERY )
		return NULL;
	// OK without result
	if( p->buf[0] == 0 ) {
		p->pos = 0;
		m->last_field_count = myp_read_byte(p); // 0
		m->affected_rows = myp_read_bin(p);
		m->last_insert_id = myp_read_bin(p);
		return NULL;
	}
	r = (MYSQL_RES*)malloc(sizeof(struct _MYSQL_RES));
	memset(r,0,sizeof(struct _MYSQL_RES));
	m->errcode = 0;
	if( !do_store(m,r) ) {
		mysql_free_result(r);
		if( !m->errcode )
			error(m,"Failure while storing result",NULL);
		return NULL;
	}
	m->last_field_count = r->nfields;
	return r;
}
예제 #2
0
파일: ssl_conf.c 프로젝트: ZuyingWo/openssl
static int cmd_VerifyCAFile(SSL_CONF_CTX *cctx, const char *value)
{
    return do_store(cctx, value, NULL, 1);
}
예제 #3
0
파일: ssl_conf.c 프로젝트: ZuyingWo/openssl
static int cmd_ChainCAFile(SSL_CONF_CTX *cctx, const char *value)
{
    return do_store(cctx, value, NULL, 0);
}
예제 #4
0
  SB_BINLOG;
  //data_prepare_stats (&sb);
  sb_printf (&sb, "%s\n", FullVersionStr);
  return sb.pos;
}

int memcache_stats (struct connection *c) {
  cmd_stats++;
  int stats_len = seqmap_prepare_stats (c);
  write_out (&c->Out, stats_buff, stats_len);
  write_out (&c->Out, "END\r\n", 5);
  return 0;
}

TL_DO_FUN(store)
  int res = do_store (e->mode, e->key_len, e->data, e->value_len, e->data + e->key_len, e->time, e->force);
  if (res < 0) { return res; }
  tl_store_int (res <= 0 ? TL_BOOL_FALSE : TL_BOOL_TRUE);
TL_DO_FUN_END

TL_DO_FUN(delete)
  int res = do_delete (e->key_len, e->data, e->force);
  if (res < 0) { return res; }
  tl_store_int (res <= 0 ? TL_BOOL_FALSE : TL_BOOL_TRUE);
TL_DO_FUN_END

TL_DO_FUN(get)
  struct item *I = get (e->key_len, e->data);
  if (!I) {
    return -2;
  }