Changeset 122
- Timestamp:
- Jan 18, 2006 11:32:27 PM (19 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/build/pjlib++.dsp
r65 r122 108 108 # Begin Source File 109 109 110 SOURCE="..\include\pjlib++.hpp" 111 # End Source File 112 # Begin Source File 113 110 114 SOURCE="..\include\pj++\pool.hpp" 111 115 # End Source File -
pjproject/trunk/pjlib/include/pj++/file.hpp
r65 r122 84 84 enum Offset_Type 85 85 { 86 SEEK_SET = PJ_SEEK_SET,87 SEEK_CUR = PJ_SEEK_CUR,88 SEEK_END = PJ_SEEK_END,86 PJ_SEEK_SET = PJ_SEEK_SET, 87 PJ_SEEK_CUR = PJ_SEEK_CUR, 88 PJ_SEEK_END = PJ_SEEK_END, 89 89 }; 90 90 -
pjproject/trunk/pjlib/include/pj++/os.hpp
r65 r122 21 21 22 22 #include <pj/os.h> 23 #include <pj/string.h> 23 24 #include <pj++/types.hpp> 24 25 #include <pj++/pool.hpp> … … 152 153 destroy(); 153 154 return Pj_Thread_API::create( pool, &thread_, &thread_proc, this, 154 flags, thread_name );155 flags, thread_name, stack_size); 155 156 } 156 157 … … 532 533 : sem_(NULL) 533 534 { 535 create(pool, max, initial, name); 534 536 } 535 537 … … 723 725 724 726 // 727 // Timestamp 728 // 729 class Pj_Timestamp 730 { 731 public: 732 pj_status_t get_timestamp() 733 { 734 return pj_get_timestamp(&ts_); 735 } 736 737 Pj_Timestamp& operator += (const Pj_Timestamp &rhs) 738 { 739 pj_add_timestamp(&ts_, &rhs.ts_); 740 return *this; 741 } 742 743 Pj_Timestamp& operator -= (const Pj_Timestamp &rhs) 744 { 745 pj_sub_timestamp(&ts_, &rhs.ts_); 746 return *this; 747 } 748 749 Pj_Time_Val to_time() const 750 { 751 Pj_Timestamp zero; 752 pj_memset(&zero, 0, sizeof(zero)); 753 return Pj_Time_Val(pj_elapsed_time(&zero.ts_, &ts_)); 754 } 755 756 pj_uint32_t to_msec() const 757 { 758 Pj_Timestamp zero; 759 pj_memset(&zero, 0, sizeof(zero)); 760 return pj_elapsed_msec(&zero.ts_, &ts_); 761 } 762 763 pj_uint32_t to_usec() const 764 { 765 Pj_Timestamp zero; 766 pj_memset(&zero, 0, sizeof(zero)); 767 return pj_elapsed_usec(&zero.ts_, &ts_); 768 } 769 770 pj_uint32_t to_nanosec() const 771 { 772 Pj_Timestamp zero; 773 pj_memset(&zero, 0, sizeof(zero)); 774 return pj_elapsed_nanosec(&zero.ts_, &ts_); 775 } 776 777 pj_uint32_t to_cycle() const 778 { 779 Pj_Timestamp zero; 780 pj_memset(&zero, 0, sizeof(zero)); 781 return pj_elapsed_cycle(&zero.ts_, &ts_); 782 } 783 784 private: 785 pj_timestamp ts_; 786 }; 787 788 789 // 725 790 // OS abstraction. 726 791 // -
pjproject/trunk/pjlib/include/pj++/proactor.hpp
r65 r122 207 207 // Timeout callback. 208 208 // 209 virtual void on_timeout(int data)209 virtual void on_timeout(int) 210 210 { 211 211 } … … 214 214 // On read complete callback. 215 215 // 216 virtual void on_read_complete( Pj_Async_Op *op_key, 217 pj_ssize_t bytes_read) 216 virtual void on_read_complete( Pj_Async_Op*, pj_ssize_t) 218 217 { 219 218 } … … 222 221 // On write complete callback. 223 222 // 224 virtual void on_write_complete( Pj_Async_Op *op_key, 225 pj_ssize_t bytes_sent) 223 virtual void on_write_complete( Pj_Async_Op *, pj_ssize_t) 226 224 { 227 225 } … … 231 229 // On connect complete callback. 232 230 // 233 virtual void on_connect_complete(pj_status_t status)231 virtual void on_connect_complete(pj_status_t) 234 232 { 235 233 } … … 238 236 // On new connection callback. 239 237 // 240 virtual void on_accept_complete( Pj_Async_Op *op_key, 241 pj_sock_t new_sock, 242 pj_status_t status) 238 virtual void on_accept_complete( Pj_Async_Op*, pj_sock_t, pj_status_t) 243 239 { 244 240 } … … 257 253 // Static timer callback. 258 254 // 259 static void timer_callback( pj_timer_heap_t *timer_heap,255 static void timer_callback( pj_timer_heap_t*, 260 256 struct pj_timer_entry *entry) 261 257 { -
pjproject/trunk/pjlib/include/pj++/scanner.hpp
r65 r122 23 23 #include <pj++/string.hpp> 24 24 25 class Pj_Char_Spec 25 class Pj_Cis; 26 class Pj_Cis_Buffer; 27 class Pj_Scanner; 28 29 class Pj_Cis_Buffer 26 30 { 31 friend class Pj_Cis; 32 27 33 public: 28 Pj_Char_Spec() { pj_cs_init(cs__); } 29 30 void set(int c) { pj_cs_set(cs__, c); } 31 void add_range(int begin, int end) { pj_cs_add_range(cs__, begin, end); } 32 void add_alpha() { pj_cs_add_alpha(cs__); } 33 void add_num() { pj_cs_add_num(cs__); } 34 void add_str(const char *str) { pj_cs_add_str(cs__, str); } 35 void del_range(int begin, int end) { pj_cs_del_range(cs__, begin, end); } 36 void del_str(const char *str) { pj_cs_del_str(cs__, str); } 37 void invert() { pj_cs_invert(cs__); } 38 int match(int c) { return pj_cs_match(cs__, c); } 39 40 pj_char_spec_element_t *cs_() 41 { 42 return cs__; 43 } 44 45 const pj_char_spec_element_t *cs_() const 46 { 47 return cs__; 34 Pj_Cis_Buffer() 35 { 36 pj_cis_buf_init(&buf_); 48 37 } 49 38 50 39 private: 51 pj_c har_spec cs__;40 pj_cis_buf_t buf_; 52 41 }; 42 43 44 class Pj_Cis 45 { 46 friend class Pj_Scanner; 47 48 public: 49 Pj_Cis(Pj_Cis_Buffer *buf) 50 { 51 pj_cis_init(&buf->buf_, &cis_); 52 } 53 54 Pj_Cis(const Pj_Cis &rhs) 55 { 56 pj_cis_dup(&cis_, (pj_cis_t*)&rhs.cis_); 57 } 58 59 void add_range(int start, int end) 60 { 61 pj_cis_add_range(&cis_, start, end); 62 } 63 64 void add_alpha() 65 { 66 pj_cis_add_alpha(&cis_); 67 } 68 69 void add_num() 70 { 71 pj_cis_add_num(&cis_); 72 } 73 74 void add_str(const char *str) 75 { 76 pj_cis_add_str(&cis_, str); 77 } 78 79 void add_cis(const Pj_Cis &rhs) 80 { 81 pj_cis_add_cis(&cis_, &rhs.cis_); 82 } 83 84 void del_range(int start, int end) 85 { 86 pj_cis_del_range(&cis_, start, end); 87 } 88 89 void del_str(const char *str) 90 { 91 pj_cis_del_str(&cis_, str); 92 } 93 94 void invert() 95 { 96 pj_cis_invert(&cis_); 97 } 98 99 bool match(int c) const 100 { 101 return pj_cis_match(&cis_, c) != 0; 102 } 103 104 private: 105 pj_cis_t cis_; 106 }; 107 108 53 109 54 110 class Pj_Scanner … … 86 142 } 87 143 88 int peek(const Pj_C har_Spec *cs, Pj_String *out)89 { 90 return pj_scan_peek(&scanner_, cs->cs_(), out);144 int peek(const Pj_Cis *cis, Pj_String *out) 145 { 146 return pj_scan_peek(&scanner_, &cis->cis_, out); 91 147 } 92 148 … … 96 152 } 97 153 98 int peek_until(const Pj_C har_Spec *cs, Pj_String *out)99 { 100 return pj_scan_peek_until(&scanner_, cs->cs_(), out);101 } 102 103 void get(const Pj_C har_Spec *cs, Pj_String *out)104 { 105 pj_scan_get(&scanner_, cs->cs_(), out);154 int peek_until(const Pj_Cis *cis, Pj_String *out) 155 { 156 return pj_scan_peek_until(&scanner_, &cis->cis_, out); 157 } 158 159 void get(const Pj_Cis *cis, Pj_String *out) 160 { 161 pj_scan_get(&scanner_, &cis->cis_, out); 106 162 } 107 163 … … 126 182 } 127 183 128 void get_until(const Pj_C har_Spec *cs, Pj_String *out)129 { 130 pj_scan_get_until(&scanner_, cs->cs_(), out);184 void get_until(const Pj_Cis *cis, Pj_String *out) 185 { 186 pj_scan_get_until(&scanner_, &cis->cis_, out); 131 187 } 132 188 … … 161 217 } 162 218 163 void save_state(State *state) 219 void save_state(State *state) const 164 220 { 165 221 pj_scan_save_state(&scanner_, state); … … 178 234 int get_pos_col() const 179 235 { 180 return scanner_.col;236 return pj_scan_get_col(&scanner_); 181 237 } 182 238 -
pjproject/trunk/pjlib/include/pj++/sock.hpp
r65 r122 236 236 // getsockopt. 237 237 // 238 pj_status_t getsockopt( int level, int optname,238 pj_status_t getsockopt(pj_uint16_t level, pj_uint16_t optname, 239 239 void *optval, int *optlen) 240 240 { … … 245 245 // setsockopt 246 246 // 247 pj_status_t setsockopt( int level, int optname,247 pj_status_t setsockopt(pj_uint16_t level, pj_uint16_t optname, 248 248 const void *optval, int optlen) 249 249 { -
pjproject/trunk/pjlib/include/pj++/string.hpp
r65 r122 345 345 346 346 // 347 // Assign from char* 348 // 349 Pj_String& operator=(char *s) 350 { 351 set(s); 352 return *this; 353 } 354 355 /// 356 // Assign from another Pj_String 357 // 358 Pj_String& operator=(Pj_String &rhs) 359 { 360 set(rhs); 361 return *this; 362 } 363 364 // 347 365 // Find a character in the string. 348 366 // … … 416 434 } 417 435 418 419 private:420 //Pj_String(const Pj_String &rhs) {}421 void operator=(const Pj_String &rhs) { pj_assert(false); }422 436 }; 423 437 -
pjproject/trunk/pjlib/include/pj++/timer.hpp
r65 r122 63 63 pj_timer_entry entry_; 64 64 65 static void timer_heap_callback(pj_timer_heap_t *th, pj_timer_entry *e)65 static void timer_heap_callback(pj_timer_heap_t*, pj_timer_entry *e) 66 66 { 67 67 Pj_Timer_Entry *entry = (Pj_Timer_Entry*) e->user_data; -
pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h
r75 r122 45 45 typedef unsigned long long pj_uint64_t; 46 46 47 #define PJ_INT64_FMT "L" 48 47 49 48 50 #endif /* __PJ_COMPAT_CC_GCC_H__ */ -
pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h
r75 r122 58 58 typedef unsigned __int64 pj_uint64_t; 59 59 60 #define PJ_INT64_FMT "I64" 61 62 60 63 #endif /* __PJ_COMPAT_CC_MSVC_H__ */ -
pjproject/trunk/pjlib/include/pj/sock.h
r106 r122 664 664 * @param tolen The length of the address in bytes. 665 665 * 666 * @return The length of data successfully sent.666 * @return PJ_SUCCESS or the status code. 667 667 */ 668 668 PJ_DECL(pj_status_t) pj_sock_sendto(pj_sock_t sockfd, -
pjproject/trunk/pjlib/include/pjlib++.hpp
r66 r122 20 20 #define __PJLIBPP_H__ 21 21 22 #include <pj++/file.hpp> 22 23 #include <pj++/pool.hpp> 23 24 #include <pj++/hash.hpp>
Note: See TracChangeset
for help on using the changeset viewer.