source: trunk/src/gui/nepmdlib/macros/querypathinfo.e@ 2417

Last change on this file since 2417 was 2417, checked in by Andreas Schnellbacher, 14 years ago
  • Added svn keywords.
  • Property svn:keywords set to Date Revision Author HeadURL Id
File size: 5.0 KB
Line 
1/****************************** Module Header *******************************
2*
3* Module Name: querypathinfo.e
4*
5* .e wrapper routine to access the NEPMD library DLL.
6* include of nepmdlib.e
7*
8* Copyright (c) Netlabs EPM Distribution Project 2002
9*
10* $Id: querypathinfo.e 2417 2011-05-15 23:32:51Z aschn $
11*
12* ===========================================================================
13*
14* This file is part of the Netlabs EPM Distribution package and is free
15* software. You can redistribute it and/or modify it under the terms of the
16* GNU General Public License as published by the Free Software
17* Foundation, in version 2 as it comes in the "COPYING" file of the
18* Netlabs EPM Distribution. This library is distributed in the hope that it
19* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21* General Public License for more details.
22*
23****************************************************************************/
24
25/*
26@@NepmdQueryPathInfo@PROTOTYPE
27InfoValue = NepmdQueryPathInfo( Pathname, ValueTag);
28
29@@NepmdQueryPathInfo@CATEGORY@FILE
30
31@@NepmdQueryPathInfo@SYNTAX
32This function queries installation related values
33from the [=TITLE].
34
35@@NepmdQueryPathInfo@PARM@Pathname
36This parameter specifies the pathname of the file or directory, of
37which a path information value is requested.
38
39@@NepmdQueryPathInfo@PARM@ValueTag
40This parameter specifies a keyword determining the
41path information value to be returned.
42The following keywords are supported:
43.pl bold
44- ATIME
45= returns the last access time
46- MTIME
47= returns the last modification time
48- CTIME
49= returns the creation time
50- SIZE
51= returns the size of the file
52- EASIZE
53= returns the size of the extended attributes attached to the file
54- ATTR
55= returns the file attributes
56.el
57
58@@NepmdQueryPathInfo@RETURNS
59*NepmdQueryPathInfo* returns either
60.ul compact
61- the information value or
62- the string *ERROR:xxx*, where *xxx* is an OS/2 error code.
63
64@@NepmdQueryPathInfo@TESTCASE
65You can test this function from the *EPM* commandline by
66executing:
67.sl
68- *NepmdQueryPathInfo* [.IDPNL_EFUNC_NEPMDQUERYPATHINFO_PARM_PATHNAME pathname]
69 - or
70- *QueryPathInfo* [.IDPNL_EFUNC_NEPMDQUERYPATHINFO_PARM_PATHNAME pathname]
71
72Executing this command will
73open up a virtual file and
74write all [.IDPNL_EFUNC_NEPMDQUERYPATHINFO_PARM_VALUETAG supported path info values]
75about the specified file or directory into it.
76
77@@
78*/
79
80/* ------------------------------------------------------------- */
81/* allow editor command to call function */
82/* ------------------------------------------------------------- */
83compile if NEPMD_LIB_TEST
84
85defc NepmdQueryPathInfo, QueryPathInfo
86
87 PathName = arg( 1);
88 if (PathName = '') then
89 sayerror 'error: no pathname specified !';
90 return;
91 endif
92
93 /* create virtual file */
94 helperNepmdCreateDumpfile( 'NepmdQueryPathInfo', NepmdQueryFullname( PathName));
95
96 insertline helperNepmdQueryPathInfoValue( PathName, 'ATIME');
97 insertline helperNepmdQueryPathInfoValue( PathName, 'MTIME');
98 insertline helperNepmdQueryPathInfoValue( PathName, 'CTIME');
99 insertline helperNepmdQueryPathInfoValue( PathName, 'SIZE');
100 insertline helperNepmdQueryPathInfoValue( PathName, 'EASIZE');
101 insertline helperNepmdQueryPathInfoValue( PathName, 'ATTR');
102 .modify = 0;
103
104 return;
105
106defproc helperNepmdQueryPathInfoValue( Pathname, ValueTag) =
107 return leftstr( ValueTag, 6) ':' NepmdQueryPathInfo( PathName, ValueTag);
108
109compile endif
110
111/* ------------------------------------------------------------- */
112/* procedure: NepmdQueryPathInfo */
113/* ------------------------------------------------------------- */
114/* .e Syntax: */
115/* InfoValue = NepmdQueryPathInfo( PathName, ValueTag); */
116/* */
117/* See valig tags in src\gui\nepmdlib\nepmdlib.h: */
118/* NEPMD_PATHINFO_* */
119/* ------------------------------------------------------------- */
120/* C prototype: */
121/* APIRET EXPENTRY NepmdQueryPathInfo( PSZ pszPathname, */
122/* PSZ pszInfoTag, */
123/* PSZ pszBuffer, */
124/* ULONG ulBuflen) */
125/* ------------------------------------------------------------- */
126
127defproc NepmdQueryPathInfo( Pathname, ValueTag) =
128
129 BufLen = 260;
130 InfoValue = copies( atoi( 0), BufLen);
131
132 /* prepare parameters for C routine */
133 Pathname = Pathname''atoi( 0);
134 ValueTag = ValueTag''atoi( 0);
135
136 /* call C routine */
137 LibFile = helperNepmdGetlibfile();
138 rc = dynalink32( LibFile,
139 "NepmdQueryPathInfo",
140 address( Pathname) ||
141 address( ValueTag) ||
142 address( InfoValue) ||
143 atol( Buflen));
144
145 helperNepmdCheckliberror( LibFile, rc);
146
147 return makerexxstring( InfoValue);
148
Note: See TracBrowser for help on using the repository browser.