| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I'm trying to work with the Motif libraries in XDS, I have lots of questions regarding some of the C code I come across but I muddle through, however, this one has me stumped: It relates to extracting the filename selected with the FileSelectionBox XmFileSelectionBoxCallbackStruct *cbs = (XmFileSectionBoxCallbackStruc *) call_data; Can someone explain to me what is going on there? I know that call_data is an XtPointer, XmFileSelectionBoxCallbackStruct is a RECORD and *cbs is a dereferenced pointer, I think. but what is that * just before the ) in the second line? I'm guessing it has something to do with dereferencing something, but I have no idea how to convert it to Modula-2. Thanks for any input. Terry -- Terry "qnr" Ross | http://www.aliboom.com 1024D/E5796C4D | Key BE84 EC1D FC94 D97B 9063 AD15 0F38 193A E579 6C4D Source Mage GNU/Linux http://www.sourcemage.org |
|
#2
| |||
| |||
| Terry Ross escribió: > I'm trying to work with the Motif libraries in XDS, I have lots of > questions regarding some of the C code I come across but I muddle through, > however, this one has me stumped: > > It relates to extracting the filename selected with the FileSelectionBox > > XmFileSelectionBoxCallbackStruct *cbs = > (XmFileSectionBoxCallbackStruc *) call_data; > > > Can someone explain to me what is going on there? I know that > call_data is an XtPointer, > XmFileSelectionBoxCallbackStruct is a RECORD and *cbs is a dereferenced > pointer, I think. > > but what is that * just before the ) in the second line? A typecast. See: http://www.cprogramming.com/referenc...ng/cstyle.html > ... I'm guessing it > has something to do with dereferencing something, but I have no idea how > to convert it to Modula-2. Perhaps the CAST function, available on ISO Modula-2, could help. -- Manuel Collado - http://lml.ls.fi.upm.es/~mcollado |
|
#3
| |||
| |||
| On Thu, 04 Sep 2008 00:05:34 +0200, Manuel Collado wrote: > Terry Ross escribió: [...snipped...] > > A typecast. See: > http://www.cprogramming.com/referenc...ng/cstyle.html > > > ... I'm guessing it >> has something to do with dereferencing something, but I have no idea >> how to convert it to Modula-2. > > Perhaps the CAST function, available on ISO Modula-2, could help. Ah, thank you Manuel, that helps, I'll experiment a bit with this. Terry -- Terry "qnr" Ross | http://www.aliboom.com 1024D/E5796C4D | Key BE84 EC1D FC94 D97B 9063 AD15 0F38 193A E579 6C4D Source Mage GNU/Linux http://www.sourcemage.org |
|
#4
| |||
| |||
| XmFileSelectionBoxCallbackStruct * means POINTER TO XmFileSelectionBoxCallbackStruct In the second line: (XmFileSectionBoxCallbackStruc *) call_data; means convert call_data to a POINTER TO XmFileSelectionBoxCallbackStruct So to convert to Modula-2: TYPE PtrType = POINTER TO XmFileSelectionBoxCallbackStruct; VAR cbs : PtrType; cbs := CAST(PtrType,call_data); Frank. "Terry Ross" <tross04401@spamcop.net> wrote in message news:XN-dnXQPmv_mmiLVnZ2dnUVZ_g2dnZ2d@giganews.com... > I'm trying to work with the Motif libraries in XDS, I have lots of > questions regarding some of the C code I come across but I muddle through, > however, this one has me stumped: > > It relates to extracting the filename selected with the FileSelectionBox > > XmFileSelectionBoxCallbackStruct *cbs = > (XmFileSectionBoxCallbackStruc *) call_data; > > > Can someone explain to me what is going on there? I know that > call_data is an XtPointer, > XmFileSelectionBoxCallbackStruct is a RECORD and *cbs is a dereferenced > pointer, I think. > > but what is that * just before the ) in the second line? I'm guessing it > has something to do with dereferencing something, but I have no idea how > to convert it to Modula-2. > > Thanks for any input. > > Terry > > > > -- > Terry "qnr" Ross | http://www.aliboom.com > 1024D/E5796C4D | Key BE84 EC1D FC94 D97B 9063 AD15 0F38 193A E579 6C4D > Source Mage GNU/Linux http://www.sourcemage.org |
|
#5
| |||
| |||
| On Sep 24, 4:01*am, "Frank Schoonjans" <Frank.Schoonj...@ugent.dot.be> wrote: > XmFileSelectionBoxCallbackStruct * means POINTER TO > XmFileSelectionBoxCallbackStruct > > In the second line: (XmFileSectionBoxCallbackStruc *) call_data; > means convert call_data to a POINTER TO XmFileSelectionBoxCallbackStruct > > So to convert to Modula-2: > > TYPE PtrType = POINTER TO XmFileSelectionBoxCallbackStruct; > > VAR cbs : PtrType; > > cbs := CAST(PtrType,call_data); > > Frank. > > "Terry Ross" <tross04...@spamcop.net> wrote in message > > news:XN-dnXQPmv_mmiLVnZ2dnUVZ_g2dnZ2d@giganews.com... > [...snipped...] Thank you Frank, I appreciate your help. Terry |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.