2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License, Version 1.0 only 2N/A * (the "License"). You may not use this file except in compliance 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * This module implements the PICL Interface used by PICL clients 2N/A * to access services of the PICL daemon 2N/A * A single reader/writer lock (icl_lock) protects the access to the interface 2N/A * to the picl daemon, and the reference count, refcnt, variable. 2N/A * A reader lock is obtained to send a request to the daemon. 2N/A * A writer lock is obtained to initialize, reinitialize, or shutdown 2N/A "General system failure",
2N/A "Daemon not responding",
2N/A "Unknown PICL service",
2N/A "Session not initialized",
2N/A "Invalid arguments",
2N/A "Property not found",
2N/A "Not a table property handle",
2N/A "Not a node handle",
2N/A "Not a property handle",
2N/A "End of property list",
2N/A "Property already exists",
2N/A "Property not writable",
2N/A "Insufficient permissions",
2N/A "Unsupported version",
2N/A "Attempting to destroy before delete",
2N/A "PICL Tree is busy",
2N/A "Already has a parent",
2N/A "Property name is reserved",
2N/A "Invalid reference value",
2N/A "Continue tree walk",
2N/A "Terminate tree walk",
2N/A "Not enough space available",
2N/A "Property not readable",
2N/A "Property value unavailable" 2N/A * This function sends the client request to the daemon using a door call. 2N/A * If door_handle is -1, it returns PICL_NOTINITIALIZED. 2N/A * If the door_call fails, it returns PICL_NORESPONSE. Otherwise, it 2N/A * checks the response from the daemon for error. If an error is returned 2N/A * this function returns the error code returned and unmaps any 2N/A * memory mapped by the door call. For successful results, the caller is 2N/A * responsible to unmap the mapped memory after retrieving the results. 2N/A * This function does not attempt to reinitialize the interface if the 2N/A * initial door_call fails. It is called from handshake() , shutdown() 2N/A * and trysend_req() routines. 2N/A * This function posts an INIT message to the daemon to 2N/A * verify communication channel. 2N/A * This function calls post_req() to make door_call and reinitializes 2N/A * the interface is post_req() fails. 2N/A * Upgrade read to a write lock 2N/A * if picl_shutdown happens during lock upgrade 2N/A * Initialize the PICL interface 2N/A * Increment the reference count. 2N/A if (
refcnt > 0) {
/* previously initialized */ 2N/A * Open picld door and initialize door_handle 2N/A * Shutdown the PICL interface 2N/A * Decrement the reference count and close the door_handle if refcnt is zero 2N/A * This function waits for the specified number of seconds for a PICL 2N/A * This function copies the handle of the root node of the PICL tree into 2N/A * the buffer <rooth> 2N/A * This function copies the value of the property specified by its handle 2N/A * into the buffer <valbuf>. 2N/A * This function copies the value of the property specified by its 2N/A * name into the buffer <valbuf> 2N/A * This function sets the value of the property specified by its 2N/A * handle with the value specified in <valbuf>. 2N/A * This function sets the value of the property specified by its 2N/A * name with the value given in <valbuf> 2N/A * This function copies the information of the specified property 2N/A * This function copies the handle of the first property of a node into 2N/A * This function copies the handle of the next property in list 2N/A * This function copies the handle of the property specified by its 2N/A * name into <proph>. 2N/A * This function copies the handle of the next property on the same 2N/A * row of the table into <rowproph>. 2N/A * When proph is the table handle, the handle of the property that is 2N/A * in first row and first column is copied. 2N/A * This function copies the handle of the next property on the same 2N/A * column of the table into <colproph>. 2N/A * When proph is the table handle, the handle of the property that is 2N/A * in the first row and first column is copied. 2N/A * This function returns the picl error messages corresponding to the 2N/A * recursively visit all nodes 2N/A * This function walks the tree by class and invokes the callback 2N/A * function on class name matches. 2N/A * This function gets propinfo and prop handle of the named property