00001 #ifndef PROTON_SELECTOR_H 00002 #define PROTON_SELECTOR_H 1 00003 00004 /* 00005 * 00006 * Licensed to the Apache Software Foundation (ASF) under one 00007 * or more contributor license agreements. See the NOTICE file 00008 * distributed with this work for additional information 00009 * regarding copyright ownership. The ASF licenses this file 00010 * to you under the Apache License, Version 2.0 (the 00011 * "License"); you may not use this file except in compliance 00012 * with the License. You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, 00017 * software distributed under the License is distributed on an 00018 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00019 * KIND, either express or implied. See the License for the 00020 * specific language governing permissions and limitations 00021 * under the License. 00022 * 00023 */ 00024 00025 #include <proton/import_export.h> 00026 #include <proton/selectable.h> 00027 #include <proton/type_compat.h> 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 #define PN_READABLE (1) 00034 #define PN_WRITABLE (2) 00035 #define PN_EXPIRED (4) 00036 #define PN_ERROR (8) 00037 00038 pn_selector_t *pni_selector(void); 00039 PN_EXTERN void pn_selector_free(pn_selector_t *selector); 00040 PN_EXTERN void pn_selector_add(pn_selector_t *selector, pn_selectable_t *selectable); 00041 PN_EXTERN void pn_selector_update(pn_selector_t *selector, pn_selectable_t *selectable); 00042 PN_EXTERN void pn_selector_remove(pn_selector_t *selector, pn_selectable_t *selectable); 00043 PN_EXTERN size_t pn_selector_size(pn_selector_t *selector); 00044 PN_EXTERN int pn_selector_select(pn_selector_t *select, int timeout); 00045 PN_EXTERN pn_selectable_t *pn_selector_next(pn_selector_t *select, int *events); 00046 00047 #ifdef __cplusplus 00048 } 00049 #endif 00050 00051 #endif /* selector.h */