Index: pjproject/trunk/pjlib/build/pjlib++.dsp
===================================================================
--- pjproject/trunk/pjlib/build/pjlib++.dsp	(revision 121)
+++ pjproject/trunk/pjlib/build/pjlib++.dsp	(revision 122)
@@ -108,4 +108,8 @@
 # Begin Source File
 
+SOURCE="..\include\pjlib++.hpp"
+# End Source File
+# Begin Source File
+
 SOURCE="..\include\pj++\pool.hpp"
 # End Source File
Index: pjproject/trunk/pjlib/include/pj++/file.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/file.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/file.hpp	(revision 122)
@@ -84,7 +84,7 @@
     enum Offset_Type
     {
-        SEEK_SET = PJ_SEEK_SET,
-        SEEK_CUR = PJ_SEEK_CUR,
-        SEEK_END = PJ_SEEK_END,
+        PJ_SEEK_SET = PJ_SEEK_SET,
+        PJ_SEEK_CUR = PJ_SEEK_CUR,
+        PJ_SEEK_END = PJ_SEEK_END,
     };
 
Index: pjproject/trunk/pjlib/include/pj++/os.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/os.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/os.hpp	(revision 122)
@@ -21,4 +21,5 @@
 
 #include <pj/os.h>
+#include <pj/string.h>
 #include <pj++/types.hpp>
 #include <pj++/pool.hpp>
@@ -152,5 +153,5 @@
         destroy();
         return Pj_Thread_API::create( pool, &thread_, &thread_proc, this,
-                                      flags, thread_name);
+                                      flags, thread_name, stack_size);
     }
 
@@ -532,4 +533,5 @@
     : sem_(NULL)
     {
+	create(pool, max, initial, name);
     }
 
@@ -723,4 +725,67 @@
 
 //
+// Timestamp
+//
+class Pj_Timestamp
+{
+public:
+    pj_status_t get_timestamp()
+    {
+	return pj_get_timestamp(&ts_);
+    }
+
+    Pj_Timestamp& operator += (const Pj_Timestamp &rhs)
+    {
+	pj_add_timestamp(&ts_, &rhs.ts_);
+	return *this;
+    }
+
+    Pj_Timestamp& operator -= (const Pj_Timestamp &rhs)
+    {
+	pj_sub_timestamp(&ts_, &rhs.ts_);
+	return *this;
+    }
+
+    Pj_Time_Val to_time() const
+    {
+	Pj_Timestamp zero;
+	pj_memset(&zero, 0, sizeof(zero));
+	return Pj_Time_Val(pj_elapsed_time(&zero.ts_, &ts_));
+    }
+
+    pj_uint32_t to_msec() const
+    {
+	Pj_Timestamp zero;
+	pj_memset(&zero, 0, sizeof(zero));
+	return pj_elapsed_msec(&zero.ts_, &ts_);
+    }
+
+    pj_uint32_t to_usec() const
+    {
+	Pj_Timestamp zero;
+	pj_memset(&zero, 0, sizeof(zero));
+	return pj_elapsed_usec(&zero.ts_, &ts_);
+    }
+
+    pj_uint32_t to_nanosec() const
+    {
+	Pj_Timestamp zero;
+	pj_memset(&zero, 0, sizeof(zero));
+	return pj_elapsed_nanosec(&zero.ts_, &ts_);
+    }
+
+    pj_uint32_t to_cycle() const
+    {
+	Pj_Timestamp zero;
+	pj_memset(&zero, 0, sizeof(zero));
+	return pj_elapsed_cycle(&zero.ts_, &ts_);
+    }
+
+private:
+    pj_timestamp    ts_;
+};
+
+
+//
 // OS abstraction.
 //
Index: pjproject/trunk/pjlib/include/pj++/proactor.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/proactor.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/proactor.hpp	(revision 122)
@@ -207,5 +207,5 @@
     // Timeout callback.
     //
-    virtual void on_timeout(int data) 
+    virtual void on_timeout(int) 
     {
     }
@@ -214,6 +214,5 @@
     // On read complete callback.
     //
-    virtual void on_read_complete( Pj_Async_Op *op_key,
-                                   pj_ssize_t bytes_read) 
+    virtual void on_read_complete( Pj_Async_Op*, pj_ssize_t) 
     {
     }
@@ -222,6 +221,5 @@
     // On write complete callback.
     //
-    virtual void on_write_complete( Pj_Async_Op *op_key, 
-                                    pj_ssize_t bytes_sent) 
+    virtual void on_write_complete( Pj_Async_Op *, pj_ssize_t) 
     {
     }
