putparam.c revision 5c51f1241dbbdf2656d0e10011981411ed0c9673
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#include <assert.h>
#include <pkgdev.h>
#include <pkginfo.h>
#include <pkglocs.h>
#include <locale.h>
#include <libintl.h>
#include <instzones_api.h>
#include <pkglib.h>
#include <install.h>
#include <libinst.h>
#include <libadm.h>
#include <messages.h>
static char *localeNames[] = {
"LC_CTYPE",
"LC_NUMERIC",
"LC_TIME",
"LC_COLLATE",
"LC_MESSAGES",
"LC_MONETARY",
"LC_ALL",
"LANG",
"TZ",
};
#define NUM_LOCALE_TYPES 100
static char *envPtr[NUM_LOCALE_TYPES];
/*
* extern declarations
*/
extern char **environ;
/*
* this is the initial and incremental allocation used to
* populate the environment "environ"
*/
#define MALSIZ 64
void
{
char *pt;
int ptlen;
int i, n;
/*
* If the environment is NULL, allocate space for the
* character pointers.
*/
quit(99);
}
}
/*
* If this parameter is already in place and it has a different
* value, clear the old value by freeing the memory previously
* allocated. Otherwise, we leave well-enough alone.
*/
for (i = 0; environ[i]; i++) {
(environ[i][n] == '=')) {
return;
else {
break;
}
}
}
/* Allocate space for the new environment entry. */
quit(99);
}
/*
* Put the statement into the allocated space and point the
* environment entry at it.
*/
if (environ[i]) {
return;
}
/*
* With this parameter in place, if we're at the end of the
* allocated environment then allocate more space.
*/
if ((i % MALSIZ) == 0) {
(i+MALSIZ)*sizeof (char *));
quit(1);
}
}
/* Terminate the environment properly. */
}
/* bugid 4279039 */
void
getuserlocale(void)
{
int i;
if (envPtr[i]) {
}
}
}
/* bugid 4279039 */
void
putuserlocale(void)
{
int i;
if (envPtr[i]) {
}
}
}
/*
* Name: putConditionInfo
* Description: put parent "condition" information to environment
* Arguments: a_parentZoneName - name of the parent zone
* == NULL - no name
* a_parentZoneType - parent zone "type"
* == NULL - no type
* Returns: void
*/
void
{
char **pp;
char *p;
char *pa;
/* entry debugging info */
/*
* create tag to hold condition information:
* <environmentConditionInformation>
* <parentZone zoneName=<?> zoneType=<?>/>
* <currentZone zoneName=<?> zoneType=<?>/>
* <inheritedFileSystem fileSystemName=<?>/>
* </environmentConditionInformation>
*/
/*
* information about pkgadd or pkgrm environment
* <parentZone zoneName=<?> zoneType=<?>/>
*/
/* allocate tag for parent info */
/* parent zone name */
/* parent zone info */
/* add to top level tag */
/*
* information about pkginstall or pkgremove environment
* <currentZone zoneName=<?> zoneType=<?>/>
*/
/* allocate tag for parent info */
/* current zone name */
p = z_get_zonename();
if ((p != NULL) && (*p != '\0')) {
free(p);
}
/* current zone type */
z_running_in_global_zone() == B_TRUE ?
/* add to top level tag */
/*
* describe any inherited file systems:
* <inheritedFileSystem fileSystemName=<?>/>
*/
int n;
/* allocate tag for inherited file system info */
/* inherited file system */
/* add to top level tag */
}
}
/*
* done filling in tag - convert to string and place in environment
*/
p = smlConvertTagToString(tag);
/* convert all new-line characters to space */
if (*pa == '\n') {
*pa = ' ';
}
}
}