Sponsored Content
Top Forums Programming Merge two strings by overlapped region Post 302895990 by DGPickett on Thursday 3rd of April 2014 05:01:11 PM
Old 04-03-2014
Since VM can be mapped anywhere, they started by putting the environment, code, constants, initialized vaiables and unitialized variables in the bottom of memory, the heap, and the stack is started at top top of memory. growing toward each other. I think signal flags and open files are really in the kernel, and the fd is just an offset into a kernel per-process array of pointers to open files, so many processes can have the same open file on one or more fd numbers. The loader puts the arguments' pointers in an array with a terminating null pointer and starts up main(). If you wrote in C++, static objects' constructors would run before main(). Suppose you call strcmp(x,y). The code will push the adresses of x and y into the stack, and maybe allow a return value space, and call the strcpy code. Often values pushed are promoted to 4 byte integer even if short or char. If strcpy has automatic variables, they are located below the stack pointer setting after the call arguments. For calls within calls, each set of arguments and auto variables is called a stack frame. So, even though nobody else knows the address of a subroutine's static variables, the compiler/linker knows. The subroutine could pass a pointer to it, or load a global pointer with its address, to make it visible to others. Some even return it, which is not usual since it might not be MT-Safe! For instance, if you return a char* of a static char[50] with a null terminated string in it, unless it is const, someone might rewrite it, and if it is a product of the call input arguments, the next call will change the value, usually to something the first recipient of the pointer did not ask for. Some of the time libraries are like this, and have newer, safe variations.
This User Gave Thanks to DGPickett For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

stack region

how can i determine that what percentage of stack region is currently is used? (i am using tru64 unix) (2 Replies)
Discussion started by: yakari
2 Replies

2. UNIX for Dummies Questions & Answers

Merge two strings not from files

str1="this oracle data base record" str2="one two three four five" Output: this one oracle two data three base four record five str1 and str2 have the same column but they are not fixed columns. I can do it with "paste" but I do not want to create file everytime the script runs from... (2 Replies)
Discussion started by: buddyme
2 Replies

3. UNIX for Advanced & Expert Users

Best practice - determining what region you are on

Hello all, I have a question about what you think the best practice is to determine what region you are running on when you have a system setup with a DEV/TEST, QA, and PROD regions running the same scripts in all. So, when you run in DEV, you have a different directory structure, and you... (4 Replies)
Discussion started by: Rediranch
4 Replies

4. Shell Programming and Scripting

Region between lines

How can I find the regions between specific lines? I have a file which contains lines like this: chr1 0 17388 0 chr1 17388 17444 1 chr1 17444 17599 2 chr1 17599 17601 1 chr1 17601 569791 0 chr1 569791 569795 1 chr1 569795 569808 2 chr1 569808 569890 3 chr1 569890 570047 4 ... (9 Replies)
Discussion started by: linseyr
9 Replies

5. UNIX for Dummies Questions & Answers

overlapped genomic coordinates

Hi, I would like to know how can I get the ID of a feature if its genomic coordinates overlap the coordinates of another file. Example: Get the 4th column (ID) of this file1: chr1 10 100 gene1 chr2 3000 5000 gene2 chr3 200 1500 gene3 if it overlaps with a feature in this file2: chr2... (1 Reply)
Discussion started by: fadista
1 Replies

6. AIX

Change lv REGION in HDISK1

Dears my rootvg is missed up i can not extend the /opt as soon as i try to extend the Filesystem its give me that there is not enough space . as there any way to change the REGION of the LVs in HDISK1 ? lspv -p hdisk0 hdisk0: PP RANGE STATE REGION LV NAME TYPE ... (8 Replies)
Discussion started by: thecobra151
8 Replies

7. Shell Programming and Scripting

Merge left hand strings mapping to different right hand strings

Hello, I am working on an Urdu to Hindi dictionary which has the following structure: a=b a=c n=d n=q and so on. i.e. Headword separated from gloss by a = I am giving below a live sample بتا=बता بتا=बित्ता بتا=बुत्ता بتان=बतान بتان=बितान بتانا=बिताना I need the following... (3 Replies)
Discussion started by: gimley
3 Replies

8. Programming

Perl script to merge cells in column1 which has same strings, for all sheets in a excel workbook

