r25554: Convert last instances of BOOL, True and False to the standard types.
[jelmer/samba4-debian.git] / source / libcli / climessage.c
index ad5d41545b60ccc8a4c0120fbf9a09c1c92aad75..6002ccfc5923f88d22609d2fa3c55ea75ecc8e11 100644 (file)
@@ -6,7 +6,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 "libcli/raw/libcliraw.h"
+#include "libcli/libcli.h"
 
 
 /****************************************************************************
 start a message sequence
 ****************************************************************************/
-BOOL cli_message_start(struct cli_state *cli, char *host, char *username, 
-                             int *grp)
+bool smbcli_message_start(struct smbcli_tree *tree, const char *host, const char *username, 
+                      int *grp)
 {
-       struct cli_request *req; 
+       struct smbcli_request *req; 
        
-       req = cli_request_setup(cli->tree, SMBsendstrt, 0, 0);
-       cli_req_append_string(req, username, STR_TERMINATE);
-       cli_req_append_string(req, host, STR_TERMINATE);
-       if (!cli_request_send(req) || 
-           !cli_request_receive(req) ||
-           cli_is_error(cli)) {
-               cli_request_destroy(req);
-               return False;
+       req = smbcli_request_setup(tree, SMBsendstrt, 0, 0);
+       smbcli_req_append_string(req, username, STR_TERMINATE);
+       smbcli_req_append_string(req, host, STR_TERMINATE);
+       if (!smbcli_request_send(req) || 
+           !smbcli_request_receive(req) ||
+           smbcli_is_error(tree)) {
+               smbcli_request_destroy(req);
+               return false;
        }
 
        *grp = SVAL(req->in.vwv, VWV(0));
-       cli_request_destroy(req);
+       smbcli_request_destroy(req);
 
-       return True;
+       return true;
 }
 
 
 /****************************************************************************
 send a message 
 ****************************************************************************/
-BOOL cli_message_text(struct cli_state *cli, char *msg, int len, int grp)
+bool smbcli_message_text(struct smbcli_tree *tree, char *msg, int len, int grp)
 {
-       struct cli_request *req; 
+       struct smbcli_request *req; 
        
-       req = cli_request_setup(cli->tree, SMBsendtxt, 1, 0);
+       req = smbcli_request_setup(tree, SMBsendtxt, 1, 0);
        SSVAL(req->out.vwv, VWV(0), grp);
 
-       cli_req_append_bytes(req, msg, len);
+       smbcli_req_append_bytes(req, (const uint8_t *)msg, len);
 
-       if (!cli_request_send(req) || 
-           !cli_request_receive(req) ||
-           cli_is_error(cli)) {
-               cli_request_destroy(req);
-               return False;
+       if (!smbcli_request_send(req) || 
+           !smbcli_request_receive(req) ||
+           smbcli_is_error(tree)) {
+               smbcli_request_destroy(req);
+               return false;
        }
 
-       cli_request_destroy(req);
-       return True;
+       smbcli_request_destroy(req);
+       return true;
 }      
 
 /****************************************************************************
 end a message 
 ****************************************************************************/
-BOOL cli_message_end(struct cli_state *cli, int grp)
+bool smbcli_message_end(struct smbcli_tree *tree, int grp)
 {
-       struct cli_request *req; 
+       struct smbcli_request *req; 
        
-       req = cli_request_setup(cli->tree, SMBsendend, 1, 0);
+       req = smbcli_request_setup(tree, SMBsendend, 1, 0);
        SSVAL(req->out.vwv, VWV(0), grp);
 
-       if (!cli_request_send(req) || 
-           !cli_request_receive(req) ||
-           cli_is_error(cli)) {
-               cli_request_destroy(req);
-               return False;
+       if (!smbcli_request_send(req) || 
+           !smbcli_request_receive(req) ||
+           smbcli_is_error(tree)) {
+               smbcli_request_destroy(req);
+               return false;
        }
 
-       cli_request_destroy(req);
-       return True;
+       smbcli_request_destroy(req);
+       return true;
 }