VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/nsprpub/pr/include/obsolete/probslet.h@ 101869

Last change on this file since 101869 was 101869, checked in by vboxsync, 17 months ago

libs/xpcom: Remove code for unused platforms from nsprpub, bugref:10545

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is the Netscape Portable Runtime (NSPR).
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38/*
39** A collection of things thought to be obsolete
40*/
41
42#if defined(PROBSLET_H)
43#else
44#define PROBSLET_H
45
46#include "prio.h"
47
48#ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
49#define PR_Yield VBoxNsprPR_Yield
50#define PR_Select VBoxNsprPR_Select
51#define PR_FD_ZERO VBoxNsprPR_FD_ZERO
52#define PR_FD_SET VBoxNsprPR_FD_SET
53#define PR_FD_CLR VBoxNsprPR_FD_CLR
54#define PR_FD_ISSET VBoxNsprPR_FD_ISSET
55#define PR_FD_NSET VBoxNsprPR_FD_NSET
56#define PR_FD_NCLR VBoxNsprPR_FD_NCLR
57#define PR_FD_NISSET VBoxNsprPR_FD_NISSET
58#define PR_Stat VBoxNsprPR_Stat
59#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
60
61PR_BEGIN_EXTERN_C
62
63/*
64** Yield the current thread. The proper function to use in place of
65** PR_Yield() is PR_Sleep() with an argument of PR_INTERVAL_NO_WAIT.
66*/
67NSPR_API(PRStatus) PR_Yield(void);
68
69/************************************************************************/
70/************* The following definitions are for select *****************/
71/************************************************************************/
72
73/*
74** The following is obsolete and will be deleted in the next release!
75** These are provided for compatibility, but are GUARANTEED to be slow.
76**
77** Override PR_MAX_SELECT_DESC if you need more space in the select set.
78*/
79#ifndef PR_MAX_SELECT_DESC
80#define PR_MAX_SELECT_DESC 1024
81#endif
82typedef struct PR_fd_set {
83 PRUint32 hsize;
84 PRFileDesc *harray[PR_MAX_SELECT_DESC];
85 PRUint32 nsize;
86 PRInt32 narray[PR_MAX_SELECT_DESC];
87} PR_fd_set;
88
89/*
90*************************************************************************
91** FUNCTION: PR_Select
92** DESCRIPTION:
93**
94** The call returns as soon as I/O is ready on one or more of the underlying
95** file/socket descriptors or an exceptional condition is pending. A count of the
96** number of ready descriptors is returned unless a timeout occurs in which case
97** zero is returned. On return, PR_Select replaces the given descriptor sets with
98** subsets consisting of those descriptors that are ready for the requested condition.
99** The total number of ready descriptors in all the sets is the return value.
100**
101** INPUTS:
102** PRInt32 num
103** This argument is unused but is provided for select(unix) interface
104** compatability. All input PR_fd_set arguments are self-describing
105** with its own maximum number of elements in the set.
106**
107** PR_fd_set *readfds
108** A set describing the io descriptors for which ready for reading
109** condition is of interest.
110**
111** PR_fd_set *writefds
112** A set describing the io descriptors for which ready for writing
113** condition is of interest.
114**
115** PR_fd_set *exceptfds
116** A set describing the io descriptors for which exception pending
117** condition is of interest.
118**
119** Any of the above readfds, writefds or exceptfds may be given as NULL
120** pointers if no descriptors are of interest for that particular condition.
121**
122** PRIntervalTime timeout
123** Amount of time the call will block waiting for I/O to become ready.
124** If this time expires without any I/O becoming ready, the result will
125** be zero.
126**
127** OUTPUTS:
128** PR_fd_set *readfds
129** A set describing the io descriptors which are ready for reading.
130**
131** PR_fd_set *writefds
132** A set describing the io descriptors which are ready for writing.
133**
134** PR_fd_set *exceptfds
135** A set describing the io descriptors which have pending exception.
136**
137** RETURN:PRInt32
138** Number of io descriptors with asked for conditions or zero if the function
139** timed out or -1 on failure. The reason for the failure is obtained by
140** calling PR_GetError().
141** XXX can we implement this on windoze and mac?
142**************************************************************************
143*/
144NSPR_API(PRInt32) PR_Select(
145 PRInt32 num, PR_fd_set *readfds, PR_fd_set *writefds,
146 PR_fd_set *exceptfds, PRIntervalTime timeout);
147
148/*
149** The following are not thread safe for two threads operating on them at the
150** same time.
151**
152** The following routines are provided for manipulating io descriptor sets.
153** PR_FD_ZERO(&fdset) initializes a descriptor set fdset to the null set.
154** PR_FD_SET(fd, &fdset) includes a particular file descriptor fd in fdset.
155** PR_FD_CLR(fd, &fdset) removes a file descriptor fd from fdset.
156** PR_FD_ISSET(fd, &fdset) is nonzero if file descriptor fd is a member of
157** fdset, zero otherwise.
158**
159** PR_FD_NSET(osfd, &fdset) includes a particular native file descriptor osfd
160** in fdset.
161** PR_FD_NCLR(osfd, &fdset) removes a native file descriptor osfd from fdset.
162** PR_FD_NISSET(osfd, &fdset) is nonzero if native file descriptor osfd is a member of
163** fdset, zero otherwise.
164*/
165
166NSPR_API(void) PR_FD_ZERO(PR_fd_set *set);
167NSPR_API(void) PR_FD_SET(PRFileDesc *fd, PR_fd_set *set);
168NSPR_API(void) PR_FD_CLR(PRFileDesc *fd, PR_fd_set *set);
169NSPR_API(PRInt32) PR_FD_ISSET(PRFileDesc *fd, PR_fd_set *set);
170NSPR_API(void) PR_FD_NSET(PRInt32 osfd, PR_fd_set *set);
171NSPR_API(void) PR_FD_NCLR(PRInt32 osfd, PR_fd_set *set);
172NSPR_API(PRInt32) PR_FD_NISSET(PRInt32 osfd, PR_fd_set *set);
173
174#ifndef NO_NSPR_10_SUPPORT
175#include <sys/stat.h>
176
177NSPR_API(PRInt32) PR_Stat(const char *path, struct stat *buf);
178#endif /* NO_NSPR_10_SUPPORT */
179
180PR_END_EXTERN_C
181
182#endif /* defined(PROBSLET_H) */
183
184/* probslet.h */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette