cfga_sdcard.c revision 4bb7efa72ed531c10f097919636e67724ec4c25a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include "cfga_sdcard.h"
/*
* This file contains the entry points to the plug-in as defined in the
* config_admin(3X) man page.
*/
/*
* Set the version number for the cfgadm library's use.
*/
int cfga_version = CFGA_HSL_V2;
enum {
HELP_HEADER = 1,
};
/* SDCARD specific help messages */
static char *sdcard_help[] = {
NULL,
"SD card specific commands:\n",
" cfgadm -c [configure|unconfigure|disconnect|connect] ap_id "
"[ap_id...]\n",
" cfgadm -x sdcard_reset_slot ap_id [ap_id...]\n",
"\tunknown command or option:\n",
}; /* End help messages */
/*
* Messages.
*/
static msgcvt_t sdcard_msgs[] = {
/* CFGA_SDCARD_OK */
/* CFGA_SDCARD_NACK */
/* CFGA_SDCARD_UNKNOWN / CFGA_LIB_ERROR -> "Library error" */
/* CFGA_SDCARD_PRIV / CFGA_PRIV -> "Insufficient privileges" */
/*
* CFGA_SDCARD_DYNAMIC_AP /
* CFGA_LIB_ERROR -> "Configuration operation invalid"
*/
/* CFGA_SDCARD_INTERNAL_ERROR / CFGA_LIB_ERROR -> "Library error" */
/* CFGA_SDCARD_ALLOC_FAIL / CFGA_LIB_ERROR -> "Library error" */
/* CFGA_SDCARD_IOCTL / CFGA_ERROR -> "Hardware specific failure" */
/* CFGA_SDCARD_DEVCTL / CFGA_LIB_ERROR -> "Library error" */
"Cannot allocate devctl handle " },
/* CFGA_SDCARD_AP / CFGA_APID_NOEXIST -> "Attachment point not found" */
/*
* CFGA_SDCARD_BUSY /
* CFGA_SYSTEM_BUSY -> "System is busy, try again"
*/
/* CFGA_SDCARD_DEVLINK / CFGA_LIB_ERROR -> "Library error" */
/*
* CFGA_SDCARD_INVALID_DEVNAME /
* CFGA_INVAL -> "Configuration operation invalid"
*/
/* CFGA_SDCARD_DATA_ERROR / CFGA_DATA_ERROR -> "Data error" */
/*
* CFGA_SDCARD_DEV_CONFIGURE /
* CFGA_ERROR -> "Hardware specific failure"
*/
/*
* CFGA_SDCARD_DEV_UNCONFIGURE /
* CFGA_ERROR -> "Hardware specific failure"
*/
/*
* CFGA_SDCARD_NOT_CONNECTED
* CFGA_INVAL -> "Configuration operation invalid"
*/
/*
* CFGA_SDCARD_DISCONNECTED
* CFGA_INVAL -> "Configuration operation invalid"
*/
/*
* CFGA_SDCARD_NOT_CONFIGURED /
* CFGA_INVAL -> "Configuration operation invalid"
*/
/*
* CFGA_SDCARD_ALREADY_CONNECTED /
* CFGA_INVAL -> "Configuration operation invalid"
*/
/*
* CFGA_SDCARD_ALREADY_CONFIGURED /
* CFGA_INVAL -> "Configuration operation invalid"
*/
/* CFGA_SDCARD_DEVICE_UNCONFIGURED */
/*
* CFGA_SDCARD_OPNOTSUPP /
* CFGA_OPNOTSUPP -> "Configuration operation not supported"
*/
/*
* CFGA_SDCARD_HWOPNOTSUPP /
* CFGA_ERROR -> "Hardware specific failure"
*/
/* CFGA_SDCARD_OPTIONS / CFGA_ERROR -> "Hardware specific failure" */
/* CFGA_SDCARD_STATE / CFGA_LIB_ERROR -> "Library error" */
/* CFGA_SDCARD_OPEN / CFGA_LIB_ERROR -> "Library error" */
/*
* CFGA_SDCARD_RCM_HANDLE /
* CFGA_ERROR -> "Hardware specific failure"
*/
/*
* CFGA_SDCARD_RCM_OFFLINE /
* CFGA_SYSTEM_BUSY -> "System is busy, try again"
*/
/*
* CFGA_SDCARD_RCM_REMOVE /
* CFGA_SYSTEM_BUSY -> "System is busy, try again"
*/
/*
* CFGA_SDCARD_RCM_ONLINE /
* CFGA_SYSTEM_BUSY -> "System is busy, try again"
*/
/* CFGA_SDCARD_CONFIRM_RESET */
"This will operation will disrupt activity on the SD card.\n"
"Continue"
},
/* CFGA_SDCARD_CONFIRM_UNCONFIGURE */
"This will operation will disrupt activity on the SD card.\n"
"Continue"
},
/* CFGA_SDCARD_CONFIRM_DISCONNECT */
"This will operation will disrupt activity on the SD card.\n"
"Continue"
}
};
static cfga_err_t
static cfga_sdcard_ret_t
static cfga_sdcard_ret_t
static cfga_sdcard_ret_t
static cfga_sdcard_ret_t
static void
static cfga_sdcard_ret_t
static cfga_sdcard_ret_t
sdcard_reset_slot(const char *ap_id);
static int
static cfga_sdcard_ret_t
sdcard_rcm_offline(char *, char **, cfga_flags_t);
static void
sdcard_rcm_online(char *, char **);
static void
sdcard_rcm_remove(char *, char **);
static void
sdcard_rcm_info_table(rcm_info_t *, char **);
static cfga_sdcard_ret_t
sdcard_rcm_init(void);
/* Utilities */
static cfga_sdcard_ret_t
{
char *linkpath;
char *buf;
char *real_path;
int deplen;
int err = 0;
char *p;
/*
* Using libdevinfo for this is overkill and kills performance
* when multiple consumers of libcfgadm are executing
* concurrently.
*/
return (CFGA_SDCARD_INTERNAL_ERROR);
}
sizeof (struct dirent);
goto pp_cleanup;
}
continue;
continue;
goto pp_cleanup;
}
continue;
/*
* realpath() is too darn slow, so fake
* it, by using what we know about /dev
* links: they are always of the form:
* <"../">+/devices/<path>
*/
p = buf;
p += 3;
if (p != buf)
p--; /* back up to get a slash */
assert (*p == '/');
goto pp_cleanup;
}
}
}
}
if (err != 0) {
return (CFGA_SDCARD_INTERNAL_ERROR);
}
return (CFGA_SDCARD_OK);
if (dp)
if (dep)
if (linkpath)
if (buf)
if (real_path)
if (*logpp) {
}
return (rv);
}
/*
* Given the index into a table (msgcvt_t) of messages, get the message
* string, converting it to the proper locale if necessary.
* NOTE: Indexes are defined in cfga_sdcard.h
*/
static const char *
{
}
}
/*
* Allocates and creates a message string (in *ret_str),
* by concatenating all the (char *) args together, in order.
* Last arg MUST be NULL.
*/
static void
{
char *str;
/* We're screwed */
return;
}
}
}
/*
* Error message handling.
* For the rv passed in, looks up the corresponding error message string(s),
* internationalized if necessary, and concatenates it into a new
* memory buffer, and points *errstring to it.
* Note not all rvs will result in an error message return, as not all
* error conditions warrant an SD-specific error message - for those
* conditions the cfgadm generic messages are sufficient.
*
* Some messages may display ap_id or errno, which is why they are passed
* in.
*/
char **errstring,
const char *ap_id,
int l_errno)
{
}
/*
* Generate the appropriate SDCARD-specific error message(s) (if any).
*/
switch (rv) {
case CFGA_SDCARD_OK:
case CFGA_NACK:
/* Special case - do nothing. */
break;
case CFGA_SDCARD_UNKNOWN:
case CFGA_SDCARD_PRIV:
case CFGA_SDCARD_DYNAMIC_AP:
case CFGA_SDCARD_ALLOC_FAIL:
case CFGA_SDCARD_DATA_ERROR:
case CFGA_SDCARD_OPNOTSUPP:
case CFGA_SDCARD_OPTIONS:
case CFGA_SDCARD_STATE:
/* These messages require no additional strings passed. */
break;
case CFGA_SDCARD_HWOPNOTSUPP:
/* hardware-specific help needed */
break;
case CFGA_SDCARD_AP:
case CFGA_SDCARD_BUSY:
case CFGA_SDCARD_DEVLINK:
case CFGA_SDCARD_DISCONNECTED:
case CFGA_SDCARD_RCM_HANDLE:
case CFGA_SDCARD_RCM_ONLINE:
case CFGA_SDCARD_RCM_OFFLINE:
case CFGA_SDCARD_RCM_REMOVE:
/* These messages also print ap_id. */
break;
case CFGA_SDCARD_IOCTL:
/* These messages also print errno. */
{
break;
}
case CFGA_SDCARD_OPEN:
/* These messages also apid and errno. */
{
break;
}
default:
} /* end switch */
/*
* Determine the proper error code to send back to the cfgadm library.
*/
}
/*
* Entry points
*/
/* cfgadm entry point */
/*ARGSUSED*/
const char *ap_id,
const char *options,
struct cfga_confirm *confp,
char **errstring,
{
int ret;
char *pdyn;
int i;
char devpath[MAXPATHLEN];
char msg[256];
/*
* All sub-commands which can change state of device require
* root privileges.
*/
if (geteuid() != 0) {
goto bailout;
}
goto bailout;
}
goto bailout;
}
switch (state_change_cmd) {
case CFGA_CMD_CONFIGURE:
goto bailout;
if (ostate == AP_OSTATE_CONFIGURED) {
goto bailout;
}
/* Disallow dynamic AP name component */
goto bailout;
}
if (rstate == AP_RSTATE_EMPTY) {
goto bailout;
}
rv = CFGA_SDCARD_OK;
goto bailout;
}
for (i = 0; i < 15; i++) {
/*
* We wait up to ~30 seconds for this to complete.
* Hotplug is done asynchronously.
*/
if (rv == CFGA_SDCARD_OK)
break;
(void) sleep(2);
}
if (rv != CFGA_SDCARD_OK) {
goto bailout;
}
break;
case CFGA_CMD_UNCONFIGURE:
goto bailout;
if (rstate != AP_RSTATE_CONNECTED) {
goto bailout;
}
if (ostate != AP_OSTATE_CONFIGURED) {
goto bailout;
}
/* Strip off AP name dynamic component, if present */
*pdyn = '\0';
}
rv = CFGA_SDCARD_OK;
/*LINTED E_SEC_PRINTF_VAR_FMT*/
break;
}
(void) printf("cfga_change_state: "
"get device path failed\n");
break;
}
if (rv != CFGA_SDCARD_OK) {
break;
}
if (ret != 0) {
}
} else {
}
break;
case CFGA_CMD_DISCONNECT:
goto bailout;
if (rstate == AP_RSTATE_DISCONNECTED) {
goto bailout;
}
/* Strip off AP name dynamic component, if present */
*pdyn = '\0';
}
/*
* If the port originally with device attached and was
* unconfigured already, the devicepath for the sd will be
* removed. sdcard_get_devicepath in this case is not necessary.
*/
/* only call rcm_offline if the state was CONFIGURED */
if (ostate == AP_OSTATE_CONFIGURED) {
(void) printf(
"cfga_change_state: get path failed\n");
break;
}
/*LINTED E_SEC_PRINTF_VAR_FMT*/
break;
}
if (rv != CFGA_SDCARD_OK) {
break;
}
if (ret != 0) {
(void) printf(
"devctl_ap_unconfigure failed\n");
/*
* The current policy is that if unconfigure
* failed, do not continue with disconnect.
*/
break;
} else {
(void) printf("%s\n",
}
} else if (rstate == AP_RSTATE_CONNECTED ||
rstate == AP_RSTATE_EMPTY) {
/*LINTED E_SEC_PRINTF_VAR_FMT*/
break;
}
}
if (ret != 0) {
}
}
break;
case CFGA_CMD_CONNECT:
goto bailout;
if (rstate == AP_RSTATE_CONNECTED) {
goto bailout;
}
/* Disallow dynamic AP name component */
goto bailout;
}
if (ret != 0) {
} else {
rv = CFGA_SDCARD_OK;
}
break;
case CFGA_CMD_LOAD:
case CFGA_CMD_UNLOAD:
break;
case CFGA_CMD_NONE:
default:
}
}
/* cfgadm entry point */
/*ARGSUSED*/
const char *func,
const char *ap_id,
const char *options,
struct cfga_confirm *confp,
char **errstring,
{
char *str_p;
char msg[256];
}
/*
* All subcommands which can change state of device require
* root privileges.
*/
if (geteuid() != 0) {
goto bailout;
}
goto bailout;
}
goto bailout;
}
/* We do not care here about dynamic AP name component */
*str_p = '\0';
}
/*LINTED E_SEC_PRINTF_VAR_FMT*/
goto bailout;
}
goto bailout;
}
rv = CFGA_SDCARD_OK;
} else {
/* Unrecognized operation request */
}
}
/* cfgadm entry point */
/*ARGSUSED*/
const char *ap_id,
const char *options,
char **errstring,
{
/* Should call ioctl for self test - phase 2 */
return (CFGA_OPNOTSUPP);
}
struct chk_dev {
int c_isblk;
char *c_minor;
};
/*ARGSUSED*/
static int
{
char *mn;
return (DI_WALK_CONTINUE);
return (DI_WALK_CONTINUE);
return (DI_WALK_TERMINATE);
}
/*
* Don't use devfs if stat() in /devices fails. Use libdevinfo instead.
* Retired devices don't show up in devfs.
*
* Returns:
* 1 - minor exists and is of type BLK
* 0 - minor does not exist or is not of type BLK.
*/
static int
is_devinfo_blk(char *minor_path)
{
char *minor_portion;
int rv;
/*
* prune minor path for di_init() - no /devices prefix and no minor name
*/
return (0);
if (minor_portion == NULL)
return (0);
*minor_portion = 0;
if (node == DI_NODE_NIL)
return (0);
return (1);
else
return (0);
}
/*
* The dynamic component buffer returned by this function has to be freed!
*/
{
int l_errno;
char devpath[MAXPATHLEN];
char minor_path[MAXPATHLEN];
char name_part[MAXNAMELEN];
char *minor_portion = NULL;
int deplen;
int err;
char *p;
/*
* Get target node path
*/
(void) printf("cfga_list_ext: cannot locate target device\n");
return (CFGA_SDCARD_DYNAMIC_AP);
} else {
/*
* If the child node is the sdcard node, then what we really
* want is the grandchild. But we know that the grandchild
* will always be disk@0,0.
*/
/* sdcard nodes have disk children, if any */
}
*cp = 0; /* terminate path for opendir() */
/*
* Using libdevinfo for this is overkill and kills
* performance when many consumers are using libcfgadm
* concurrently.
*/
goto bailout;
}
/*
* deplen is large enough to fit the largest path-
* struct dirent includes one byte (the terminator)
* so we don't add 1 to the calculation here.
*/
sizeof (struct dirent);
goto bailout;
continue;
*minor_portion = 0;
continue;
/*
* If stat() fails, the device *may* be retired.
* Check via libdevinfo if the device has a BLK minor.
* We don't use libdevinfo all the time, since taking
* a snapshot is slower than a stat().
*/
if (is_devinfo_blk(minor_path)) {
break;
} else {
continue;
}
}
break;
}
/*
* If there was an error, or we didn't exit the loop
* by finding a block or character device, bail out.
*/
goto bailout;
/*
* since we ONLY looked for BLOCK devices above.
*/
(void) physpath_to_devlink("/dev/dsk",
/* postprocess and copy logical name here */
/*
*/
/* cXtYdZ[(s[0..15])|(p[0..X])] */
p++; /* Skip the 'd' */
while (*p != 0 && isdigit(*p))
p++;
*p = 0;
}
}
}
return (CFGA_SDCARD_OK);
}
if (dp)
if (dep)
return (CFGA_SDCARD_DYNAMIC_AP);
}
void
sdcard_clean_string(char *s, int sz)
{
int len;
char *p;
/* ensure null termination */
p = s;
/* strip leading white space */
while (*p == ' ') p++;
/* trim trailing space */
s[len] = '\0';
len--;
}
char c = s[len];
if (((c >= 'a') && (c <= 'z')) ||
((c >= 'A') && (c <= 'Z')) ||
((c >= '0') && (c <= '9')) ||
(c == '_') || (c == '+') || (c == '-'))
continue;
s[len] = '_';
}
}
/* cfgadm entry point */
/*ARGSUSED*/
const char *ap_id,
int *nlistp,
const char *options,
const char *listopts,
char **errstring,
{
int l_errno;
char *pdyn;
goto bailout;
}
/* We do not care here about dynamic AP name component */
*pdyn = '\0';
}
goto bailout;
}
/* Get ap status */
goto bailout;
}
/* will call dc_cmd to send IOCTL to kernel */
goto bailout;
}
/*
* Create cfga_list_data_t struct.
*/
if ((*ap_id_list =
goto bailout;
}
*nlistp = 1;
/*
* Rest of the code fills in the cfga_list_data_t struct.
*/
/* Remember ap_id_log must be freed */
if (rv != 0) {
goto bailout;
}
/* Get logical ap_id corresponding to the physical */
goto bailout;
}
sizeof ((*ap_id_list)->ap_log_id));
sizeof ((*ap_id_list)->ap_phys_id));
switch (devctl_ap_state.ap_rstate) {
case AP_RSTATE_EMPTY:
break;
case AP_RSTATE_DISCONNECTED:
break;
case AP_RSTATE_CONNECTED:
break;
default:
goto bailout;
}
switch (devctl_ap_state.ap_ostate) {
case AP_OSTATE_CONFIGURED:
break;
case AP_OSTATE_UNCONFIGURED:
break;
default:
goto bailout;
}
switch (devctl_ap_state.ap_condition) {
case AP_COND_OK:
break;
case AP_COND_FAILING:
break;
case AP_COND_FAILED:
break;
case AP_COND_UNUSABLE:
break;
case AP_COND_UNKNOWN:
break;
default:
goto bailout;
}
char *ct;
/*
* Fill in the 'Information' field for the -v option
*/
if (rv != CFGA_SDCARD_OK) {
goto bailout;
}
case SDA_CT_MMC:
case SDA_CT_SDMEM:
case SDA_CT_SDHC:
case SDA_CT_SDCOMBO:
/* these are all memory cards */
/*
* We don't display the mfg id, because we
* have no reliable way to look it up.
*/
sizeof ((*ap_id_list)->ap_info),
"Mod: %s Rev: %d.%d Date: %d/%d SN: %X",
break;
default:
/*
* we don't know what this is really... need to
* parse CIS later.
*/
sizeof ((*ap_id_list)->ap_info));
break;
}
case SDA_CT_UNKNOWN:
ct = "unknown";
break;
case SDA_CT_MMC:
ct = "mmc";
break;
case SDA_CT_SDMEM:
ct = "sdcard";
break;
case SDA_CT_SDHC:
ct = "sdhc";
break;
case SDA_CT_SDCOMBO:
ct = "sd-combo";
break;
case SDA_CT_SDIO:
ct = "sdio";
break;
}
sizeof ((*ap_id_list)->ap_type));
/*
* This is the case where we need to generate
* a dynamic component of the ap_id, i.e. device.
*/
DYN_SEP);
sizeof ((*ap_id_list)->ap_log_id));
}
}
} else {
sizeof ((*ap_id_list)->ap_type));
}
if (*ap_id_list != NULL) {
free(*ap_id_list);
}
}
}
/*
* This routine accepts a string and prints it using
* the message print routine argument.
*/
static void
{
int len;
char *q;
(void) printf("cfga_msg: NULL msgp\n");
return;
}
(void) printf("cfga_msg: null str\n");
return;
}
perror("cfga_msg");
return;
}
free(q);
}
/* cfgadm entry point */
/*ARGSUSED*/
{
}
return (CFGA_OK);
}
/*
* Ensure the ap_id passed is in the correct (physical ap_id) form:
* where xx is a one or two-digit number.
*
* Note the library always calls the plugin with a physical ap_id.
*/
static int
verify_valid_apid(const char *ap_id)
{
char *l_ap_id;
return (-1);
l_ap_id++;
/* Bad characters in the ap_id */
return (-1);
}
return (0);
}
/*
* Verify the params passed in are valid.
*/
static cfga_sdcard_ret_t
{
int rv;
}
return (CFGA_SDCARD_OPTIONS);
}
/* Strip dynamic AP name component if it is present. */
return (CFGA_SDCARD_ALLOC_FAIL);
}
*pdyn = '\0';
}
if (verify_valid_apid(lap_id) != 0) {
rv = CFGA_SDCARD_AP;
} else {
rv = CFGA_SDCARD_OK;
}
return (rv);
}
/*
*/
static void
{
if (devctl_hdl != NULL) {
}
}
static cfga_sdcard_ret_t
{
return (CFGA_SDCARD_ALLOC_FAIL);
*pdyn = '\0';
}
/* Get a devctl handle to pass to the devctl_ap_XXX functions */
"setup_for_devctl_cmd: devctl_ap_acquire failed: %s\n",
return (CFGA_SDCARD_DEVCTL);
}
return (CFGA_SDCARD_OK);
}
static cfga_sdcard_ret_t
{
return (CFGA_SDCARD_IOCTL);
}
return (CFGA_SDCARD_OK);
}
/*
* Given a subcommand to the DEVCTL_AP_CONTROL ioctl, rquest the size of
* the data to be returned, allocate a buffer, then get the data.
*/
{
int fd = -1;
struct sda_ap_control apc;
goto bailout;
}
/* Execute IOCTL */
goto bailout;
}
return (rv);
if (fd != -1) {
}
}
return (rv);
}
static int
{
int rval;
return (0);
}
return (rval);
}
{
devpath, MAXPATHLEN));
}
sdcard_reset_slot(const char *ap_id)
{
}
/*
* sdcard_rcm_offline:
* Offline resource consumers.
*/
{
int rret;
return (ret);
}
/* Translate the cfgadm flags to RCM flags */
if (rret != RCM_SUCCESS) {
if (rinfo) {
}
if (rret == RCM_FAILURE) {
}
}
return (ret);
}
/*
* sdcard_rcm_online:
* Online resource consumers that were previously offlined.
*/
void
{
if (sdcard_rcm_init() != CFGA_SDCARD_OK) {
return;
}
}
}
/*
* sdcard_rcm_remove:
* Remove resource consumers after their kernel removal.
*/
void
{
if (sdcard_rcm_init() != CFGA_SDCARD_OK) {
return;
}
}
}
/*
* sdcard_rcm_init:
* Contains common initialization code for entering a sdcard_rcm_xx() routine.
*/
static cfga_sdcard_ret_t
sdcard_rcm_init(void)
{
/* Get a handle for the RCM operations */
(void) mutex_lock(&rcm_handle_lock);
if (rcm_handle == NULL) {
RCM_SUCCESS) {
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_SDCARD_RCM_HANDLE);
}
}
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_SDCARD_OK);
}
/*
* sdcard_rcm_info_table:
* Takes an opaque rcm_info_t pointer and a character pointer,
* and appends the rcm_info_t data in the form of a table to the
* given character pointer.
*/
static void
{
int i;
size_t w;
size_t table_size = 0;
char *rsrc;
char *info;
char *newtable;
static char format[MAX_FORMAT];
const char *infostr;
/* Protect against invalid arguments */
return;
}
/* Set localized table header strings */
/* A first pass, to size up the RCM information */
tuples++;
w_rsrc = w;
w_info = w;
}
}
/* If nothing was sized up above, stop early */
if (tuples == 0) {
return;
}
/* Adjust column widths for column headings */
w_rsrc = w;
} else if ((w_rsrc - w) % 2) {
w_rsrc++;
}
w_info = w;
} else if ((w_info - w) % 2) {
w_info++;
}
/*
* Compute the total line width of each line,
* accounting for intercolumn spacing.
*/
/* Allocate space for the table */
/* zero fill for the strcat() call below */
return;
}
} else {
return;
} else {
}
}
/* Place a table header into the string */
/* The resource header */
for (i = 0; i < ((w_rsrc - w) / 2); i++) {
}
for (i = 0; i < ((w_rsrc - w) / 2); i++) {
}
/* The information header */
for (i = 0; i < ((w_info - w) / 2); i++) {
}
for (i = 0; i < ((w_info - w) / 2); i++) {
}
/* Underline the headers */
for (i = 0; i < w_rsrc; i++) {
}
for (i = 0; i < w_info; i++) {
}
/* Construct the format string */
/* Add the tuples to the table string */
}
}
}