2009-07-16 17:39:16 +00:00
|
|
|
/*
|
|
|
|
* Check: a unit test framework for C
|
|
|
|
* Copyright (C) 2001, 2002 Arien Malec
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2009-07-16 17:39:16 +00:00
|
|
|
*/
|
|
|
|
|
2009-12-18 21:28:35 +00:00
|
|
|
#include "config.h"
|
2009-07-16 17:39:16 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2009-12-18 21:28:35 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
#include <unistd.h>
|
2009-07-16 17:39:16 +00:00
|
|
|
#endif
|
|
|
|
|
2009-12-18 21:28:35 +00:00
|
|
|
#include "_stdint.h"
|
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
#include "check.h"
|
|
|
|
#include "check_error.h"
|
|
|
|
#include "check_list.h"
|
|
|
|
#include "check_impl.h"
|
|
|
|
#include "check_pack.h"
|
|
|
|
|
2009-12-17 20:09:48 +00:00
|
|
|
#ifdef HAVE_PTHREAD
|
2009-12-18 21:28:35 +00:00
|
|
|
#include <pthread.h>
|
2009-10-12 11:50:51 +00:00
|
|
|
pthread_mutex_t lock_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
|
|
#else
|
|
|
|
#define pthread_mutex_lock(arg)
|
|
|
|
#define pthread_mutex_unlock(arg)
|
|
|
|
#endif
|
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
/* typedef an unsigned int that has at least 4 bytes */
|
|
|
|
typedef uint32_t ck_uint32;
|
|
|
|
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void pack_int (char **buf, int val);
|
|
|
|
static int upack_int (char **buf);
|
|
|
|
static void pack_str (char **buf, const char *str);
|
|
|
|
static char *upack_str (char **buf);
|
|
|
|
|
|
|
|
static int pack_ctx (char **buf, CtxMsg * cmsg);
|
|
|
|
static int pack_loc (char **buf, LocMsg * lmsg);
|
|
|
|
static int pack_fail (char **buf, FailMsg * fmsg);
|
|
|
|
static void upack_ctx (char **buf, CtxMsg * cmsg);
|
|
|
|
static void upack_loc (char **buf, LocMsg * lmsg);
|
|
|
|
static void upack_fail (char **buf, FailMsg * fmsg);
|
|
|
|
|
|
|
|
static void check_type (int type, const char *file, int line);
|
2009-07-16 17:39:16 +00:00
|
|
|
static enum ck_msg_type upack_type (char **buf);
|
2009-10-12 11:49:35 +00:00
|
|
|
static void pack_type (char **buf, enum ck_msg_type type);
|
2009-07-16 17:39:16 +00:00
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int read_buf (int fdes, char **buf);
|
|
|
|
static int get_result (char *buf, RcvMsg * rmsg);
|
|
|
|
static void rcvmsg_update_ctx (RcvMsg * rmsg, enum ck_result_ctx ctx);
|
|
|
|
static void rcvmsg_update_loc (RcvMsg * rmsg, const char *file, int line);
|
2009-07-16 17:39:16 +00:00
|
|
|
static RcvMsg *rcvmsg_create (void);
|
2009-10-12 11:49:35 +00:00
|
|
|
void rcvmsg_free (RcvMsg * rmsg);
|
2009-07-16 17:39:16 +00:00
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
typedef int (*pfun) (char **, CheckMsg *);
|
2009-07-16 17:39:16 +00:00
|
|
|
typedef void (*upfun) (char **, CheckMsg *);
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static pfun pftab[] = {
|
2009-07-16 17:39:16 +00:00
|
|
|
(pfun) pack_ctx,
|
|
|
|
(pfun) pack_fail,
|
|
|
|
(pfun) pack_loc
|
|
|
|
};
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static upfun upftab[] = {
|
2009-07-16 17:39:16 +00:00
|
|
|
(upfun) upack_ctx,
|
|
|
|
(upfun) upack_fail,
|
|
|
|
(upfun) upack_loc
|
|
|
|
};
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
int
|
|
|
|
pack (enum ck_msg_type type, char **buf, CheckMsg * msg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
if (buf == NULL)
|
|
|
|
return -1;
|
|
|
|
if (msg == NULL)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
check_type (type, __FILE__, __LINE__);
|
|
|
|
|
|
|
|
return pftab[type] (buf, msg);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
int
|
|
|
|
upack (char *buf, CheckMsg * msg, enum ck_msg_type *type)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *obuf;
|
|
|
|
int nread;
|
|
|
|
|
|
|
|
if (buf == NULL)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
obuf = buf;
|
|
|
|
|
|
|
|
*type = upack_type (&buf);
|
|
|
|
|
|
|
|
check_type (*type, __FILE__, __LINE__);
|
2009-10-12 11:49:35 +00:00
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
upftab[*type] (&buf, msg);
|
|
|
|
|
|
|
|
nread = buf - obuf;
|
|
|
|
return nread;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
pack_int (char **buf, int val)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
unsigned char *ubuf = (unsigned char *) *buf;
|
|
|
|
ck_uint32 uval = val;
|
|
|
|
|
|
|
|
ubuf[0] = (uval >> 24) & 0xFF;
|
|
|
|
ubuf[1] = (uval >> 16) & 0xFF;
|
2009-10-12 11:49:35 +00:00
|
|
|
ubuf[2] = (uval >> 8) & 0xFF;
|
2009-07-16 17:39:16 +00:00
|
|
|
ubuf[3] = uval & 0xFF;
|
|
|
|
|
|
|
|
*buf += 4;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int
|
|
|
|
upack_int (char **buf)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
unsigned char *ubuf = (unsigned char *) *buf;
|
|
|
|
ck_uint32 uval;
|
|
|
|
|
|
|
|
uval = ((ubuf[0] << 24) | (ubuf[1] << 16) | (ubuf[2] << 8) | ubuf[3]);
|
|
|
|
|
|
|
|
*buf += 4;
|
|
|
|
|
|
|
|
return (int) uval;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
pack_str (char **buf, const char *val)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
int strsz;
|
|
|
|
|
|
|
|
if (val == NULL)
|
|
|
|
strsz = 0;
|
|
|
|
else
|
|
|
|
strsz = strlen (val);
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
pack_int (buf, strsz);
|
2009-07-16 17:39:16 +00:00
|
|
|
|
|
|
|
if (strsz > 0) {
|
|
|
|
memcpy (*buf, val, strsz);
|
|
|
|
*buf += strsz;
|
2009-10-12 11:49:35 +00:00
|
|
|
}
|
2009-07-16 17:39:16 +00:00
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static char *
|
|
|
|
upack_str (char **buf)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *val;
|
|
|
|
int strsz;
|
|
|
|
|
|
|
|
strsz = upack_int (buf);
|
|
|
|
|
|
|
|
if (strsz > 0) {
|
|
|
|
val = emalloc (strsz + 1);
|
|
|
|
memcpy (val, *buf, strsz);
|
|
|
|
val[strsz] = 0;
|
|
|
|
*buf += strsz;
|
|
|
|
} else {
|
|
|
|
val = emalloc (1);
|
|
|
|
*val = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
pack_type (char **buf, enum ck_msg_type type)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
pack_int (buf, (int) type);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static enum ck_msg_type
|
|
|
|
upack_type (char **buf)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
return (enum ck_msg_type) upack_int (buf);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
|
|
|
|
static int
|
|
|
|
pack_ctx (char **buf, CtxMsg * cmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *ptr;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
len = 4 + 4;
|
|
|
|
*buf = ptr = emalloc (len);
|
2009-10-12 11:49:35 +00:00
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
pack_type (&ptr, CK_MSG_CTX);
|
|
|
|
pack_int (&ptr, (int) cmsg->ctx);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
upack_ctx (char **buf, CtxMsg * cmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
cmsg->ctx = upack_int (buf);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int
|
|
|
|
pack_loc (char **buf, LocMsg * lmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *ptr;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
len = 4 + 4 + (lmsg->file ? strlen (lmsg->file) : 0) + 4;
|
|
|
|
*buf = ptr = emalloc (len);
|
|
|
|
|
|
|
|
pack_type (&ptr, CK_MSG_LOC);
|
|
|
|
pack_str (&ptr, lmsg->file);
|
|
|
|
pack_int (&ptr, lmsg->line);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
upack_loc (char **buf, LocMsg * lmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
lmsg->file = upack_str (buf);
|
|
|
|
lmsg->line = upack_int (buf);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int
|
|
|
|
pack_fail (char **buf, FailMsg * fmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *ptr;
|
|
|
|
int len;
|
|
|
|
|
|
|
|
len = 4 + 4 + (fmsg->msg ? strlen (fmsg->msg) : 0);
|
|
|
|
*buf = ptr = emalloc (len);
|
|
|
|
|
|
|
|
pack_type (&ptr, CK_MSG_FAIL);
|
|
|
|
pack_str (&ptr, fmsg->msg);
|
|
|
|
|
|
|
|
return len;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
upack_fail (char **buf, FailMsg * fmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
fmsg->msg = upack_str (buf);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
check_type (int type, const char *file, int line)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
if (type < 0 || type >= CK_MSG_LAST)
|
2009-10-12 11:50:51 +00:00
|
|
|
eprintf ("Bad message type arg %d", file, line, type);
|
2009-07-16 17:39:16 +00:00
|
|
|
}
|
|
|
|
|
2009-12-17 20:09:48 +00:00
|
|
|
#ifdef HAVE_PTHREAD
|
2009-10-12 11:50:51 +00:00
|
|
|
pthread_mutex_t mutex_lock = PTHREAD_MUTEX_INITIALIZER;
|
|
|
|
#endif
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
void
|
|
|
|
ppack (int fdes, enum ck_msg_type type, CheckMsg * msg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *buf;
|
|
|
|
int n;
|
|
|
|
ssize_t r;
|
|
|
|
|
|
|
|
n = pack (type, &buf, msg);
|
2009-10-12 11:50:51 +00:00
|
|
|
pthread_mutex_lock (&mutex_lock);
|
2009-07-16 17:39:16 +00:00
|
|
|
r = write (fdes, buf, n);
|
2009-10-12 11:50:51 +00:00
|
|
|
pthread_mutex_unlock (&mutex_lock);
|
2009-07-16 17:39:16 +00:00
|
|
|
if (r == -1)
|
|
|
|
eprintf ("Error in call to write:", __FILE__, __LINE__ - 2);
|
|
|
|
|
|
|
|
free (buf);
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int
|
|
|
|
read_buf (int fdes, char **buf)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
char *readloc;
|
|
|
|
int n;
|
|
|
|
int nread = 0;
|
|
|
|
int size = 1;
|
|
|
|
int grow = 2;
|
2009-10-12 11:49:35 +00:00
|
|
|
|
|
|
|
*buf = emalloc (size);
|
2009-07-16 17:39:16 +00:00
|
|
|
readloc = *buf;
|
|
|
|
while (1) {
|
|
|
|
n = read (fdes, readloc, size - nread);
|
|
|
|
if (n == 0)
|
|
|
|
break;
|
|
|
|
if (n == -1)
|
|
|
|
eprintf ("Error in call to read:", __FILE__, __LINE__ - 4);
|
|
|
|
|
|
|
|
nread += n;
|
|
|
|
size *= grow;
|
2009-10-12 11:49:35 +00:00
|
|
|
*buf = erealloc (*buf, size);
|
2009-07-16 17:39:16 +00:00
|
|
|
readloc = *buf + nread;
|
|
|
|
}
|
|
|
|
|
|
|
|
return nread;
|
2009-10-12 11:49:35 +00:00
|
|
|
}
|
2009-07-16 17:39:16 +00:00
|
|
|
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static int
|
|
|
|
get_result (char *buf, RcvMsg * rmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
enum ck_msg_type type;
|
|
|
|
CheckMsg msg;
|
|
|
|
int n;
|
|
|
|
|
|
|
|
n = upack (buf, &msg, &type);
|
|
|
|
if (n == -1)
|
|
|
|
eprintf ("Error in call to upack", __FILE__, __LINE__ - 2);
|
2009-10-12 11:49:35 +00:00
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
if (type == CK_MSG_CTX) {
|
2009-10-12 11:49:35 +00:00
|
|
|
CtxMsg *cmsg = (CtxMsg *) & msg;
|
2009-07-16 17:39:16 +00:00
|
|
|
rcvmsg_update_ctx (rmsg, cmsg->ctx);
|
|
|
|
} else if (type == CK_MSG_LOC) {
|
2009-10-12 11:49:35 +00:00
|
|
|
LocMsg *lmsg = (LocMsg *) & msg;
|
|
|
|
if (rmsg->failctx == CK_CTX_INVALID) {
|
2009-07-16 17:39:16 +00:00
|
|
|
rcvmsg_update_loc (rmsg, lmsg->file, lmsg->line);
|
|
|
|
}
|
|
|
|
free (lmsg->file);
|
2009-10-12 11:49:35 +00:00
|
|
|
} else if (type == CK_MSG_FAIL) {
|
|
|
|
FailMsg *fmsg = (FailMsg *) & msg;
|
|
|
|
if (rmsg->msg == NULL) {
|
2009-07-16 17:39:16 +00:00
|
|
|
rmsg->msg = emalloc (strlen (fmsg->msg) + 1);
|
|
|
|
strcpy (rmsg->msg, fmsg->msg);
|
|
|
|
rmsg->failctx = rmsg->lastctx;
|
2009-10-12 11:49:35 +00:00
|
|
|
} else {
|
2009-07-16 17:39:16 +00:00
|
|
|
/* Skip subsequent failure messages, only happens for CK_NOFORK */
|
|
|
|
}
|
|
|
|
free (fmsg->msg);
|
|
|
|
} else
|
|
|
|
check_type (type, __FILE__, __LINE__);
|
|
|
|
|
|
|
|
return n;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
reset_rcv_test (RcvMsg * rmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
rmsg->test_line = -1;
|
|
|
|
rmsg->test_file = NULL;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
reset_rcv_fixture (RcvMsg * rmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
rmsg->fixture_line = -1;
|
|
|
|
rmsg->fixture_file = NULL;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static RcvMsg *
|
|
|
|
rcvmsg_create (void)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
RcvMsg *rmsg;
|
|
|
|
|
|
|
|
rmsg = emalloc (sizeof (RcvMsg));
|
|
|
|
rmsg->lastctx = CK_CTX_INVALID;
|
|
|
|
rmsg->failctx = CK_CTX_INVALID;
|
|
|
|
rmsg->msg = NULL;
|
|
|
|
reset_rcv_test (rmsg);
|
|
|
|
reset_rcv_fixture (rmsg);
|
|
|
|
return rmsg;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
void
|
|
|
|
rcvmsg_free (RcvMsg * rmsg)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
2009-10-12 11:49:35 +00:00
|
|
|
free (rmsg->fixture_file);
|
|
|
|
free (rmsg->test_file);
|
|
|
|
free (rmsg->msg);
|
|
|
|
free (rmsg);
|
2009-07-16 17:39:16 +00:00
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
rcvmsg_update_ctx (RcvMsg * rmsg, enum ck_result_ctx ctx)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
2009-10-12 11:49:35 +00:00
|
|
|
if (rmsg->lastctx != CK_CTX_INVALID) {
|
|
|
|
free (rmsg->fixture_file);
|
2009-07-16 17:39:16 +00:00
|
|
|
reset_rcv_fixture (rmsg);
|
|
|
|
}
|
|
|
|
rmsg->lastctx = ctx;
|
|
|
|
}
|
|
|
|
|
2009-10-12 11:49:35 +00:00
|
|
|
static void
|
|
|
|
rcvmsg_update_loc (RcvMsg * rmsg, const char *file, int line)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
2009-10-12 11:49:35 +00:00
|
|
|
int flen = strlen (file);
|
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
if (rmsg->lastctx == CK_CTX_TEST) {
|
2009-10-12 11:49:35 +00:00
|
|
|
free (rmsg->test_file);
|
2009-07-16 17:39:16 +00:00
|
|
|
rmsg->test_line = line;
|
|
|
|
rmsg->test_file = emalloc (flen + 1);
|
|
|
|
strcpy (rmsg->test_file, file);
|
|
|
|
} else {
|
2009-10-12 11:49:35 +00:00
|
|
|
free (rmsg->fixture_file);
|
2009-07-16 17:39:16 +00:00
|
|
|
rmsg->fixture_line = line;
|
|
|
|
rmsg->fixture_file = emalloc (flen + 1);
|
|
|
|
strcpy (rmsg->fixture_file, file);
|
|
|
|
}
|
|
|
|
}
|
2009-10-12 11:49:35 +00:00
|
|
|
|
|
|
|
RcvMsg *
|
|
|
|
punpack (int fdes)
|
2009-07-16 17:39:16 +00:00
|
|
|
{
|
|
|
|
int nread, n;
|
|
|
|
char *buf;
|
|
|
|
char *obuf;
|
|
|
|
RcvMsg *rmsg;
|
|
|
|
|
|
|
|
nread = read_buf (fdes, &buf);
|
|
|
|
obuf = buf;
|
|
|
|
rmsg = rcvmsg_create ();
|
2009-10-12 11:49:35 +00:00
|
|
|
|
2009-07-16 17:39:16 +00:00
|
|
|
while (nread > 0) {
|
|
|
|
n = get_result (buf, rmsg);
|
|
|
|
nread -= n;
|
|
|
|
buf += n;
|
|
|
|
}
|
|
|
|
|
|
|
|
free (obuf);
|
|
|
|
if (rmsg->lastctx == CK_CTX_INVALID) {
|
|
|
|
free (rmsg);
|
|
|
|
rmsg = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return rmsg;
|
|
|
|
}
|