Skip to content

Commit 7450ea6

Browse files
committed
cosmetic changes: char* x changed to char *x
submitted by: bruce
1 parent 0e887c5 commit 7450ea6

File tree

4 files changed

+61
-61
lines changed

4 files changed

+61
-61
lines changed

src/bin/psql/psql.c

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.12 1996/07/28 06:59:43 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.13 1996/07/28 07:08:13 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -60,18 +60,18 @@ typedef struct _psqlSettings {
6060
} PsqlSettings;
6161

6262
/* declarations for functions in this file */
63-
static void usage(char* progname);
63+
static void usage(char *progname);
6464
static void slashUsage();
6565
static void handleCopyOut(PGresult *res, bool quiet);
6666
static void handleCopyIn(PGresult *res, bool quiet);
6767
static int tableList(PsqlSettings *ps, bool deep_tablelist);
6868
static int tableDesc(PsqlSettings *ps, char *table);
6969

70-
char* gets_noreadline(char* prompt, FILE* source);
71-
char* gets_readline(char* prompt, FILE* source);
72-
char* gets_fromFile(char* prompt, FILE* source);
70+
char *gets_noreadline(char *prompt, FILE *source);
71+
char *gets_readline(char *prompt, FILE *source);
72+
char *gets_fromFile(char *prompt, FILE *source);
7373
int listAllDbs(PsqlSettings *settings);
74-
int SendQuery(PsqlSettings *settings, char* query);
74+
int SendQuery(PsqlSettings *settings, char *query);
7575
int HandleSlashCmds(PsqlSettings *settings,
7676
char *line,
7777
char *query);
@@ -82,15 +82,15 @@ void PQprint(FILE *fp,
8282
PQprintOpt *po
8383
);
8484

85-
FILE* setFout(PsqlSettings *ps, char *fname);
85+
FILE *setFout(PsqlSettings *ps, char *fname);
8686

8787
/*
8888
* usage
8989
* print out usage for command line arguments
9090
*/
9191

