Blame src/tests/asn.1/utility.h

Packit fd8b60
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
Packit fd8b60
/* tests/asn.1/utility.h */
Packit fd8b60
/*
Packit fd8b60
 * Copyright (C) 1994 by the Massachusetts Institute of Technology.
Packit fd8b60
 * All rights reserved.
Packit fd8b60
 *
Packit fd8b60
 * Export of this software from the United States of America may
Packit fd8b60
 *   require a specific license from the United States Government.
Packit fd8b60
 *   It is the responsibility of any person or organization contemplating
Packit fd8b60
 *   export to obtain such a license before exporting.
Packit fd8b60
 *
Packit fd8b60
 * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
Packit fd8b60
 * distribute this software and its documentation for any purpose and
Packit fd8b60
 * without fee is hereby granted, provided that the above copyright
Packit fd8b60
 * notice appear in all copies and that both that copyright notice and
Packit fd8b60
 * this permission notice appear in supporting documentation, and that
Packit fd8b60
 * the name of M.I.T. not be used in advertising or publicity pertaining
Packit fd8b60
 * to distribution of the software without specific, written prior
Packit fd8b60
 * permission.  Furthermore if you modify this software you must label
Packit fd8b60
 * your software as modified software and not distribute it in such a
Packit fd8b60
 * fashion that it might be confused with the original M.I.T. software.
Packit fd8b60
 * M.I.T. makes no representations about the suitability of
Packit fd8b60
 * this software for any purpose.  It is provided "as is" without express
Packit fd8b60
 * or implied warranty.
Packit fd8b60
 */
Packit fd8b60
Packit fd8b60
#ifndef __UTILITY_H__
Packit fd8b60
#define __UTILITY_H__
Packit fd8b60
Packit fd8b60
#include "k5-int.h"
Packit fd8b60
Packit fd8b60
/* Aborts on failure.  ealloc returns zero-filled memory. */
Packit fd8b60
void *ealloc(size_t size);
Packit fd8b60
char *estrdup(const char *str);
Packit fd8b60
Packit fd8b60
void asn1_krb5_data_unparse(const krb5_data *code, char **s);
Packit fd8b60
/* modifies  *s;
Packit fd8b60
   effects   Instantiates *s with a string representation of the series
Packit fd8b60
              of hex octets in *code.  (e.g. "02 02 00 7F")  If code==NULL,
Packit fd8b60
              the string rep is "<NULL>".  If code is empty (it contains no
Packit fd8b60
              data or has length <= 0), the string rep is "<EMPTY>".
Packit fd8b60
             If *s is non-NULL, then its currently-allocated storage
Packit fd8b60
              will be freed prior to the instantiation.
Packit fd8b60
             Returns ENOMEM or the string rep cannot be created. */
Packit fd8b60
Packit fd8b60
void krb5_data_parse(krb5_data *d, const char *s);
Packit fd8b60
/* effects  Parses character string *s into krb5_data *d. */
Packit fd8b60
Packit fd8b60
krb5_error_code krb5_data_hex_parse(krb5_data *d, const char *s);
Packit fd8b60
/* requires  *s is the string representation of a sequence of
Packit fd8b60
              hexadecimal octets.  (e.g. "02 01 00")
Packit fd8b60
   effects  Parses *s into krb5_data *d. */
Packit fd8b60
Packit fd8b60
extern krb5int_access acc;
Packit fd8b60
extern void init_access(const char *progname);
Packit fd8b60
Packit fd8b60
#endif