Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stack(3) [centos man page]

Stack(3)							   OCaml library							  Stack(3)

NAME
Stack - Last-in first-out stacks. Module Module Stack Documentation Module Stack : sig end Last-in first-out stacks. This module implements stacks (LIFOs), with in-place modification. type 'a t The type of stacks containing elements of type 'a . exception Empty Raised when Stack.pop or Stack.top is applied to an empty stack. val create : unit -> 'a t Return a new stack, initially empty. val push : 'a -> 'a t -> unit push x s adds the element x at the top of stack s . val pop : 'a t -> 'a pop s removes and returns the topmost element in stack s , or raises Empty if the stack is empty. val top : 'a t -> 'a top s returns the topmost element in stack s , or raises Empty if the stack is empty. val clear : 'a t -> unit Discard all elements from a stack. val copy : 'a t -> 'a t Return a copy of the given stack. val is_empty : 'a t -> bool Return true if the given stack is empty, false otherwise. val length : 'a t -> int Return the number of elements in a stack. val iter : ('a -> unit) -> 'a t -> unit iter f s applies f in turn to all elements of s , from the element at the top of the stack to the element at the bottom of the stack. The stack itself is unchanged. OCamldoc 2014-06-09 Stack(3)

Check Out this Related Man Page

stack(n)							Tcl Data Structures							  stack(n)

NAME
stack - Create and manipulate stack objects SYNOPSIS
package require Tcl 8.2 package require struct ?1.2.1? stackName option ?arg arg ...? stackName clear stackName destroy stackName peek ?count? stackName pop ?count? stackName push item ?item ...? stackName size DESCRIPTION
The ::struct::stack command creates a new stack object with an associated global Tcl command whose name is stackName. This command may be used to invoke various operations on the stack. It has the following general form: stackName option ?arg arg ...? Option and the args determine the exact behavior of the command. The following commands are possible for stack objects: stackName clear Remove all items from the stack. stackName destroy Destroy the stack, including its storage space and associated command. stackName peek ?count? Return the top count items of the stack, without removing them from the stack. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no items on the stack, this command will return count empty strings. stackName pop ?count? Return the top count items of the stack, and remove them from the stack. If count is not specified, it defaults to 1. If count is 1, the result is a simple string; otherwise, it is a list. If specified, count must be greater than or equal to 1. If there are no items on the stack, this command will return count empty strings. stackName push item ?item ...? Push the item or items specified onto the stack. If more than one item is given, they will be pushed in the order they are listed. stackName size Return the number of items on the stack. KEYWORDS
queue, matrix, tree, graph struct 1.2.1 stack(n)
Man Page

14 More Discussions You Might Find Interesting

1. Programming

How to increase the size of the stack

Hi!!, could someone tell me how to increase the stack size in HP-UX? Thanx (7 Replies)
Discussion started by: jyotipg
7 Replies

2. UNIX for Advanced & Expert Users

help required - stack trace

Hi all, One of our programs written in Java, produced this logfile. This job runs 48 threads and only one thread failed with this error. The code is a blackbox(external product), so cant look at the source code. From what I can infer from the log, the job was trying to write the log messages into... (9 Replies)
Discussion started by: ranj@chn
9 Replies

3. Programming

finding stack location in C using program

Is there a way to find the address of stack memory writing a program? Please guide me (12 Replies)
Discussion started by: jacques83
12 Replies

4. UNIX for Advanced & Expert Users

User defined stacks for threads using glibc-2.3.5

Hi, I am currently working with threads using linux 2.6.11 and glibc 2.3.5 on x86. When i am trying to create thread with user defined stacks glibc gives segmentation fault. I have written a wrapper to pthread_create () and generated shared object for the same. When i am trying to create any... (6 Replies)
Discussion started by: mysterious
6 Replies

5. Programming

Regarding stack analysis

I would like to know how I could do the following : void func(){ int a = 100; b=0; int c = a/b; } void sig_handler (int sig,siginfo_t *info,void *context){ //signal handling function //here I want to access the variables of func() } int main(){ struct sigaction *act =... (7 Replies)
Discussion started by: vpraveen84
7 Replies

6. Programming

Threads and stack size

Can someone explain me, why when I create new threads with stack bigger than default (using pthread_attr_setstacksize()) i can create more? Each thread has it's own stack, so how bigger stack can cause possibility to create more threads? (7 Replies)
Discussion started by: dawwin
7 Replies

7. Ubuntu

pstack missing from Ubuntu 10.10

Hi All I would like to use the tool "pstack" to get a sample of the stack trace for a process. As far as I understood It seems widely available in all Linux systems, but it is not in Ubuntu 10.10. I tried using apt-get as per some posts in few forum, but it cannot be found in the APT... (9 Replies)
Discussion started by: manustone
9 Replies

8. UNIX for Dummies Questions & Answers

Stack Memory

I have a java process that piles up the stack memory. ulimit -a core file size (blocks, -c) unlimited data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 10 stack size ... (9 Replies)
Discussion started by: mohtashims
9 Replies

9. UNIX for Advanced & Expert Users

How to identify maximum stack size?

Hi All, I have set max stack size as 4KB for my thread, but it always using very less. So I like to know what is the maximum stack size is used by my thread. I tried with gcc -fstack-usage command line option, but its not supported by mips. Kindly suggest me the way to find the max stack... (6 Replies)
Discussion started by: rajamohan
6 Replies

10. Shell Programming and Scripting

Stacking Columns

How do I stack several columns of data into their own rows? In: A,B,C,d,e,f,g,H,I 1,2,3,4,5,6,7,8,9 Out: A,B,C,X,Y,H,I 1,2,3,d,4,8,9 1,2,3,e,5,8,9 1,2,3,f,6,8,9 1,2,3,g,7,8,9 Mike (10 Replies)
Discussion started by: Michael Stora
10 Replies

11. Linux

Server hung, is this a stack trace?

Hi everyone, Our Red Hat server hung yesterday, and I managed to log into the console and see the following message: RIP: 0010: mwait_idle_with_hints+0x66/ 0x67 RSP: 0018:ffffffff80457f40 EFLAGS: 00000046 RAX: 0000000000000010 RBX: ffff810c20075910 RCX: 0000000000000001 RDX:... (6 Replies)
Discussion started by: badoshi
6 Replies

12. Solaris

Configure dual stack on existing Solaris 10

I have a Solaris 10 server with the following interfaces: ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=209040843<UP,BROADCAST,RUNNING,MULTICAST,DEPRECATED,IPv4,NOFAILOVER,CoS> mtu 1500 index... (8 Replies)
Discussion started by: e_mikey_2000
8 Replies

13. What is on Your Mind?

Your Favorite Tech Support Web Sites and Why?

Where do you go to participate in technical discussions besides UNIX.COM and why? Personally, I do not really participate in other forums and discussion boards, but I do ask questions from time to time on Stack sites. The problem I have with Stack is that my questions are never answered on any... (30 Replies)
Discussion started by: Neo
30 Replies

14. UNIX for Beginners Questions & Answers

Saltstack commands inside bash scripts donā€™t work

In a Redhat Linux environment, I could run salt commands on the $ prompt but not inside my bash scripts. It will say command not found and the $PATH variable is exactly the same outside and inside the script. !#/usr/bin/bash echo “running”¯ salt "*" cmd.run ‘ls' exit Output:-... (8 Replies)
Discussion started by: gurudewa
8 Replies