@@ -231,5 +229,5 @@
     // On connect complete callback.
     //
-    virtual void on_connect_complete(pj_status_t status) 
+    virtual void on_connect_complete(pj_status_t) 
     {
     }
@@ -238,7 +236,5 @@
     // On new connection callback.
     //
-    virtual void on_accept_complete( Pj_Async_Op *op_key,
-                                     pj_sock_t new_sock,
-                                     pj_status_t status) 
+    virtual void on_accept_complete( Pj_Async_Op*, pj_sock_t, pj_status_t) 
     {
     }
@@ -257,5 +253,5 @@
     // Static timer callback.
     //
-    static void timer_callback( pj_timer_heap_t *timer_heap, 
+    static void timer_callback( pj_timer_heap_t*, 
                                 struct pj_timer_entry *entry)
     {
Index: pjproject/trunk/pjlib/include/pj++/scanner.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/scanner.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/scanner.hpp	(revision 122)
@@ -23,32 +23,88 @@
 #include <pj++/string.hpp>
 
-class Pj_Char_Spec
+class Pj_Cis;
+class Pj_Cis_Buffer;
+class Pj_Scanner;
+
+class Pj_Cis_Buffer
 {
+    friend class Pj_Cis;
+
 public:
-    Pj_Char_Spec() { pj_cs_init(cs__); }
-
-    void set(int c) { pj_cs_set(cs__, c); }
-    void add_range(int begin, int end) { pj_cs_add_range(cs__, begin, end); }
-    void add_alpha() { pj_cs_add_alpha(cs__); }
-    void add_num() { pj_cs_add_num(cs__); }
-    void add_str(const char *str) { pj_cs_add_str(cs__, str); }
-    void del_range(int begin, int end) { pj_cs_del_range(cs__, begin, end); }
-    void del_str(const char *str) { pj_cs_del_str(cs__, str); }
-    void invert() { pj_cs_invert(cs__); }
-    int  match(int c) { return pj_cs_match(cs__, c); }
-
-    pj_char_spec_element_t *cs_()
-    {
-	return cs__;
-    }
-
-    const pj_char_spec_element_t *cs_() const
-    {
-	return cs__;
+    Pj_Cis_Buffer() 
+    { 
+	pj_cis_buf_init(&buf_); 
     }
 
 private:
-    pj_char_spec cs__;
+    pj_cis_buf_t buf_;
 };
+
+
+class Pj_Cis
+{
+    friend class Pj_Scanner;
+
+public:
+    Pj_Cis(Pj_Cis_Buffer *buf)
+    {
+	pj_cis_init(&buf->buf_, &cis_);
+    }
+
+    Pj_Cis(const Pj_Cis &rhs)
+    {
+	pj_cis_dup(&cis_, (pj_cis_t*)&rhs.cis_);
+    }
+
+    void add_range(int start, int end)
+    {
+	pj_cis_add_range(&cis_, start, end);
+    }
+
+    void add_alpha()
+    {
+	pj_cis_add_alpha(&cis_);
+    }
+
+    void add_num()
+    {
+	pj_cis_add_num(&cis_);
+    }
+
+    void add_str(const char *str)
+    {
+	pj_cis_add_str(&cis_, str);
+    }
+
+    void add_cis(const Pj_Cis &rhs)
+    {
+	pj_cis_add_cis(&cis_, &rhs.cis_);
+    }
+
+    void del_range(int start, int end)
+    {
+	pj_cis_del_range(&cis_, start, end);
+    }
+
+    void del_str(const char *str)
+    {
+	pj_cis_del_str(&cis_, str);
+    }
+
+    void invert()
+    {
+	pj_cis_invert(&cis_);
+    }
+
+    bool match(int c) const
+    {
+	return pj_cis_match(&cis_, c) != 0;
+    }
+
+private:
+    pj_cis_t cis_;
+};
+
+
 
 class Pj_Scanner
@@ -86,7 +142,7 @@
     }
 
-    int peek(const Pj_Char_Spec *cs, Pj_String *out)
-    {
-	return pj_scan_peek(&scanner_,  cs->cs_(), out);
+    int peek(const Pj_Cis *cis, Pj_String *out)
+    {
+	return pj_scan_peek(&scanner_,  &cis->cis_, out);
     }
 
@@ -96,12 +152,12 @@
     }
 
-    int peek_until(const Pj_Char_Spec *cs, Pj_String *out)
-    {
-	return pj_scan_peek_until(&scanner_, cs->cs_(), out);
-    }
-
-    void get(const Pj_Char_Spec *cs, Pj_String *out)
-    {
-	pj_scan_get(&scanner_, cs->cs_(), out);
+    int peek_until(const Pj_Cis *cis, Pj_String *out)
+    {
+	return pj_scan_peek_until(&scanner_, &cis->cis_, out);
+    }
+
+    void get(const Pj_Cis *cis, Pj_String *out)
+    {
+	pj_scan_get(&scanner_, &cis->cis_, out);
     }
 
@@ -126,7 +182,7 @@
     }
 
-    void get_until(const Pj_Char_Spec *cs, Pj_String *out)
-    {
-	pj_scan_get_until(&scanner_, cs->cs_(), out);
+    void get_until(const Pj_Cis *cis, Pj_String *out)
+    {
+	pj_scan_get_until(&scanner_, &cis->cis_, out);
     }
 
@@ -161,5 +217,5 @@
     }
 
-    void save_state(State *state)
+    void save_state(State *state) const
     {
 	pj_scan_save_state(&scanner_, state);
@@ -178,5 +234,5 @@
     int get_pos_col() const
     {
-	return scanner_.col;
+	return pj_scan_get_col(&scanner_);
     }
 
Index: pjproject/trunk/pjlib/include/pj++/sock.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/sock.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/sock.hpp	(revision 122)
@@ -236,5 +236,5 @@
     // getsockopt.
     //
-    pj_status_t getsockopt(int level, int optname, 
+    pj_status_t getsockopt(pj_uint16_t level, pj_uint16_t optname, 
                            void *optval, int *optlen)
     {
@@ -245,5 +245,5 @@
     // setsockopt
     // 
-    pj_status_t setsockopt(int level, int optname, 
+    pj_status_t setsockopt(pj_uint16_t level, pj_uint16_t optname, 
                            const void *optval, int optlen)
     {
Index: pjproject/trunk/pjlib/include/pj++/string.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/string.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/string.hpp	(revision 122)
@@ -345,4 +345,22 @@
 
     //
+    // Assign from char*
+    //
+    Pj_String& operator=(char *s)
+    {
+	set(s);
+	return *this;
+    }
+
+    ///
+    // Assign from another Pj_String
+    //
+    Pj_String& operator=(Pj_String &rhs)
+    {
+	set(rhs);
+	return *this;
+    }
+
+    //
     // Find a character in the string.
     //
@@ -416,8 +434,4 @@
     }
 
-
-private:
-    //Pj_String(const Pj_String &rhs) {}
-    void operator=(const Pj_String &rhs) { pj_assert(false); }
 };
 
Index: pjproject/trunk/pjlib/include/pj++/timer.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pj++/timer.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pj++/timer.hpp	(revision 122)
@@ -63,5 +63,5 @@
     pj_timer_entry entry_;
 
-    static void timer_heap_callback(pj_timer_heap_t *th, pj_timer_entry *e)
+    static void timer_heap_callback(pj_timer_heap_t*, pj_timer_entry *e)
     {
         Pj_Timer_Entry *entry = (Pj_Timer_Entry*) e->user_data;
Index: pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 121)
+++ pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 122)
@@ -45,4 +45,6 @@
 typedef unsigned long long pj_uint64_t;
 
+#define PJ_INT64_FMT		"L"
+
 
 #endif	/* __PJ_COMPAT_CC_GCC_H__ */
Index: pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h	(revision 121)
+++ pjproject/trunk/pjlib/include/pj/compat/cc_msvc.h	(revision 122)
@@ -58,3 +58,6 @@
 typedef unsigned __int64 pj_uint64_t;
 
+#define PJ_INT64_FMT	"I64"
+
+
 #endif	/* __PJ_COMPAT_CC_MSVC_H__ */
Index: pjproject/trunk/pjlib/include/pj/sock.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/sock.h	(revision 121)
+++ pjproject/trunk/pjlib/include/pj/sock.h	(revision 122)
@@ -664,5 +664,5 @@
  * @param tolen		The length of the address in bytes.
  *
- * @return		The length of data successfully sent.
+ * @return		PJ_SUCCESS or the status code.
  */
 PJ_DECL(pj_status_t) pj_sock_sendto(pj_sock_t sockfd,
Index: pjproject/trunk/pjlib/include/pjlib++.hpp
===================================================================
--- pjproject/trunk/pjlib/include/pjlib++.hpp	(revision 121)
+++ pjproject/trunk/pjlib/include/pjlib++.hpp	(revision 122)
@@ -20,4 +20,5 @@
 #define __PJLIBPP_H__
 
+#include <pj++/file.hpp>
 #include <pj++/pool.hpp>
 #include <pj++/hash.hpp>
