Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

attribute.c File Reference


Detailed Description

Manipulate ClassFile attributes.

Control

$URL: https://svn.apache.org/path/name/attribute.c $ $Id: attribute.c 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file attribute.c.

#include "arch.h"
#include "jvmcfg.h"
#include "cfmacros.h"
#include "classfile.h"
#include "jvm.h"
#include "linkage.h"
#include "utf.h"

Go to the source code of this file.

Functions

static void attribute_c_dummy (void)
static jvm_attribute_index attribute_enum_common_find (ClassFile *pcfs, u2 acount, attribute_info_dup **patr, classfile_attribute_enum atrenum)
 Locate an attribute by enumeration for a field, method, or class.
jvm_attribute_index attribute_find_in_class_by_cp_entry (jvm_class_index clsidx, cp_info_dup *atrname)
 Locate by constant_pool entry the attribute_info index for an attribute in a class attribute area.
jvm_attribute_index attribute_find_in_class_by_enum (jvm_class_index clsidx, classfile_attribute_enum atrenum)
 Locate by enumeration the attribute_info index for an attribute in a class attribute area.
jvm_attribute_index attribute_find_in_field_by_cp_entry (jvm_class_index clsidx, jvm_field_index fldidx, cp_info_dup *atrname)
 Locate by constant_pool entry the attribute_info index for an attribute in a field attribute area.
jvm_attribute_index attribute_find_in_field_by_enum (jvm_class_index clsidx, jvm_field_index fldidx, classfile_attribute_enum atrenum)
 Locate by enumeration the attribute_info index for an attribute in a field attribute area.
jvm_attribute_index attribute_find_in_method_by_cp_entry (jvm_class_index clsidx, jvm_method_index mthidx, cp_info_dup *atrname)
 Locate by constant_pool entry the attribute_info index for an attribute in a method attribute area.
jvm_attribute_index attribute_find_in_method_by_enum (jvm_class_index clsidx, jvm_method_index mthidx, classfile_attribute_enum atrenum)
 Locate by enumeration the attribute_info index for an attribute in a method attribute area.
static jvm_attribute_index attribute_name_common_find (ClassFile *pcfs, u2 acount, attribute_info_dup **patr, cp_info_dup *atrname)
 Locate an attribute by constant_pool entry for a field, method, or class. The attribute pointer passed in is valid for all three types.

Variables

static char * attribute_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/attribute.c $ $Id: attribute.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Function Documentation

static void attribute_c_dummy void   )  [static]
 

Definition at line 40 of file attribute.c.

static jvm_attribute_index attribute_name_common_find ClassFile pcfs,
u2  acount,
attribute_info_dup **  patr,
cp_info_dup atrname
[static]
 

Locate an attribute by constant_pool entry for a field, method, or class. The attribute pointer passed in is valid for all three types.

Parameters:
pcfs Pointer to ClassFile area
acount Attribute count from field, method, or class.
patr Attribute array for a field, method, or class.
atrname UTF8 constant_pool entry of name of attribute in field, method, or class.
Returns:
Attribute table index ofthie attribute or jvm_attribute_index_bad if not found.

Definition at line 72 of file attribute.c.

References jvm_attribute_index_bad, PTR_THIS_CP_Utf8, and utf_pcfs_strcmp().

Referenced by attribute_find_in_class_by_cp_entry(), attribute_find_in_field_by_cp_entry(), and attribute_find_in_method_by_cp_entry().

static jvm_attribute_index attribute_enum_common_find ClassFile pcfs,
u2  acount,
attribute_info_dup **  patr,
classfile_attribute_enum  atrenum
[static]
 

Locate an attribute by enumeration for a field, method, or class.

The attribute pointer passed in is valid for all three types.

Parameters:
pcfs Pointer to ClassFile area
acount Attribute count from field, method, or class.
patr Attribute array for a field, method, or class.
atrenum Attribute enumeration (from classfile.h) for attribute of field, method, or class to locate (e.g. LOCAL_CODE_ATTRIBUTE).
Returns:
Attribute table index ofthie attribute or jvm_attribute_index_bad if not found.

Definition at line 121 of file attribute.c.

References cfattrib_atr2enum(), and jvm_attribute_index_bad.

Referenced by attribute_find_in_class_by_enum(), attribute_find_in_field_by_enum(), and attribute_find_in_method_by_enum().

jvm_attribute_index attribute_find_in_field_by_cp_entry jvm_class_index  clsidx,
jvm_field_index  fldidx,
cp_info_dup atrname
 

Locate by constant_pool entry the attribute_info index for an attribute in a field attribute area.

