Package ghidra.app.cmd.function

# Class ApplyFunctionSignatureCmd

java.lang.Object
ghidra.framework.cmd.BackgroundCommand<Program>
ghidra.app.cmd.function.ApplyFunctionSignatureCmd

All Implemented Interfaces:
  `Command<Program>`

public class ApplyFunctionSignatureCmd extends BackgroundCommand<Program>
Command to create apply a function signature at an address. `Function` signature changes are applied using `Function.updateFunction(String, Variable, List, FunctionUpdateType, boolean, SourceType)` with an update type of `Function.FunctionUpdateType.DYNAMIC_STORAGE_FORMAL_PARAMS`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source)`
  Constructs a new command for applying a signature to an existing function.
  `ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, boolean forceSetName)`
  Deprecated, for removal: This API element is subject to removal in a future version.
  `ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, boolean applyEmptyComposites, DataTypeConflictHandler conflictHandler, FunctionRenameOption functionRenameOption)`
  Constructs a new command for applying a signature to an existing function.
  `ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, FunctionRenameOption functionRenameOption)`
  Deprecated, for removal: This API element is subject to removal in a future version.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `applyTo(Program p, TaskMonitor monitor)`
  Method called when this command is to apply changes to the given domain object.

  ### Methods inherited from class ghidra.framework.cmd.BackgroundCommand

  `applyTo, canCancel, dispose, getName, getStatusMsg, hasProgress, isModal, run, setStatusMsg, taskCompleted, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ApplyFunctionSignatureCmd

    public ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source)
    Constructs a new command for applying a signature to an existing function.
    Only a function with a default name will be renamed to the function signature's name (see `FunctionRenameOption.RENAME_IF_DEFAULT`).
    All datatypes will be resolved using the `default conflict handler`.
    Parameters:
      `entry` - entry point address for the function to be created.
      `signature` - function signature to apply
      `source` - the source of this function signature

  - ### ApplyFunctionSignatureCmd

    @Deprecated(since="10.3", forRemoval=true) public ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, boolean forceSetName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new command for applying a signature to an existing function.
    All datatypes will be resolved using the `default conflict handler`.
    Parameters:
      `entry` - entry point address for the function to be created.
      `signature` - function signature to apply
      `source` - the source of this function signature
      `preserveCallingConvention` - if true the function calling convention will not be changed
      `forceSetName` - true if name of the function should be set to the name, otherwise name will only be set name if currently default (e.g., FUN_1234). A value of true is equivalent to `FunctionRenameOption.RENAME`, while a value of false is equivalent to `FunctionRenameOption.RENAME_IF_DEFAULT`.

  - ### ApplyFunctionSignatureCmd

    @Deprecated(since="11.0", forRemoval=true) public ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, FunctionRenameOption functionRenameOption)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a new command for applying a signature to an existing function.
    All datatypes will be resolved using the `default conflict handler`.
    Parameters:
      `entry` - entry point address for the function to be created.
      `signature` - function signature to apply
      `source` - the source of this function signature
      `preserveCallingConvention` - if true the function calling convention will not be changed
      `functionRenameOption` - controls renaming of the function using the name from the specified function signature.

  - ### ApplyFunctionSignatureCmd

    public ApplyFunctionSignatureCmd(Address entry, FunctionSignature signature, SourceType source, boolean preserveCallingConvention, boolean applyEmptyComposites, DataTypeConflictHandler conflictHandler, FunctionRenameOption functionRenameOption)
    Constructs a new command for applying a signature to an existing function.
    Parameters:
      `entry` - entry point address for the function to be created.
      `signature` - function signature to apply
      `source` - the source of this function signature
      `preserveCallingConvention` - if true the function calling convention will not be changed
      `applyEmptyComposites` - If true, applied composites will be resolved without their respective components if the type does not already exist in the destination datatype manager. If false, normal type resolution will occur.
      `conflictHandler` - conflict handler to be used when applying datatypes to the destination program. If this value is not null or `DataTypeConflictHandler.DEFAULT_HANDLER` the datatypes will be resolved prior to updating the destinationFunction. This handler will provide some control over how applied datatype are handled when they conflict with existing datatypes. See `DataTypeConflictHandler` which provides some predefined handlers.
      `functionRenameOption` - controls renaming of the function using the name from the specified function signature.

- ## Method Details

  - ### applyTo

    public boolean applyTo(Program p, TaskMonitor monitor)
    Description copied from class: `BackgroundCommand`
    Method called when this command is to apply changes to the given domain object. A monitor is provided to display status information about the command as it executes in the background.
    Specified by:
      `applyTo` in class `BackgroundCommand<Program>`
    Parameters:
      `p` - domain object that will be affected by the command
      `monitor` - monitor to show progress of the command
    Returns:
      true if the command applied successfully