Perl script to merge cells ---------- Post updated at 12:59 AM ---------- Previous update was at 12:54 AM ---------- I am using below code to read files from a dir and print to excel. open(my $in, '<', $file) or die "Could not open file: $!"; my $rowCount = 0; my $colCount = 0;... (11 Replies)
Discussion started by: Jack_Bruce
11 Replies

9. Shell Programming and Scripting

Merge strings from a file into a template

I am preparing a morphological grammar of Marathi to be placed in open-source. I have two files. The first file called Adverbs contains a whole list of words, one word per line A sample is given below: आधी इतक इतपत उलट एवढ ऐवजी कड कडनं कडल कडील कडून कडे करता करिता खाल (2 Replies)
Discussion started by: gimley
2 Replies

10. Shell Programming and Scripting

Merge strings with ignore case

I have a bi-lingual database of a large number of dictionaries. It so happens that in some a given string is in upper case and in others it is in lower case. An example will illustrate the issue. toll Tax=पथ-कर Toll tax=राहदारी कर toll tax=टोल I want to treat all three instances of toll tax... (3 Replies)
Discussion started by: gimley
3 Replies
clearok(3XCURSES)					  X/Open Curses Library Functions					 clearok(3XCURSES)

NAME
clearok, idlok, leaveok, scrollok, setscrreg, wsetscrreg - terminal output control functions SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int clearok(WINDOW *win, bool bf); int idlok(WINDOW *win, bool bf); int leaveok(WINDOW *win, bool bf); int scrollok(WINDOW *win, bool bf); int setscrreg(int top, int bot); int wsetscrreg(WINDOW *win, int top, int bot); DESCRIPTION
These functions set options that deal with the output within Curses functions. The clearok() function assigns the value of bf to an internal flag in the specified window that governs clearing of the screen during a refresh. If, during a refresh operation on the specified window, the flag in curscr is TRUE or the flag in the specified window is TRUE, clearok() clears the screen, redraws it in its entirety, and sets the flag to FALSE in curscr and in the specified window. The initial state is unspecified The idlok() function specifies whether the implementation may use the hardware insert-line, delete-line, and scroll features of terminals so equipped. If bf is TRUE, use of these features is enabled. If bf is FALSE, use of these features is disabled and lines are instead redrawn as required. The initial state is FALSE. The leaveok() function controls the cursor position after a refresh operation. If bf is TRUE, refresh operations on the specified window may leave the terminal's cursor at an arbitrary position. If bf is FALSE, then at the end of any refresh operation, the terminal's cursor is positioned at the cursor position contained in the specified window. The initial state is FALSE. The scrollok() function controls the use of scrolling.If bf is TRUE, then scrolling is enabled for the specified window. If bf is FALSE, scrolling is disabled for the specified window. The initial state is FALSE. The setscrreg() and wsetscrreg() functions define a software scrolling region in the current or specified window. The top and bottom argu- ments are the line numbers of the first and last line defining the scrolling region. (Line 0 is the top line of the window.) If this option and scrollok() are enabled, an attempt to move off the last line of the margin causes all lines in the scrolling region to scroll one line in the direction of the first line. Only characters in the window are scrolled. If a software scrolling region is set and scrollok() is not enabled, an attempt to move off the last line of the margin does not reposition any lines in the scrolling region. PARAMETERS
win Is a pointer to a window. bf Is a Boolean expression. top Is the top line of the scrolling region (top of the window is line 0). bot Is the bottom line of the scrolling region (top of the window is line 0). RETURN VALUES
Upon successful completion, the setscrreg() and wsetscrreg() functions return OK. Otherwise, they return ERR. The other functions always return OK. ERRORS
No errors are defined. USAGE
The only reason to enable the idlok() feature is to use scrolling to achieve the visual effect of motion of a partial window, such as for a screen editor. In other cases, the feature can be visually annoying. The leaveok() option provides greater efficiency for applications that do not use the cursor. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
bkgdset(3XCURSES), clear(3XCURSES), doupdate(3XCURSES), libcurses(3XCURSES), scrl(3XCURSES), attributes(5), standards(5) SunOS 5.11 5 Jun 2002 clearok(3XCURSES)
All times are GMT -4. The time now is 07:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy