diff options
Diffstat (limited to 'source/utils/make_printerdef.c')
-rw-r--r-- | source/utils/make_printerdef.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/source/utils/make_printerdef.c b/source/utils/make_printerdef.c index 35ecd7f3e9e..621dff5b103 100644 --- a/source/utils/make_printerdef.c +++ b/source/utils/make_printerdef.c @@ -1,5 +1,6 @@ /* - Unix SMB/CIFS implementation. + Unix SMB/Netbios implementation. + Version 1.9. Create printer definition files. Copyright (C) Jean-Francois.Micouleau@utc.fr, 10/26/97 - 1998 @@ -46,8 +47,8 @@ static char *myfgets(char *s, int n, FILE *stream) int i; fgets(s,n,stream); - while ((LString1 = strchr_m(s,'%')) != NULL) { - if (!(LString2 = strchr_m(LString1+1,'%'))) break; + while ((LString1 = strchr(s,'%')) != NULL) { + if (!(LString2 = strchr(LString1+1,'%'))) break; *LString2 = '\0'; pstrcpy(String,LString1+1); i = 0; @@ -55,7 +56,7 @@ static char *myfgets(char *s, int n, FILE *stream) if (strncmp(sbuffer[i],String,strlen(String))==0) { pstrcpy(String,sbuffer[i]); - if ((temp = strchr_m(String,'=')) != NULL) ++temp; + if ((temp = strchr(String,'=')) != NULL) ++temp; pstrcpy(String,temp); break; } @@ -153,8 +154,8 @@ static void lookup_strings(FILE *fichier) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { - SAFE_FREE(temp); - SAFE_FREE(temp2); + safe_free(temp); + safe_free(temp2); fprintf(stderr,"lookup_strings: malloc fail !\n"); exit(1); } @@ -217,8 +218,8 @@ static void lookup_entry(FILE *fichier,char *chaine) temp2=(char *)malloc(sizeof(pstring)); if(temp == NULL || temp2 == NULL) { - SAFE_FREE(temp); - SAFE_FREE(temp2); + safe_free(temp); + safe_free(temp2); fprintf(stderr,"lookup_entry: malloc fail !\n"); exit(1); } @@ -275,9 +276,9 @@ static char *find_desc(FILE *fichier,char *text) long_desc=(char *)malloc(sizeof(pstring)); short_desc=(char *)malloc(sizeof(pstring)); if (!chaine || !long_desc || !short_desc) { - SAFE_FREE(chaine); - SAFE_FREE(long_desc); - SAFE_FREE(short_desc); + safe_free(chaine); + safe_free(long_desc); + safe_free(short_desc); fprintf(stderr,"find_desc: Unable to malloc memory\n"); exit(1); } @@ -366,7 +367,7 @@ static void scan_copyfiles(FILE *fichier, char *chaine) * This may still be wrong but at least I get the same list * of files as seen on a printer test page. */ - part = strchr_m(buffer[i],'='); + part = strchr(buffer[i],'='); if (part) { /* * Case (1) eg. pscript.hlp = pscript.hl_ - chop after the first name. @@ -385,13 +386,13 @@ static void scan_copyfiles(FILE *fichier, char *chaine) break; } } else { - part = strchr_m(buffer[i],','); + part = strchr(buffer[i],','); if (part) { /* * Cases (2-4) */ - if ((mpart = strrchr_m(part+1,','))!=NULL) { + if ((mpart = strrchr(part+1,','))!=NULL) { /* * Second ',' - case 3 or 4. * Check if the last part is just a number, @@ -513,7 +514,7 @@ static void scan_short_desc(FILE *fichier, char *short_desc) temp = strtok(languagemonitor,","); if (*temp == '"') ++temp; pstrcpy(languagemonitor,temp); - if ((temp = strchr_m(languagemonitor,'"'))!=NULL) *temp = '\0'; + if ((temp = strchr(languagemonitor,'"'))!=NULL) *temp = '\0'; } if (i) fprintf(stderr,"End of section found\n"); @@ -540,6 +541,10 @@ int main(int argc, char *argv[]) char *short_desc; FILE *inf_file; + fprintf( stderr, "This tool has been deprecated in favor of the new printer administration\n"); + fprintf( stderr, "model included in Samba 2.2. Please see the HOWTO in docs/textdocs/printer_driver2.html\n"); + fprintf( stderr, "for details.\n"); + if (argc!=3) { usage(argv[0]); |