Sponsored Content
Full Discussion: Deep copy of structure in C
Top Forums Programming Deep copy of structure in C Post 302906340 by breezevinay on Thursday 19th of June 2014 04:16:29 AM
Old 06-19-2014
Deep copy of structure in C

Hi ,

I have a scenario where i need to copy the iter to another local variable , where iter is of type MCC_T_SYS_ADDRINFO *iter .

Code:
struct addrinfo {
    int              ai_flags;
    int              ai_family;
    int              ai_socktype;
    int              ai_protocol;
    socklen_t        ai_addrlen;
    struct sockaddr *ai_addr;
    char            *ai_canonname;
    struct addrinfo *ai_next;
};


typedef struct addrinfo MCC_T_SYS_ADDRINFO;

MCC_T_SYS_ADDRINFO *iter = ipc->addr_ptr;

Now i need to copy the *iter to a local variable which of type MCC_T_SYS_ADDRINFO *localiter

how do i achieve it ?

Please help me in this


Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 06-19-2014 at 05:22 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

any idea to copy directory structure

I want to copy the durectory structure having subdirectories in it ... would be greatful if anyone could let me know .. thanks in advance (6 Replies)
Discussion started by: myelvis
6 Replies

2. UNIX for Dummies Questions & Answers

copy files with directory structure

i have a text file as. /database/sp/NTR_Update_Imsi_List.sql /database/sp/NTR_Update_Imsi_Range_List.sql /database/sp/NTR_Vlr_Upload.sql /database/tables/StatsTables.sql /mib/ntr.mib /mib/ntr.v2.mib /scripts/operations/ntr/IMSITracer.ph /scripts/operations/ntr/IMSITracer.pl ... (3 Replies)
Discussion started by: adddy
3 Replies

3. Shell Programming and Scripting

Recursion to Copy a Directory structure

I have the below code to recurse through a given file path. I am able to go to the leaf level once recursively but traversing out is not possible as the required varaibles don't have the values on return. Both typeset and local don't work for my variable definitions. I have the o/p of the sample... (2 Replies)
Discussion started by: avrkiran
2 Replies

4. Shell Programming and Scripting

copy directory structure to a system on the network

I am trying to write a script which has to copy the directory structure from my system to another system on the network. But I dont want the files to be copied. I think I have to start with copying all subdirectories names in a directory to a system on the network. Here's the case: Source... (1 Reply)
Discussion started by: firefox211
1 Replies

5. Shell Programming and Scripting

Copy only folder structure ?

Hello, I am not sure how feasible is it, but trying to copy/create the folders from one box to another. I dont want to copy the content of folder otherwise it'd be too much of data.. The folder structure is quite complex (in deep hierarchy) and its a big effort manually .. Please... (5 Replies)
Discussion started by: navsha
5 Replies

6. Shell Programming and Scripting

Copy a file by creating folder structure in destination as in Souce

Hello, i am having a source directory which consist of multiple sub directories and my destination folder is a empty directory. if try to copy a file source->test->1.txt from source to destination test2 using the commaind. cp source/test/1.txt desti/ It will copy the 1.txt under desti... (1 Reply)
Discussion started by: tsaravanan
1 Replies

7. UNIX for Advanced & Expert Users

Copy Structure excluding some folders

Hi I want to copy the structure from one place to another. -> cd /hol/; -> find . -type d | cpio -pvdm /abc/cat; while copying the structure I want to exclude some directories like test1 and Test. I have read somewhere that this can be done with -prune option. Could anyone... (2 Replies)
Discussion started by: soumodeep123
2 Replies

8. Shell Programming and Scripting

Copy files from input file with dir structure

hi, I want to copy files from source directory based on input file (or output of previous command) and i want to have the SAME DIRECTORY STRUCTURE. Note that i will have other files and directories which i dont want to copy to destination. For example, dir source has following content:... (22 Replies)
Discussion started by: dragon.1431
22 Replies

9. Shell Programming and Scripting

Need to copy a directory structure from one server to another

Hello All, I have got a dev server and a production server will call it as D server and P server. I have a dir structure in my D server and i need to create the same dir structure in P server also using a shell script. If i do a find . in my D server, i am getting an o/p like :- . ./vio... (9 Replies)
Discussion started by: Renjesh
9 Replies

10. Shell Programming and Scripting

How to copy all structure folder create last day?

HI All, please help , i got same case . i want copy folder and directory create yesterday. for sample below : drwxr-xr-x 4 apps apps 33 Nov 23 04:00 xxxxxx@gmai.com drwxr-xr-x 4 apps apps 33 Nov 23 04:00 yyyyyyy@gmail.com drwxr-xr-x 4 apps apps 33 Nov 24 04:00... (2 Replies)
Discussion started by: fajar_3t3
2 Replies
Gtk2::TreeSelection(3pm)				User Contributed Perl Documentation				  Gtk2::TreeSelection(3pm)

NAME
Gtk2::TreeSelection - wrapper for GtkTreeSelection HIERARCHY
Glib::Object +----Gtk2::TreeSelection METHODS
integer = $selection->count_selected_rows boolean = $selection->iter_is_selected ($iter) o $iter (Gtk2::TreeIter) selectionmode = $selection->get_mode $selection->set_mode ($type) o $type (Gtk2::SelectionMode) boolean = $selection->path_is_selected ($path) o $path (Gtk2::TreePath) $selection->select_all $selection->set_select_function ($func, $data=undef) o $func (scalar) o $data (scalar) $selection->select_iter ($iter) o $iter (Gtk2::TreeIter) $selection->select_path ($path) o $path (Gtk2::TreePath) $selection->select_range ($start_path, $end_path) o $start_path (Gtk2::TreePath) o $end_path (Gtk2::TreePath) $selection->selected_foreach ($func, $data=undef) o $func (subroutine) o $data (scalar) Call $func on every selected row in $selection's view. iter = $tree_selection->get_selected (model, iter) = $tree_selection->get_selected Since most of the time you are only interested in the iter, "get_selected" returns only the iter in scalar context. @paths = $selection->get_selected_rows Returns the Gtk2::TreePath of each selected row, or an empty list if no rows are selected. The model is not returned, as documented in the C API reference. To get the model, try "$selection->get_tree_view->get_model". treeview = $selection->get_tree_view $selection->unselect_all $selection->unselect_iter ($iter) o $iter (Gtk2::TreeIter) $selection->unselect_path ($path) o $path (Gtk2::TreePath) $selection->unselect_range ($start_path, $end_path) o $start_path (Gtk2::TreePath) o $end_path (Gtk2::TreePath) Since: gtk+ 2.2 scalar = $selection->get_user_data SIGNALS
changed (Gtk2::TreeSelection) ENUMS AND FLAGS
enum Gtk2::SelectionMode o 'none' / 'GTK_SELECTION_NONE' o 'single' / 'GTK_SELECTION_SINGLE' o 'browse' / 'GTK_SELECTION_BROWSE' o 'multiple' / 'GTK_SELECTION_MULTIPLE' o 'extended' / 'GTK_SELECTION_EXTENDED' SEE ALSO
Gtk2, Glib::Object COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::TreeSelection(3pm)
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy