Makefile: Added new codepage - 866.
authorJeremy Allison <jra@samba.org>
Fri, 16 Jan 1998 06:29:38 +0000 (06:29 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 16 Jan 1998 06:29:38 +0000 (06:29 +0000)
charset.c: Supporting code for codepage 866.
clientutil.c: Fix compile bug in little-used #define.
includes.h: Supporting code for codepage 866.
make_smbcodepage.c: Supporting code for codepage 866.
pcap.c: Fix bug for lpstat.
Jeremy.

source/client/clientutil.c
source/include/includes.h
source/lib/charset.c
source/printing/pcap.c
source/utils/make_smbcodepage.c

index 7c145bf59eeaff704b891942890972e75d3fa3dc..e3786d602970a981275ed97c8bbad8a689d50b83 100644 (file)
@@ -908,7 +908,7 @@ BOOL cli_open_sockets(int port )
                                    interpret_addr(lp_socket_address()))) != -1) {
          set_socket_options(bcast, "SO_BROADCAST");
 
-         if ((ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
+         if (ip_list = name_query(bcast, host, name_type, True, True, *iface_bcast(dest_ip),
                                    &count,0)) {
                  dest_ip = ip_list[0];
                  free(ip_list);
index 3dbe6780a58b8675f774e36c4f7b20d174aa2118..2d2ff63f8882c83359e17ecb2996dbee699cca1a 100644 (file)
@@ -1168,6 +1168,10 @@ extern char *sys_errlist[];
 #include "kanji.h"
 #include "charset.h"
 
+#ifndef MAXCODEPAGELINES
+#define MAXCODEPAGELINES 256
+#endif
+
 /***** automatically generated prototypes *****/
 #include "proto.h"
 
index e29e60303aa6093c9316ffe334dab3c2801a6918..95b3d01627e8a73255d81e79ada1fc2505ac4346 100644 (file)
@@ -216,11 +216,11 @@ static codepage_p load_client_codepage( int client_codepage )
   /* Check if it is at least big enough to hold the required
      data. Should be 2 byte version, 2 byte codepage, 4 byte length, 
      plus zero or more bytes of data. Note that the data cannot be more
-     than 512 bytes - giving a max size of 520.
+     than 4 * MAXCODEPAGELINES bytes.
    */
   size = (unsigned int)st.st_size;
 
-  if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 256))
+  if( size < CODEPAGE_HEADER_SIZE || size > (CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES))
   {
     DEBUG(0,("load_client_codepage: file %s is an incorrect size for a \
 code page file.\n", codepage_file_name));
@@ -323,10 +323,9 @@ initialise the client codepage.
 void codepage_initialise(int client_codepage)
 {
   int i;
-  codepage_p cp = NULL;
-  static BOOL done = False;
+  static codepage_p cp = NULL;
 
-  if(done == True) 
+  if(cp != NULL)
   {
     DEBUG(6,
       ("codepage_initialise: called twice - ignoring second client code page = %d\n",
@@ -361,8 +360,6 @@ for code page %d failed. Using default client codepage 850\n",
     for(i = 0; !((cp[i][0] == '\0') && (cp[i][1] == '\0')); i++)
       add_dos_char(cp[i][0], (BOOL)cp[i][2], cp[i][1], (BOOL)cp[i][3]);
   }
-
-  done = True;
 }
 
 /*******************************************************************
index ff0a2b54772e47d25679f25e26a36d1caeafd893..bff81b8661dd3a39b54270fd17626046423cabe4 100644 (file)
@@ -267,7 +267,7 @@ BOOL pcap_printername_ok(char *pszPrintername, char *pszPrintcapname)
 #endif
 
 #ifdef AIX
-  if (strlocate(psz,"/qconfig") != NULL)
+  if (strlocate(psz,"/qconfig"))
      return(ScanQconfig(psz,pszPrintername));
 #endif
 
@@ -336,7 +336,7 @@ void pcap_printer_fn(void (*fn)())
 #endif
 
 #ifdef AIX
-  if (strlocate(psz,"/qconfig") != NULL)
+  if (strlocate(psz,"/qconfig"))
   {
        ScanQconfig_fn(psz,fn);
      return;
index b4cb15233499d3f133931e77422e9648028e17c1..06bc694e2081821f45731c7f3a200c26473cfaad 100644 (file)
@@ -167,7 +167,7 @@ int do_compile(int codepage, char *input_file, char *output_file)
   FILE *fp = NULL;
   uint32 size = 0;
   char *buf = NULL;
-  char output_buf[CODEPAGE_HEADER_SIZE + 512];
+  char output_buf[CODEPAGE_HEADER_SIZE + 4 * MAXCODEPAGELINES];
   int num_lines = 0;
   int i = 0;
   struct stat st;
@@ -223,11 +223,11 @@ The maximum size I will believe is 100k.\n", prog_name, size);
 
   num_lines = clean_data( &buf, &size);
 
-  /* There can be a maximum of 128 lines. */
-  if(num_lines > 128)
+  /* There can be a maximum of MAXCODEPAGELINES lines. */
+  if(num_lines > MAXCODEPAGELINES)
   {
-    fprintf(stderr, "%s: There can be a maximum 128 lines of data in a codepage \
-definition file. File %s has %d.\n", prog_name, input_file, num_lines);
+    fprintf(stderr, "%s: There can be a maximum %d lines of data in a codepage \
+definition file. File %s has %d.\n", prog_name, MAXCODEPAGELINES, input_file, num_lines);
     exit(1);
   }