* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pqformat.c,v 1.21 2002/06/20 20:29:28 momjian Exp $
+ * $Id: pqformat.c,v 1.22 2002/08/08 06:32:26 ishii Exp $
*
*-------------------------------------------------------------------------
*/
#include "libpq/libpq.h"
#include "libpq/pqformat.h"
-#ifdef MULTIBYTE
#include "mb/pg_wchar.h"
-#endif
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#endif
void
pq_sendcountedtext(StringInfo buf, const char *str, int slen)
{
-#ifdef MULTIBYTE
char *p;
p = (char *) pg_server_to_client((unsigned char *) str, slen);
pfree(p);
return;
}
-#endif
pq_sendint(buf, slen + 4, 4);
appendBinaryStringInfo(buf, str, slen);
}
{
int slen = strlen(str);
-#ifdef MULTIBYTE
char *p;
p = (char *) pg_server_to_client((unsigned char *) str, slen);
pfree(p);
return;
}
-#endif
appendBinaryStringInfo(buf, str, slen + 1);
}
pq_puttextmessage(char msgtype, const char *str)
{
int slen = strlen(str);
-
-#ifdef MULTIBYTE
char *p;
p = (char *) pg_server_to_client((unsigned char *) str, slen);
pfree(p);
return result;
}
-#endif
return pq_putmessage(msgtype, str, slen + 1);
}
pq_getstr(StringInfo s)
{
int result;
-
-#ifdef MULTIBYTE
char *p;
-#endif
result = pq_getstring(s);
-#ifdef MULTIBYTE
p = (char *) pg_client_to_server((unsigned char *) s->data, s->len);
if (p != s->data) /* actual conversion has been done? */
{
appendBinaryStringInfo(s, p, strlen(p));
pfree(p);
}
-#endif
return result;
}