EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: where is ca_detach_context()?
From: "Mark Rivers" <[email protected]>
To: "Liyu, Andrei V" <[email protected]>, "Jeff Hill" <[email protected]>, <[email protected]>
Date: Thu, 21 May 2009 19:32:43 -0500
Jeff,
 
It looks like you only added the prototype for ca_detach_context to cadef.h on 2009-02-09, in version 1.77.2.3.  But 3.14.10 is 1.77.2.2.
 
Here is from the CVS log:
 
corvette:base-3.14.10/src/ca>cvs log cadef.h
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/cadef.h,v
Working file: cadef.h
head: 1.81
branch:
locks: strict
access list:
symbolic names:
        R3-14-10: 1.77.2.2

...
----------------------------
revision 1.77.2.4
date: 2009-04-27 18:31:50 +0000;  author: anj;  state: Exp;  lines: +1 -120;  commitid: Q3pBeryDyMfoxGLt;
More ANSI C conversion
----------------------------
revision 1.77.2.3
date: 2009-02-09 15:23:06 +0000;  author: jhill;  state: Exp;  lines: +1 -0;  commitid: QMXGzjgPlK56YLBt;
addred proto for ca_detach_context
----------------------------
revision 1.77.2.2
date: 2004-10-19 20:21:31 +0000;  author: jhill;  state: Exp;  lines: +1 -1;
ca_get_host_name() used to return void, but has been changed to
return the string length.
----------------------------
...
 
Mark
 

________________________________

From: [email protected] on behalf of Liyu, Andrei V
Sent: Thu 5/21/2009 6:01 PM
To: Jeff Hill; [email protected]
Subject: RE: where is ca_detach_context()?



Jeff hi,

 

Compiler is not a issue because header file doesn't have ca_detach_context() function.

I again have loaded baseR3.14.10.tar.gz file (date is October 27, 2008) from Epics cite

 

In ...\src\ca\cadeh.h

 

>From line 115 (you mentioned about line 119)

==========

typedef struct event_handler_args {

    void            *usr;   /* user argument supplied with request */

    chanId          chid;   /* channel id */

    long            type;   /* the type of the item returned */ 

    long            count;  /* the element count of the item returned */

    READONLY void   *dbr;   /* a pointer to the item returned */

    int             status; /* ECA_XXX status of the requested op from the server */

} evargs;

======

 

>From line 874

========

/*

 * used when an auxillary thread needs to join a CA client context started

 * by another thread

 */

epicsShareFunc struct ca_client_context * epicsShareAPI ca_current_context ();

epicsShareFunc int epicsShareAPI ca_attach_context ( struct ca_client_context * context );

 

 

epicsShareFunc int epicsShareAPI ca_client_status ( unsigned level );

epicsShareFunc int epicsShareAPI ca_context_status ( struct ca_client_context *, unsigned level );

=======

 

I don't see line with epicsShareFunc void epicsShareAPI ca_detach_context ();

 

Maybe somebody load baseR3.14.10.tar.gz (date is October 27, 2008)  and check also.

 

Thanks, Andrei.

 

 

From: Jeff Hill [mailto:[email protected]] 
Sent: Thursday, May 21, 2009 2:32 PM
To: Liyu, Andrei V; [email protected]
Subject: RE: where is ca_detach_context()?

 

 

Hi Andrei,

 

You should see the function prototype, as follows, at about line number 189 in cadef.h.

 

"epicsShareFunc void epicsShareAPI ca_detach_context ();"

 

I see it also at ordinal 119 with symbol name "_ca_detach_context@0" when I run the ms depends.exe tool, and load ca.dll.

 

I am looking at the very latest version of R3.14, but I don't expect that any of this has changed in the patch releases.

 

> I can't use ca_detach_context () in my program because 

> compiler doesn't find this function. 

 

Are you using the MS compiler? Perhaps you need to specify /MD to enable linking with multithreaded DLL runtime libraries. 

Typical Windows MS Build Options

cl -c /nologo /D__STDC__=0 /Ox /GL /W3 /w44355 /MD -I. -I.. -I..\\..\\..\\include\\os\\WIN32 -I..\\..\\..\\include ..\\acctst.c

link -nologo /LTCG /incremental:no /opt:ref /release /version:3.14 -out:acctst.exe acctstMain.obj acctst.obj d:/user/R3.14.clean/epics/base/lib/WIN32-x86/ca.lib d:/user/R3.14.clean/epics/base/lib/WIN32-x86

In summary, the following code runs in the preprocess in shareLib.h when it's a windows compilation. As I recall, _DLL is defined by windows compilers when /MD (or the equivalent with a 3rd party compiler) is specified.

#       if defined(_DLL) /* this indicates that we are being compiled to call DLLs */

#           define epicsShareExtern __declspec(dllimport) extern 

#           define epicsShareClass  __declspec(dllimport) 

#           define epicsShareFunc  __declspec(dllimport)

#       else

#           define epicsShareExtern extern

#           define epicsShareClass

#           define epicsShareFunc

#       endif

Jeff

 

From: [email protected] [mailto:[email protected]] On Behalf Of Liyu, Andrei V
Sent: Thursday, May 21, 2009 2:56 PM
To: [email protected]
Subject: where is ca_detach_context()?

 

Hi,

I need to write simple CA client with couple threads. Both threads use CA. So I need to use ca_attach_context() and ca_detach_context() in second thread.

...

I can't use ca_detach_context () in my program because compiler doesn't find this function.

I checked manually and couldn't find "ca_detach_context" in cadef.h and ca.dll files.

I do found "ca_detach_context" in access.cpp and CAref.html have it. 

What is wrong?

I try to use Epics versions 3.14.9 and 3.14.10.

Thanks, Andrei.



Replies:
RE: where is ca_detach_context()? Liyu, Andrei V
References:
where is ca_detach_context()? Liyu, Andrei V
RE: where is ca_detach_context()? Jeff Hill
RE: where is ca_detach_context()? Liyu, Andrei V

Navigate by Date:
Prev: RE: where is ca_detach_context()? Liyu, Andrei V
Next: including one .stt file as a header in another Patrick Thomas
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: where is ca_detach_context()? Liyu, Andrei V
Next: RE: where is ca_detach_context()? Liyu, Andrei V
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·