9292
static void
93-
usage(char* progname)
93+
usage(char *progname)
9494
{
9595
fprintf(stderr,"Usage: %s [options] [dbname]\n",progname);
9696
fprintf(stderr,"\t -a authsvc set authentication service\n");
@@ -187,7 +187,7 @@ int
187187
listAllDbs(PsqlSettings *ps)
188188
{
189189
PGresult *results;
190-
char* query = "select * from pg_database;";
190+
char *query = "select * from pg_database;";
191191

192192
if (!(results=PSQLexec(ps, query)))
193193
return 1;
@@ -213,10 +213,10 @@ tableList (PsqlSettings *ps, bool deep_tablelist)
213213
char listbuf[256];
214214
int nColumns;
215215
int i;
216-
char* rk;
217-
char* rr;
216+
char *rk;
217+
char *rr;
218218

219-
PGresult* res;
219+
PGresult *res;
220220

221221
listbuf[0] = '\0';
222222
strcat(listbuf,"SELECT usename, relname, relkind, relhasrules");
@@ -242,7 +242,7 @@ tableList (PsqlSettings *ps, bool deep_tablelist)
242242
if ( table == NULL )
243243
perror("malloc");
244244

245-
/* load table table*/
245+
/* load table table */
246246
for (i=0; i < nColumns; i++) {
247247
table[i] = (char *) malloc(PQgetlength(res,i,1) * sizeof(char) + 1);
248248
if ( table[i] == NULL )
@@ -304,7 +304,7 @@ tableDesc (PsqlSettings *ps, char *table)
304304
int i;
305305
int rsize;
306306

307-
PGresult* res;
307+
PGresult *res;
308308

309309
/* Build the query */
310310

@@ -380,13 +380,13 @@ tableDesc (PsqlSettings *ps, char *table)
380380
}
381381
}
382382

383-
typedef char* (*READ_ROUTINE)(char* prompt, FILE* source);
383+
typedef char *(*READ_ROUTINE)(char *prompt, FILE *source);
384384

385385
/* gets_noreadline prompt source
386386
gets a line of input without calling readline, the source is ignored
387387
*/
388-
char*
389-
gets_noreadline(char* prompt, FILE* source)
388+
char *
389+
gets_noreadline(char *prompt, FILE *source)
390390
{
391391
fputs(prompt, stdout);
392392
fflush(stdout);
@@ -398,8 +398,8 @@ gets_noreadline(char* prompt, FILE* source)
398398
* the routine to get input from GNU readline(), the source is ignored
399399
* the prompt argument is used as the prompting string
400400
*/
401-
char*
402-
gets_readline(char* prompt, FILE* source)
401+
char *
402+
gets_readline(char *prompt, FILE *source)
403403
{
404404
return (readline(prompt));
405405
}
@@ -408,12 +408,12 @@ gets_readline(char* prompt, FILE* source)
408408
* gets_fromFile prompt source
409409
*
410410
* the routine to read from a file, the prompt argument is ignored
411-
* the source argument is a FILE*
411+
* the source argument is a FILE *
412412
*/
413-
char*
414-
gets_fromFile(char* prompt, FILE* source)
413+
char *
414+
gets_fromFile(char *prompt, FILE *source)
415415
{
416-
char* line;
416+
char *line;
417417
int len;
418418

419419
line = malloc(MAX_QUERY_BUFFER+1);
@@ -440,8 +440,8 @@ gets_fromFile(char* prompt, FILE* source)
440440
int
441441
SendQuery(PsqlSettings *settings, char *query)
442442
{
443-
PGresult* results;
444-
PGnotify* notify;
443+
PGresult *results;
444+
PGnotify *notify;
445445
int status = 0;
446446

447447
if (settings->singleStep)
@@ -610,7 +610,7 @@ decode(char *s)
610610
*/
611611
int
612612
HandleSlashCmds(PsqlSettings *settings,
613-
char* line,
613+
char *line,
614614
char *query)
615615
{
616616
int status = 1;
@@ -766,7 +766,7 @@ HandleSlashCmds(PsqlSettings *settings,
766766
break;
767767
case 'h':
768768
{
769-
char* cmd;
769+
char *cmd;
770770
int i, numCmds;
771771
int all_help = 0;
772772

@@ -814,7 +814,7 @@ HandleSlashCmds(PsqlSettings *settings,
814814
}
815815
case 'i': /* \i is include file */
816816
{
817-
FILE* fd;
817+
FILE *fd;
818818

819819
if (!optarg) {
820820
fprintf(stderr,"\\i must be followed by a file name\n");
@@ -852,7 +852,7 @@ HandleSlashCmds(PsqlSettings *settings,
852852
break;
853853
case 'r':
854854
{
855-
FILE* fd;
855+
FILE *fd;
856856
static char *lastfile;
857857
struct stat st, st2;
858858
if (optarg)
@@ -974,9 +974,9 @@ HandleSlashCmds(PsqlSettings *settings,
974974
*/
975975

976976
int
977-
MainLoop(PsqlSettings *settings, FILE* source)
977+
MainLoop(PsqlSettings *settings, FILE *source)
978978
{
979-
char* line; /* line of input*/
979+
char *line; /* line of input */
980980
int len; /* length of the line */
981981
char query[MAX_QUERY_BUFFER]; /* multi-line query storage */
982982
int exitStatus = 0;
@@ -1028,7 +1028,7 @@ MainLoop(PsqlSettings *settings, FILE* source)
10281028
/* filter out comment lines that begin with --,
10291029
this could be incorrect if -- is part of a quoted string.
10301030
But we won't go through the trouble of detecting that. If you have
1031-
-- in your quoted string, be careful and don't start a line with it*/
1031+
-- in your quoted string, be careful and don't start a line with it */
10321032
if (line[0] == '-' && line[1] == '-') {
10331033
if (settings->singleStep) /* in single step mode, show comments */
10341034
fprintf(stdout,"%s\n",line);
@@ -1106,20 +1106,20 @@ MainLoop(PsqlSettings *settings, FILE* source)
11061106
}
11071107

11081108
int
1109-
main(int argc, char** argv)
1109+
main(int argc, char **argv)
11101110
{
1111-
extern char* optarg;
1111+
extern char *optarg;
11121112
extern int optind;
11131113

1114-
char* dbname = NULL;
1115-
char* host = NULL;
1116-
char* port = NULL;
1117-
char* qfilename = NULL;
1114+
char *dbname = NULL;
1115+
char *host = NULL;
1116+
char *port = NULL;
1117+
char *qfilename = NULL;
11181118
char errbuf[ERROR_MSG_LENGTH];
11191119

11201120
PsqlSettings settings;
11211121

1122-
char* singleQuery = NULL;
1122+
char *singleQuery = NULL;
11231123

11241124
bool listDatabases = 0 ;
11251125
int exitStatus = 0;
@@ -1358,10 +1358,10 @@ handleCopyIn(PGresult *res, bool quiet)
13581358
PQendcopy(res->conn);
13591359
}
13601360

1361-
/* try to open fname and return a FILE*,
1361+
/* try to open fname and return a FILE *,
13621362
if it fails, use stdout, instead */
13631363

1364-
FILE*
1364+
FILE *
13651365
setFout(PsqlSettings *ps, char *fname)
13661366
{
13671367
if (ps->queryFout && ps->queryFout != stdout)

src/bin/psql/psqlHelp.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: psqlHelp.h,v 1.1.1.1 1996/07/09 06:22:15 scrappy Exp $
8+
* $Id: psqlHelp.h,v 1.2 1996/07/28 07:08:14 scrappy Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
1212

1313
struct _helpStruct {
14-
char* cmd; /* the command name */
15-
char* help; /* the help associated with it */
16-
char* syntax; /* the syntax associated with it */
14+
char *cmd; /* the command name */
15+
char *help; /* the help associated with it */
16+
char *syntax; /* the syntax associated with it */
1717
} ;
1818

1919
static struct _helpStruct QL_HELP[] = {

src/bin/psql/stringutils.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.1.1.1 1996/07/09 06:22:15 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.2 1996/07/28 07:08:15 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -21,9 +21,9 @@
2121

2222
/* removes whitespaces from the left, right and both sides of a string */
2323
/* MODIFIES the string passed in and returns the head of it */
24-
char* leftTrim(char* s)
24+
char *leftTrim(char *s)
2525
{
26-
char* s2 = s;
26+
char *s2 = s;
2727
int shift=0;
2828
int j=0;
2929

@@ -38,9 +38,9 @@ char* leftTrim(char* s)
3838
return s2;
3939
}
4040

41-
char* rightTrim(char* s)
41+
char *rightTrim(char *s)
4242
{
43-
char* sEnd;
43+
char *sEnd;
4444
sEnd = s+strlen(s)-1;
4545
while (isspace(*sEnd))
4646
sEnd--;
@@ -51,18 +51,18 @@ char* rightTrim(char* s)
5151
return s;
5252
}
5353

54-
char* doubleTrim(char* s)
54+
char *doubleTrim(char *s)
5555
{
5656
strcpy(s,leftTrim(rightTrim(s)));
5757
return s;
5858
}
5959

6060
/* dupstr : copies a string, while allocating space for it.
6161
the CALLER is responsible for freeing the space
62-
returns NULL if the argument is NULL*/
63-
char* dupstr(char *s)
62+
returns NULL if the argument is NULL */
63+
char *dupstr(char *s)
6464
{
65-
char* result;
65+
char *result;
6666

6767
if (s == NULL)
6868
return NULL;
@@ -76,7 +76,7 @@ char* dupstr(char *s)
7676
#ifdef STRINGUTILS_TEST
7777
void testStringUtils()
7878
{
79-
static char* tests[] = {" goodbye \n", /* space on both ends */
79+
static char *tests[] = {" goodbye \n", /* space on both ends */
8080
"hello world", /* no spaces to trim */
8181
"", /* empty string */
8282
"a", /* string with one char*/
@@ -86,7 +86,7 @@ void testStringUtils()
8686
int i=0;
8787
while (tests[i]!=NULL_STR)
8888
{
89-
char* t;
89+
char *t;
9090
t = dupstr(tests[i]);
9191
printf("leftTrim(%s) = ",t);
9292
printf("%sEND\n", leftTrim(t));

src/bin/psql/stringutils.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: stringutils.h,v 1.1.1.1 1996/07/09 06:22:16 scrappy Exp $
8+
* $Id: stringutils.h,v 1.2 1996/07/28 07:08:15 scrappy Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -27,14 +27,14 @@
2727

2828
/* removes whitespaces from the left, right and both sides of a string */
2929
/* MODIFIES the string passed in and returns the head of it */
30-
extern char* leftTrim(char* s);
31-
extern char* rightTrim(char* s);
32-
extern char* doubleTrim(char* s);
30+
extern char *leftTrim(char *s);
31+
extern char *rightTrim(char *s);
32+
extern char *doubleTrim(char *s);
3333

3434
/* dupstr : copies a string, while making room for it */
3535
/* the CALLER is responsible for freeing the space */
3636
/* returns NULL if the argument is NULL */
37-
extern char* dupstr(char *s);
37+
extern char *dupstr(char *s);
3838

3939
#ifdef STRINGUTILS_TEST
4040
extern void testStringUtils();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy