ooRexx  4.2.0-source
About: ooRexx (Open Object Rexx) is a free implementation of Object Rexx. Object Rexx is an enhancement of the classic Rexx interpreter; a full-featured programming language with a human-oriented syntax.
  Fossies Dox: ooRexx-4.2.0-source.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

SysLegacyAPI.cpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.ibm.com/developerworks/oss/CPLv1.0.htm */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*********************************************************************/
38 
39 #ifdef HAVE_CONFIG_H
40 # include "config.h"
41 #endif
42 
43 #include "rexx.h"
44 
45 /*********************************************************************/
46 /* */
47 /* Function: RexxPullQueue() */
48 /* */
49 /* Description: Pull an entry from a queue. */
50 /* */
51 /* Function: Locate the queue, return its top entry to */
52 /* the caller, and tell the queue data */
53 /* manager to delete the entry. */
54 /* */
55 /* If the queue is empty, the caller can elect */
56 /* to wait for someone to post an entry. */
57 /* */
58 /* Notes: Caller is responsible for freeing the returned */
59 /* memory. */
60 /* */
61 /* The entry's control block is stored in the */
62 /* entry's memory. We must therefore obtain */
63 /* addressability to the entry's memory before */
64 /* we can process the entry. */
65 /* */
66 /* Input: external queue name, wait flag. */
67 /* */
68 /* Output: queue element, data size, date/time stamp. */
69 /* */
70 /* Effects: Top entry removed from the queue. Message */
71 /* queued to the queue data manager. */
72 /* */
73 /*********************************************************************/
75  const char *name,
76  PRXSTRING data_buf,
77  REXXDATETIME *dt,
78  size_t waitflag)
79 {
80  RexxQueueTime qt;
81 
82  // for unix platforms, this is a straight passthrough to the real API.
83  RexxReturnCode rc = RexxPullFromQueue(name, data_buf, &qt, waitflag);
84  // older releases for Linux used an internal structure for the timestamp
85  // that had portability problems. We need to manually copy over the fields
86  // because of the mismatches.
87  if (dt != NULL)
88  {
89  dt->hours = qt.hours;
90  dt->minutes = qt.minutes;
91  dt->seconds = qt.seconds;
92  dt->hundredths = qt.hundredths;
93  dt->microseconds = qt.microseconds;
94  dt->day = qt.day;
95  dt->month = qt.month;
96  dt->year = qt.year;
97  dt->weekday = qt.weekday;
98  dt->yearday = qt.yearday;
99  dt->valid = 1;
100  }
101  return rc;
102 }
103 
_REXXDATETIME::day
uint16_t day
Definition: rexxplatformapis.h:47
_RexxQueueTime::minutes
uint16_t minutes
Definition: rexx.h:239
rexx.h
_REXXDATETIME::microseconds
size_t microseconds
Definition: rexxplatformapis.h:51
_RexxQueueTime::day
uint16_t day
Definition: rexx.h:242
RexxPullFromQueue
RexxReturnCode REXXENTRY RexxPullFromQueue(CSTRING, PRXSTRING, RexxQueueTime *, size_t)
_REXXDATETIME::hours
uint16_t hours
Definition: rexxplatformapis.h:43
RexxReturnCode
int RexxReturnCode
Definition: rexx.h:73
_REXXDATETIME::month
uint16_t month
Definition: rexxplatformapis.h:48
_REXXDATETIME
Definition: rexxplatformapis.h:42
_RexxQueueTime::microseconds
uint32_t microseconds
Definition: rexx.h:246
_RexxQueueTime::weekday
uint16_t weekday
Definition: rexx.h:245
_RexxQueueTime::yearday
uint32_t yearday
Definition: rexx.h:247
_RexxQueueTime::hours
uint16_t hours
Definition: rexx.h:238
_REXXDATETIME::hundredths
uint16_t hundredths
Definition: rexxplatformapis.h:46
_RXSTRING
Definition: rexx.h:156
_REXXDATETIME::year
uint16_t year
Definition: rexxplatformapis.h:49
_REXXDATETIME::seconds
uint16_t seconds
Definition: rexxplatformapis.h:45
REXXENTRY
#define REXXENTRY
Definition: rexxapitypes.h:61
_RexxQueueTime::month
uint16_t month
Definition: rexx.h:243
_RexxQueueTime::year
uint16_t year
Definition: rexx.h:244
_REXXDATETIME::weekday
uint16_t weekday
Definition: rexxplatformapis.h:50
_RexxQueueTime::seconds
uint16_t seconds
Definition: rexx.h:240
RexxPullQueue
RexxReturnCode REXXENTRY RexxPullQueue(const char *name, PRXSTRING data_buf, REXXDATETIME *dt, size_t waitflag)
Definition: SysLegacyAPI.cpp:74
_REXXDATETIME::valid
uint16_t valid
Definition: rexxplatformapis.h:53
_RexxQueueTime::hundredths
uint16_t hundredths
Definition: rexx.h:241
_RexxQueueTime
Definition: rexx.h:237
_REXXDATETIME::minutes
uint16_t minutes
Definition: rexxplatformapis.h:44
_REXXDATETIME::yearday
size_t yearday
Definition: rexxplatformapis.h:52