/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */1/*2* Copyright 2007 Massachusetts Institute of Technology.3* All Rights Reserved.4*5* Export of this software from the United States of America may6* require a specific license from the United States Government.7* It is the responsibility of any person or organization contemplating8* export to obtain such a license before exporting.9*10* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and11* distribute this software and its documentation for any purpose and12* without fee is hereby granted, provided that the above copyright13* notice appear in all copies and that both that copyright notice and14* this permission notice appear in supporting documentation, and that15* the name of M.I.T. not be used in advertising or publicity pertaining16* to distribution of the software without specific, written prior17* permission. Furthermore if you modify this software you must label18* your software as modified software and not distribute it in such a19* fashion that it might be confused with the original M.I.T. software.20* M.I.T. makes no representations about the suitability of21* this software for any purpose. It is provided "as is" without express22* or implied warranty.23*/24/*25* Copyright 1987, 1988, 1989 by MIT Student Information Processing26* Board27*28* For copyright information, see copyright.h.29*/3031#include "ss_internal.h"32#include "com_err.h"33#include "copyright.h"3435char *36ss_name(int sci_idx)37{38ss_data *infop;3940infop = ss_info(sci_idx);41if (infop->current_request == (char const *)NULL) {42return strdup(infop->subsystem_name);43} else {44char *ret_val;45if (asprintf(&ret_val, "%s (%s)",46infop->subsystem_name, infop->current_request) < 0)47return NULL;48return ret_val;49}50}5152void53ss_error(int sci_idx, long code, const char *fmt, ...)54{55char *whoami;56va_list pvar;57va_start (pvar, fmt);58whoami = ss_name (sci_idx);59com_err_va (whoami, code, fmt, pvar);60free (whoami);61va_end(pvar);62}6364void65ss_perror(int sci_idx, long code, char const *msg) /* for compatibility */66{67ss_error (sci_idx, code, "%s", msg);68}697071