_actions.c revision 2457
591N/A * The contents of this file are subject to the terms of the 591N/A * Common Development and Distribution License (the "License"). 591N/A * You may not use this file except in compliance with the License. 591N/A * See the License for the specific language governing permissions 591N/A * and limitations under the License. 591N/A * When distributing Covered Code, include this CDDL HEADER in each 591N/A * If applicable, add the following below this CDDL HEADER, with the 591N/A * fields enclosed by brackets "[]" replaced with your own identifying 591N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2233N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 591N/Astatic char *
notident =
"hash attribute not identical to positional hash";
591N/A /* Shouldn't ever get here */ 1973N/A * If malformed() or invalid() are used, CLEANUP_REFS can only be used 1973N/A * after. Likewise, PyMem_Free(str) should not be called before using 591N/A * malformed() or invalid(). Failure to order this properly will cause 1659N/A * corruption of the exception messages. 1890N/A * The action string is currently assumed to be a stream of bytes that 1890N/A * are valid UTF-8. This method works regardless of whether the string 591N/A * object provided is a Unicode object, string object, or a character 629N/A * Pool attribute key to reduce memory usage and 1973N/A * potentially improve lookup performance. 2233N/A * "slashmap" is a list of the positions of the 2233N/A * backslashes that need to be removed from the 2233N/A * Terminate slashmap with an invalid 2233N/A * value so we don't think there's a 2233N/A * slash right at the beginning. 591N/A * Keep slashmap properly terminated so 591N/A * that a realloc()ed array doesn't give 591N/A * us random slash positions. 2233N/A * Copy the attribute from str into 591N/A * sattr, removing backslashes as 591N/A * slashmap indicates we should. * We need to retrieve the MalformedActionError object from pkg.actions. * We can't import pkg.actions directly, because that would result in a * circular dependency. But the "sys" module has a dict called * "modules" which maps loaded module names to the corresponding module * objects. We can then grab the exception from those objects. /* No exception is set */