Parameters:
clsidx Class index of class whose field is to be searched for an attribute.
fldidx Field index of field to search.
atrname UTF8 constant_pool entry of name of attribute name to locate.
Returns:
attribute table index of this attribute in field, or jvm_attribute_index_bad if not found.

Definition at line 166 of file attribute.c.

References attribute_name_common_find(), field_info::attributes, field_info::attributes_count, CLASS_OBJECT_LINKAGE, ClassFile::fields, ClassFile::fields_count, jvm_attribute_index_bad, and jvm_class_index_null.

jvm_attribute_index attribute_find_in_field_by_enum jvm_class_index  clsidx,
jvm_field_index  fldidx,
classfile_attribute_enum  atrenum
 

Locate by enumeration the attribute_info index for an attribute in a field attribute area.

Parameters:
clsidx Class index of class whose field is to be searched for an attribute.
fldidx Field index of field to search.
atrenum LOCAL_xxxx_ATTRIBUTE enumeration of attribute to locate.
Returns:
attribute table index of this attribute in field, or jvm_attribute_index_bad if not found.

Definition at line 214 of file attribute.c.

References attribute_enum_common_find(), field_info::attributes, field_info::attributes_count, CLASS_OBJECT_LINKAGE, ClassFile::fields, ClassFile::fields_count, jvm_attribute_index_bad, and jvm_class_index_null.

jvm_attribute_index attribute_find_in_method_by_cp_entry jvm_class_index  clsidx,
jvm_method_index  mthidx,
cp_info_dup atrname
 

Locate by constant_pool entry the attribute_info index for an attribute in a method attribute area.

Parameters:
clsidx Class index of class whose method is to be searched for an attribute.
mthidx Method index of method to search.
atrname UTF8 constant_pool entry of name of attribute name to locate.
Returns:
attribute table index of this attribute in method, or jvm_attribute_index_bad if not found.

Definition at line 260 of file attribute.c.

References attribute_name_common_find(), method_info::attributes, method_info::attributes_count, CLASS_OBJECT_LINKAGE, jvm_attribute_index_bad, jvm_class_index_null, ClassFile::methods, and ClassFile::methods_count.

jvm_attribute_index attribute_find_in_method_by_enum jvm_class_index  clsidx,
jvm_method_index  mthidx,
classfile_attribute_enum  atrenum
 

Locate by enumeration the attribute_info index for an attribute in a method attribute area.

Parameters:
clsidx Class index of class whose method is to be searched for an attribute.
mthidx Method index of method to search.
atrenum LOCAL_xxxx_ATTRIBUTE enumeration of attribute to locate.
Returns:
attribute table index of this attribute in method, or jvm_attribute_index_bad if not found.

Definition at line 308 of file attribute.c.

References attribute_enum_common_find(), method_info::attributes, method_info::attributes_count, CLASS_OBJECT_LINKAGE, jvm_attribute_index_bad, jvm_class_index_null, ClassFile::methods, and ClassFile::methods_count.

Referenced by linkage_resolve_class().

jvm_attribute_index attribute_find_in_class_by_cp_entry jvm_class_index  clsidx,
cp_info_dup atrname
 

Locate by constant_pool entry the attribute_info index for an attribute in a class attribute area.

Parameters:
clsidx Class index of class be searched for an attribute.
atrname UTF8 constant_pool entry of name of attribute name to locate.
Returns:
attribute table index of this attribute in class, or jvm_attribute_index_bad if not found.

Definition at line 352 of file attribute.c.

References attribute_name_common_find(), ClassFile::attributes, ClassFile::attributes_count, CLASS_OBJECT_LINKAGE, jvm_attribute_index_bad, and jvm_class_index_null.

jvm_attribute_index attribute_find_in_class_by_enum jvm_class_index  clsidx,
classfile_attribute_enum  atrenum
 

Locate by enumeration the attribute_info index for an attribute in a class attribute area.

Parameters:
clsidx Class index of class whose method is to be searched for an attribute.
atrenum LOCAL_xxxx_ATTRIBUTE enumeration of attribute to locate.
Returns:
attribute table index of this attribute in class, or jvm_attribute_index_bad if not found.

Definition at line 391 of file attribute.c.

References attribute_enum_common_find(), ClassFile::attributes, ClassFile::attributes_count, CLASS_OBJECT_LINKAGE, jvm_attribute_index_bad, and jvm_class_index_null.

Referenced by jvmutil_print_stack_common().


Variable Documentation

char* attribute_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/attribute.c $ $Id: attribute.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 40 of file attribute.c.


Generated on Fri Sep 30 18:59:51 2005 by  doxygen 1.4.4