r25554: Convert last instances of BOOL, True and False to the standard types.
[jelmer/samba4-debian.git] / source / libcli / wrepl / winsrepl.c
index bf0be9fb9ba0b82c4b6e1f63d6ceb150f8a2e702..90714f774b40bcbce9cd12b81b209c98703d29a1 100644 (file)
@@ -7,7 +7,7 @@
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
    
    This program is distributed in the hope that it will be useful,
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "includes.h"
 #include "lib/events/events.h"
-#include "dlinklist.h"
+#include "lib/util/dlinklist.h"
 #include "lib/socket/socket.h"
 #include "libcli/wrepl/winsrepl.h"
 #include "librpc/gen_ndr/ndr_winsrepl.h"
@@ -38,7 +37,7 @@ static struct wrepl_request *wrepl_request_finished(struct wrepl_request *req, N
 */
 static void wrepl_socket_dead(struct wrepl_socket *wrepl_socket, NTSTATUS status)
 {
-       wrepl_socket->dead = True;
+       wrepl_socket->dead = true;
 
        if (wrepl_socket->packet) {
                packet_recv_disable(wrepl_socket->packet);
@@ -88,7 +87,8 @@ static NTSTATUS wrepl_finish_recv(void *private, DATA_BLOB packet_blob_in)
        DATA_BLOB blob;
 
        if (!req) {
-               DEBUG(1,("Received unexpected WINS packet of length %u!\n", packet_blob_in.length));
+               DEBUG(1,("Received unexpected WINS packet of length %u!\n", 
+                        (unsigned)packet_blob_in.length));
                return NT_STATUS_INVALID_NETWORK_RESPONSE;
        }
 
@@ -108,7 +108,8 @@ static NTSTATUS wrepl_finish_recv(void *private, DATA_BLOB packet_blob_in)
        }
 
        if (DEBUGLVL(10)) {
-               DEBUG(10,("Received WINS packet of length %u\n", packet_blob_in.length));
+               DEBUG(10,("Received WINS packet of length %u\n", 
+                         (unsigned)packet_blob_in.length));
                NDR_PRINT_DEBUG(wrepl_packet, req->packet);
        }
 
@@ -147,7 +148,7 @@ static void wrepl_error(void *private, NTSTATUS status)
 static int wrepl_socket_destructor(struct wrepl_socket *sock)
 {
        if (sock->dead) {
-               sock->free_skipped = True;
+               sock->free_skipped = true;
                return -1;
        }
        wrepl_socket_dead(sock, NT_STATUS_LOCAL_DISCONNECT);
@@ -386,7 +387,7 @@ static void wrepl_request_trigger_handler(struct event_context *ev, struct timed
 /*
   trigger an immediate event on a wrepl_request
   the return value should only be used in wrepl_request_send()
-  this is the only place where req->trigger is True
+  this is the only place where req->trigger is true
 */
 static struct wrepl_request *wrepl_request_finished(struct wrepl_request *req, NTSTATUS status)
 {
@@ -405,7 +406,7 @@ static struct wrepl_request *wrepl_request_finished(struct wrepl_request *req, N
        req->status     = status;
 
        if (req->trigger) {
-               req->trigger = False;
+               req->trigger = false;
                /* a zero timeout means immediate */
                te = event_add_timed(req->wrepl_socket->event.ctx,
                                     req, timeval_zero(),
@@ -447,7 +448,7 @@ static int wrepl_send_ctrl_destructor(struct wrepl_send_ctrl_state *s)
        /* here, we need to make sure the async request handler is called
         * later in the next event_loop and now now
         */
-       req->trigger = True;
+       req->trigger = true;
        wrepl_request_finished(req, NT_STATUS_OK);
 
        if (s->ctrl.disconnect_after_send) {
@@ -472,7 +473,7 @@ struct wrepl_request *wrepl_request_send(struct wrepl_socket *wrepl_socket,
        if (!req) return NULL;
        req->wrepl_socket = wrepl_socket;
        req->state        = WREPL_REQUEST_RECV;
-       req->trigger      = True;
+       req->trigger      = true;
 
        DLIST_ADD_END(wrepl_socket->recv_queue, req, struct wrepl_request *);
        talloc_set_destructor(req, wrepl_request_destructor);
@@ -489,7 +490,8 @@ struct wrepl_request *wrepl_request_send(struct wrepl_socket *wrepl_socket,
        }
 
        if (DEBUGLVL(10)) {
-               DEBUG(10,("Sending WINS packet of length %u\n", blob.length));
+               DEBUG(10,("Sending WINS packet of length %u\n", 
+                         (unsigned)blob.length));
                NDR_PRINT_DEBUG(wrepl_packet, &wrap.packet);
        }
 
@@ -514,7 +516,7 @@ struct wrepl_request *wrepl_request_send(struct wrepl_socket *wrepl_socket,
                return wrepl_request_finished(req, req->status);
        }
 
-       req->trigger = False;
+       req->trigger = false;
        return req;
 }
 
@@ -636,8 +638,8 @@ struct wrepl_request *wrepl_associate_stop_send(struct wrepl_socket *wrepl_socke
 
        ZERO_STRUCT(ctrl);
        if (io->in.reason == 0) {
-               ctrl.send_only                  = True;
-               ctrl.disconnect_after_send      = True;
+               ctrl.send_only                  = true;
+               ctrl.disconnect_after_send      = true;
        }
 
        req = wrepl_request_send(wrepl_socket, packet, &ctrl);