Blame src/check_pack.h

Packit 0b5880
/*
Packit 0b5880
 * Check: a unit test framework for C
Packit 0b5880
 * Copyright (C) 2001, 2002 Arien Malec
Packit 0b5880
 *
Packit 0b5880
 * This library is free software; you can redistribute it and/or
Packit 0b5880
 * modify it under the terms of the GNU Lesser General Public
Packit 0b5880
 * License as published by the Free Software Foundation; either
Packit 0b5880
 * version 2.1 of the License, or (at your option) any later version.
Packit 0b5880
 *
Packit 0b5880
 * This library is distributed in the hope that it will be useful,
Packit 0b5880
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0b5880
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 0b5880
 * Lesser General Public License for more details.
Packit 0b5880
 *
Packit 0b5880
 * You should have received a copy of the GNU Lesser General Public
Packit 0b5880
 * License along with this library; if not, write to the
Packit 0b5880
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
Packit 0b5880
 * MA 02110-1301, USA.
Packit 0b5880
 */
Packit 0b5880
Packit 0b5880
#ifndef CHECK_PACK_H
Packit 0b5880
#define CHECK_PACK_H
Packit 0b5880
Packit 0b5880
Packit 0b5880
enum ck_msg_type
Packit 0b5880
{
Packit 0b5880
    CK_MSG_CTX,
Packit 0b5880
    CK_MSG_FAIL,
Packit 0b5880
    CK_MSG_LOC,
Packit 0b5880
    CK_MSG_DURATION,
Packit 0b5880
    CK_MSG_LAST
Packit 0b5880
};
Packit 0b5880
Packit 0b5880
typedef struct CtxMsg
Packit 0b5880
{
Packit 0b5880
    enum ck_result_ctx ctx;
Packit 0b5880
} CtxMsg;
Packit 0b5880
Packit 0b5880
typedef struct LocMsg
Packit 0b5880
{
Packit 0b5880
    int line;
Packit 0b5880
    char *file;
Packit 0b5880
} LocMsg;
Packit 0b5880
Packit 0b5880
typedef struct FailMsg
Packit 0b5880
{
Packit 0b5880
    char *msg;
Packit 0b5880
} FailMsg;
Packit 0b5880
Packit 0b5880
typedef struct DurationMsg
Packit 0b5880
{
Packit 0b5880
    int duration;
Packit 0b5880
} DurationMsg;
Packit 0b5880
Packit 0b5880
typedef union
Packit 0b5880
{
Packit 0b5880
    CtxMsg ctx_msg;
Packit 0b5880
    FailMsg fail_msg;
Packit 0b5880
    LocMsg loc_msg;
Packit 0b5880
    DurationMsg duration_msg;
Packit 0b5880
} CheckMsg;
Packit 0b5880
Packit 0b5880
typedef struct RcvMsg
Packit 0b5880
{
Packit 0b5880
    enum ck_result_ctx lastctx;
Packit 0b5880
    enum ck_result_ctx failctx;
Packit 0b5880
    char *fixture_file;
Packit 0b5880
    int fixture_line;
Packit 0b5880
    char *test_file;
Packit 0b5880
    int test_line;
Packit 0b5880
    char *msg;
Packit 0b5880
    int duration;
Packit 0b5880
} RcvMsg;
Packit 0b5880
Packit 0b5880
void rcvmsg_free(RcvMsg * rmsg);
Packit 0b5880
Packit 0b5880
Packit 0b5880
int pack(enum ck_msg_type type, char **buf, CheckMsg * msg);
Packit 0b5880
int upack(char *buf, CheckMsg * msg, enum ck_msg_type *type);
Packit 0b5880
Packit 0b5880
void ppack(FILE * fdes, enum ck_msg_type type, CheckMsg * msg);
Packit 0b5880
RcvMsg *punpack(FILE * fdes);
Packit 0b5880
Packit 0b5880
#endif /*CHECK_PACK_H */