## Tcl8.6.2/Tk8.6.2 Documentation > [incr Tcl] Package C API, version 4.0.1 > Stack

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

### NAME

Itcl_InitStack, Itcl_DeleteStack, Itcl_PushStack, Itcl_PopStack, Itcl_PeekStack, Itcl_GetStackValue, Itcl_GetStackSize — Manipulate an Itcl stack object.

### SYNOPSIS

#include <itcl.h>
int
Itcl_InitStack(stack)
int
Itcl_DeleteStack(stack)
int
Itcl_PushStack(cdata, stack)
ClientData
Itcl_PopStack(stack)
ClientData
Itcl_PeekStack(stack)
ClientData
Itcl_GetStackValue(stack, pos)
int
Itcl_GetStackSize(stack)

### ARGUMENTS

Itcl_Stack *stack (in)
  Stack info structure.

int pos (in)
  position in stack order from the top.

ClientData clientData (in)
  Arbitrary one-word value to save in the stack.

### DESCRIPTION

Itcl_InitStack initializes a stack structure and Itcl_DeleteStack deletes it. Itcl_PushStack pushes the cdata value onto the stack. Itcl_PopStack removes and returns the top most cdata value. Itcl_PeekStack returns the top most value, but does not remove it. Itcl_GetStackValue gets a value at some index within the stack. Index "0" is the first value pushed onto the stack. Itcl_GetStackSize returns the count of entries on the stack.

### KEYWORDS

stack
Copyright © 1993-1998 Lucent Technologies, Inc.