LCOV - code coverage report
Current view: top level - src/bin/psql - help.c (source / functions) Coverage Total Hit
Test: Code coverage Lines: 0.0 % 418 0
Test Date: 2026-01-26 10:56:24 Functions: 0.0 % 5 0
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 0.0 % 85 0

             Branch data     Line data    Source code
       1                 :             : /*
       2                 :             :  * psql - the PostgreSQL interactive terminal
       3                 :             :  *
       4                 :             :  * Copyright (c) 2000-2026, PostgreSQL Global Development Group
       5                 :             :  *
       6                 :             :  * src/bin/psql/help.c
       7                 :             :  */
       8                 :             : #include "postgres_fe.h"
       9                 :             : 
      10                 :             : #ifndef WIN32
      11                 :             : #include <unistd.h>                               /* for geteuid() */
      12                 :             : #else
      13                 :             : #include <win32.h>
      14                 :             : #endif
      15                 :             : 
      16                 :             : #ifndef WIN32
      17                 :             : #include <sys/ioctl.h>                    /* for ioctl() */
      18                 :             : #endif
      19                 :             : 
      20                 :             : #ifdef HAVE_TERMIOS_H
      21                 :             : #include <termios.h>
      22                 :             : #endif
      23                 :             : 
      24                 :             : #include "help.h"
      25                 :             : #include "input.h"
      26                 :             : #include "settings.h"
      27                 :             : #include "sql_help.h"
      28                 :             : 
      29                 :             : /*
      30                 :             :  * PLEASE:
      31                 :             :  * If you change something in this file, also make the same changes
      32                 :             :  * in the DocBook documentation, file ref/psql-ref.sgml. If you don't
      33                 :             :  * know how to do it, please find someone who can help you.
      34                 :             :  */
      35                 :             : 
      36                 :             : /* Some helper macros to make the code less verbose */
      37                 :             : #define HELP0(str) appendPQExpBufferStr(&buf, _(str))
      38                 :             : #define HELPN(str,...) appendPQExpBuffer(&buf, _(str), __VA_ARGS__)
      39                 :             : #define ON(var) ((var) ? _("on") : _("off"))
      40                 :             : 
      41                 :             : 
      42                 :             : /*
      43                 :             :  * usage
      44                 :             :  *
      45                 :             :  * print out command line arguments
      46                 :             :  */
      47                 :             : void
      48                 :           0 : usage(unsigned short int pager)
      49                 :             : {
      50                 :           0 :         PQExpBufferData buf;
      51                 :           0 :         int                     nlcount;
      52                 :           0 :         FILE       *output;
      53                 :             : 
      54                 :             :         /*
      55                 :             :          * To avoid counting the output lines manually, build the output in "buf"
      56                 :             :          * and then count them.
      57                 :             :          */
      58                 :           0 :         initPQExpBuffer(&buf);
      59                 :             : 
      60                 :           0 :         HELP0("psql is the PostgreSQL interactive terminal.\n\n");
      61                 :           0 :         HELP0("Usage:\n");
      62                 :           0 :         HELP0("  psql [OPTION]... [DBNAME [USERNAME]]\n\n");
      63                 :             : 
      64                 :           0 :         HELP0("General options:\n");
      65                 :           0 :         HELP0("  -c, --command=COMMAND    run only single command (SQL or internal) and exit\n");
      66                 :           0 :         HELP0("  -d, --dbname=DBNAME      database name to connect to\n");
      67                 :           0 :         HELP0("  -f, --file=FILENAME      execute commands from file, then exit\n");
      68                 :           0 :         HELP0("  -l, --list               list available databases, then exit\n");
      69                 :           0 :         HELP0("  -v, --set=, --variable=NAME=VALUE\n"
      70                 :             :                   "                           set psql variable NAME to VALUE\n"
      71                 :             :                   "                           (e.g., -v ON_ERROR_STOP=1)\n");
      72                 :           0 :         HELP0("  -V, --version            output version information, then exit\n");
      73                 :           0 :         HELP0("  -X, --no-psqlrc          do not read startup file (~/.psqlrc)\n");
      74                 :           0 :         HELP0("  -1 (\"one\"), --single-transaction\n"
      75                 :             :                   "                           execute as a single transaction (if non-interactive)\n");
      76                 :           0 :         HELP0("  -?, --help[=options]     show this help, then exit\n");
      77                 :           0 :         HELP0("      --help=commands      list backslash commands, then exit\n");
      78                 :           0 :         HELP0("      --help=variables     list special variables, then exit\n");
      79                 :             : 
      80                 :           0 :         HELP0("\nInput and output options:\n");
      81                 :           0 :         HELP0("  -a, --echo-all           echo all input from script\n");
      82                 :           0 :         HELP0("  -b, --echo-errors        echo failed commands\n");
      83                 :           0 :         HELP0("  -e, --echo-queries       echo commands sent to server\n");
      84                 :           0 :         HELP0("  -E, --echo-hidden        display queries that internal commands generate\n");
      85                 :           0 :         HELP0("  -L, --log-file=FILENAME  send session log to file\n");
      86                 :           0 :         HELP0("  -n, --no-readline        disable enhanced command line editing (readline)\n");
      87                 :           0 :         HELP0("  -o, --output=FILENAME    send query results to file (or |pipe)\n");
      88                 :           0 :         HELP0("  -q, --quiet              run quietly (no messages, only query output)\n");
      89                 :           0 :         HELP0("  -s, --single-step        single-step mode (confirm each query)\n");
      90                 :           0 :         HELP0("  -S, --single-line        single-line mode (end of line terminates SQL command)\n");
      91                 :             : 
      92                 :           0 :         HELP0("\nOutput format options:\n");
      93                 :           0 :         HELP0("  -A, --no-align           unaligned table output mode\n");
      94                 :           0 :         HELP0("      --csv                CSV (Comma-Separated Values) table output mode\n");
      95                 :           0 :         HELPN("  -F, --field-separator=STRING\n"
      96                 :             :                   "                           field separator for unaligned output (default: \"%s\")\n",
      97                 :             :                   DEFAULT_FIELD_SEP);
      98                 :           0 :         HELP0("  -H, --html               HTML table output mode\n");
      99                 :           0 :         HELP0("  -P, --pset=VAR[=ARG]     set printing option VAR to ARG (see \\pset command)\n");
     100                 :           0 :         HELP0("  -R, --record-separator=STRING\n"
     101                 :             :                   "                           record separator for unaligned output (default: newline)\n");
     102                 :           0 :         HELP0("  -t, --tuples-only        print rows only\n");
     103                 :           0 :         HELP0("  -T, --table-attr=TEXT    set HTML table tag attributes (e.g., width, border)\n");
     104                 :           0 :         HELP0("  -x, --expanded           turn on expanded table output\n");
     105                 :           0 :         HELP0("  -z, --field-separator-zero\n"
     106                 :             :                   "                           set field separator for unaligned output to zero byte\n");
     107                 :           0 :         HELP0("  -0, --record-separator-zero\n"
     108                 :             :                   "                           set record separator for unaligned output to zero byte\n");
     109                 :             : 
     110                 :           0 :         HELP0("\nConnection options:\n");
     111                 :           0 :         HELP0("  -h, --host=HOSTNAME      database server host or socket directory\n");
     112                 :           0 :         HELP0("  -p, --port=PORT          database server port\n");
     113                 :           0 :         HELP0("  -U, --username=USERNAME  database user name\n");
     114                 :           0 :         HELP0("  -w, --no-password        never prompt for password\n");
     115                 :           0 :         HELP0("  -W, --password           force password prompt (should happen automatically)\n");
     116                 :             : 
     117                 :           0 :         HELP0("\nFor more information, type \"\\?\" (for internal commands) or \"\\help\" (for SQL\n"
     118                 :             :                   "commands) from within psql, or consult the psql section in the PostgreSQL\n"
     119                 :             :                   "documentation.\n\n");
     120                 :           0 :         HELPN("Report bugs to <%s>.\n", PACKAGE_BUGREPORT);
     121                 :           0 :         HELPN("%s home page: <%s>\n", PACKAGE_NAME, PACKAGE_URL);
     122                 :             : 
     123                 :             :         /* Now we can count the lines. */
     124                 :           0 :         nlcount = 0;
     125         [ #  # ]:           0 :         for (const char *ptr = buf.data; *ptr; ptr++)
     126                 :             :         {
     127         [ #  # ]:           0 :                 if (*ptr == '\n')
     128                 :           0 :                         nlcount++;
     129                 :           0 :         }
     130                 :             : 
     131                 :             :         /* And dump the output, with appropriate pagination. */
     132                 :           0 :         output = PageOutput(nlcount, pager ? &(pset.popt.topt) : NULL);
     133                 :             : 
     134                 :           0 :         fputs(buf.data, output);
     135                 :             : 
     136                 :           0 :         ClosePager(output);
     137                 :             : 
     138                 :           0 :         termPQExpBuffer(&buf);
     139                 :           0 : }
     140                 :             : 
     141                 :             : 
     142                 :             : /*
     143                 :             :  * slashUsage
     144                 :             :  *
     145                 :             :  * print out help for the backslash commands
     146                 :             :  */
     147                 :             : void
     148                 :           0 : slashUsage(unsigned short int pager)
     149                 :             : {
     150                 :           0 :         PQExpBufferData buf;
     151                 :           0 :         int                     nlcount;
     152                 :           0 :         FILE       *output;
     153                 :           0 :         char       *currdb;
     154                 :             : 
     155                 :           0 :         currdb = PQdb(pset.db);
     156                 :             : 
     157                 :             :         /*
     158                 :             :          * To avoid counting the output lines manually, build the output in "buf"
     159                 :             :          * and then count them.
     160                 :             :          */
     161                 :           0 :         initPQExpBuffer(&buf);
     162                 :             : 
     163                 :           0 :         HELP0("General\n");
     164                 :           0 :         HELP0("  \\copyright             show PostgreSQL usage and distribution terms\n");
     165                 :           0 :         HELP0("  \\crosstabview [COLUMNS] execute query and display result in crosstab\n");
     166                 :           0 :         HELP0("  \\errverbose            show most recent error message at maximum verbosity\n");
     167                 :           0 :         HELP0("  \\g [(OPTIONS)] [FILE]  execute query (and send result to file or |pipe);\n"
     168                 :             :                   "                         \\g with no arguments is equivalent to a semicolon\n");
     169                 :           0 :         HELP0("  \\gdesc                 describe result of query, without executing it\n");
     170                 :           0 :         HELP0("  \\gexec                 execute query, then execute each value in its result\n");
     171                 :           0 :         HELP0("  \\gset [PREFIX]         execute query and store result in psql variables\n");
     172                 :           0 :         HELP0("  \\gx [(OPTIONS)] [FILE] as \\g, but forces expanded output mode\n");
     173                 :           0 :         HELP0("  \\q                     quit psql\n");
     174                 :           0 :         HELP0("  \\restrict RESTRICT_KEY\n"
     175                 :             :                   "                         enter restricted mode with provided key\n");
     176                 :           0 :         HELP0("  \\unrestrict RESTRICT_KEY\n"
     177                 :             :                   "                         exit restricted mode if key matches\n");
     178                 :           0 :         HELP0("  \\watch [[i=]SEC] [c=N] [m=MIN]\n"
     179                 :             :                   "                         execute query every SEC seconds, up to N times,\n"
     180                 :             :                   "                         stop if less than MIN rows are returned\n");
     181                 :           0 :         HELP0("\n");
     182                 :             : 
     183                 :           0 :         HELP0("Help\n");
     184                 :             : 
     185                 :           0 :         HELP0("  \\? [commands]          show help on backslash commands\n");
     186                 :           0 :         HELP0("  \\? options             show help on psql command-line options\n");
     187                 :           0 :         HELP0("  \\? variables           show help on special variables\n");
     188                 :           0 :         HELP0("  \\h [NAME]              help on syntax of SQL commands, * for all commands\n");
     189                 :           0 :         HELP0("\n");
     190                 :             : 
     191                 :           0 :         HELP0("Query Buffer\n");
     192                 :           0 :         HELP0("  \\e [FILE] [LINE]       edit the query buffer (or file) with external editor\n");
     193                 :           0 :         HELP0("  \\ef [FUNCNAME [LINE]]  edit function definition with external editor\n");
     194                 :           0 :         HELP0("  \\ev [VIEWNAME [LINE]]  edit view definition with external editor\n");
     195                 :           0 :         HELP0("  \\p                     show the contents of the query buffer\n");
     196                 :           0 :         HELP0("  \\r                     reset (clear) the query buffer\n");
     197                 :             : #ifdef USE_READLINE
     198                 :           0 :         HELP0("  \\s [FILE]              display history or save it to file\n");
     199                 :             : #endif
     200                 :           0 :         HELP0("  \\w FILE                write query buffer to file\n");
     201                 :           0 :         HELP0("\n");
     202                 :             : 
     203                 :           0 :         HELP0("Input/Output\n");
     204                 :           0 :         HELP0("  \\copy ...              perform SQL COPY with data stream to the client host\n");
     205                 :           0 :         HELP0("  \\echo [-n] [STRING]    write string to standard output (-n for no newline)\n");
     206                 :           0 :         HELP0("  \\i FILE                execute commands from file\n");
     207                 :           0 :         HELP0("  \\ir FILE               as \\i, but relative to location of current script\n");
     208                 :           0 :         HELP0("  \\o [FILE]              send all query results to file or |pipe\n");
     209                 :           0 :         HELP0("  \\qecho [-n] [STRING]   write string to \\o output stream (-n for no newline)\n");
     210                 :           0 :         HELP0("  \\warn [-n] [STRING]    write string to standard error (-n for no newline)\n");
     211                 :           0 :         HELP0("\n");
     212                 :             : 
     213                 :           0 :         HELP0("Conditional\n");
     214                 :           0 :         HELP0("  \\if EXPR               begin conditional block\n");
     215                 :           0 :         HELP0("  \\elif EXPR             alternative within current conditional block\n");
     216                 :           0 :         HELP0("  \\else                  final alternative within current conditional block\n");
     217                 :           0 :         HELP0("  \\endif                 end conditional block\n");
     218                 :           0 :         HELP0("\n");
     219                 :             : 
     220                 :           0 :         HELP0("Informational\n");
     221                 :           0 :         HELP0("  (options: S = show system objects, x = expanded mode, + = additional detail)\n");
     222                 :           0 :         HELP0("  \\d[Sx+]                list tables, views, and sequences\n");
     223                 :           0 :         HELP0("  \\d[S+]   NAME          describe table, view, sequence, or index\n");
     224                 :           0 :         HELP0("  \\da[Sx]  [PATTERN]     list aggregates\n");
     225                 :           0 :         HELP0("  \\dA[x+]  [PATTERN]     list access methods\n");
     226                 :           0 :         HELP0("  \\dAc[x+] [AMPTRN [TYPEPTRN]]  list operator classes\n");
     227                 :           0 :         HELP0("  \\dAf[x+] [AMPTRN [TYPEPTRN]]  list operator families\n");
     228                 :           0 :         HELP0("  \\dAo[x+] [AMPTRN [OPFPTRN]]   list operators of operator families\n");
     229                 :           0 :         HELP0("  \\dAp[x+] [AMPTRN [OPFPTRN]]   list support functions of operator families\n");
     230                 :           0 :         HELP0("  \\db[x+]  [PATTERN]     list tablespaces\n");
     231                 :           0 :         HELP0("  \\dc[Sx+] [PATTERN]     list conversions\n");
     232                 :           0 :         HELP0("  \\dconfig[x+] [PATTERN] list configuration parameters\n");
     233                 :           0 :         HELP0("  \\dC[x+]  [PATTERN]     list casts\n");
     234                 :           0 :         HELP0("  \\dd[Sx]  [PATTERN]     show object descriptions not displayed elsewhere\n");
     235                 :           0 :         HELP0("  \\dD[Sx+] [PATTERN]     list domains\n");
     236                 :           0 :         HELP0("  \\ddp[x]  [PATTERN]     list default privileges\n");
     237                 :           0 :         HELP0("  \\dE[Sx+] [PATTERN]     list foreign tables\n");
     238                 :           0 :         HELP0("  \\des[x+] [PATTERN]     list foreign servers\n");
     239                 :           0 :         HELP0("  \\det[x+] [PATTERN]     list foreign tables\n");
     240                 :           0 :         HELP0("  \\deu[x+] [PATTERN]     list user mappings\n");
     241                 :           0 :         HELP0("  \\dew[x+] [PATTERN]     list foreign-data wrappers\n");
     242                 :           0 :         HELP0("  \\df[anptw][Sx+] [FUNCPTRN [TYPEPTRN ...]]\n"
     243                 :             :                   "                         list [only agg/normal/procedure/trigger/window] functions\n");
     244                 :           0 :         HELP0("  \\dF[x+]  [PATTERN]     list text search configurations\n");
     245                 :           0 :         HELP0("  \\dFd[x+] [PATTERN]     list text search dictionaries\n");
     246                 :           0 :         HELP0("  \\dFp[x+] [PATTERN]     list text search parsers\n");
     247                 :           0 :         HELP0("  \\dFt[x+] [PATTERN]     list text search templates\n");
     248                 :           0 :         HELP0("  \\dg[Sx+] [PATTERN]     list roles\n");
     249                 :           0 :         HELP0("  \\di[Sx+] [PATTERN]     list indexes\n");
     250                 :           0 :         HELP0("  \\dl[x+]                list large objects, same as \\lo_list\n");
     251                 :           0 :         HELP0("  \\dL[Sx+] [PATTERN]     list procedural languages\n");
     252                 :           0 :         HELP0("  \\dm[Sx+] [PATTERN]     list materialized views\n");
     253                 :           0 :         HELP0("  \\dn[Sx+] [PATTERN]     list schemas\n");
     254                 :           0 :         HELP0("  \\do[Sx+] [OPPTRN [TYPEPTRN [TYPEPTRN]]]\n"
     255                 :             :                   "                         list operators\n");
     256                 :           0 :         HELP0("  \\dO[Sx+] [PATTERN]     list collations\n");
     257                 :           0 :         HELP0("  \\dp[Sx]  [PATTERN]     list table, view, and sequence access privileges\n");
     258                 :           0 :         HELP0("  \\dP[itnx+] [PATTERN]   list [only index/table] partitioned relations [n=nested]\n");
     259                 :           0 :         HELP0("  \\drds[x] [ROLEPTRN [DBPTRN]]\n"
     260                 :             :                   "                         list per-database role settings\n");
     261                 :           0 :         HELP0("  \\drg[Sx] [PATTERN]     list role grants\n");
     262                 :           0 :         HELP0("  \\dRp[x+] [PATTERN]     list replication publications\n");
     263                 :           0 :         HELP0("  \\dRs[x+] [PATTERN]     list replication subscriptions\n");
     264                 :           0 :         HELP0("  \\ds[Sx+] [PATTERN]     list sequences\n");
     265                 :           0 :         HELP0("  \\dt[Sx+] [PATTERN]     list tables\n");
     266                 :           0 :         HELP0("  \\dT[Sx+] [PATTERN]     list data types\n");
     267                 :           0 :         HELP0("  \\du[Sx+] [PATTERN]     list roles\n");
     268                 :           0 :         HELP0("  \\dv[Sx+] [PATTERN]     list views\n");
     269                 :           0 :         HELP0("  \\dx[x+]  [PATTERN]     list extensions\n");
     270                 :           0 :         HELP0("  \\dX[x]   [PATTERN]     list extended statistics\n");
     271                 :           0 :         HELP0("  \\dy[x+]  [PATTERN]     list event triggers\n");
     272                 :           0 :         HELP0("  \\l[x+]   [PATTERN]     list databases\n");
     273                 :           0 :         HELP0("  \\sf[+]   FUNCNAME      show a function's definition\n");
     274                 :           0 :         HELP0("  \\sv[+]   VIEWNAME      show a view's definition\n");
     275                 :           0 :         HELP0("  \\z[Sx]   [PATTERN]     same as \\dp\n");
     276                 :           0 :         HELP0("\n");
     277                 :             : 
     278                 :           0 :         HELP0("Large Objects\n");
     279                 :           0 :         HELP0("  \\lo_export LOBOID FILE write large object to file\n");
     280                 :           0 :         HELP0("  \\lo_import FILE [COMMENT]\n"
     281                 :             :                   "                         read large object from file\n");
     282                 :           0 :         HELP0("  \\lo_list[x+]           list large objects\n");
     283                 :           0 :         HELP0("  \\lo_unlink LOBOID      delete a large object\n");
     284                 :           0 :         HELP0("\n");
     285                 :             : 
     286                 :           0 :         HELP0("Formatting\n");
     287                 :           0 :         HELP0("  \\a                     toggle between unaligned and aligned output mode\n");
     288                 :           0 :         HELP0("  \\C [STRING]            set table title, or unset if none\n");
     289                 :           0 :         HELP0("  \\f [STRING]            show or set field separator for unaligned query output\n");
     290         [ #  # ]:           0 :         HELPN("  \\H                     toggle HTML output mode (currently %s)\n",
     291                 :             :                   ON(pset.popt.topt.format == PRINT_HTML));
     292                 :           0 :         HELP0("  \\pset [NAME [VALUE]]   set table output option\n"
     293                 :             :                   "                         see \"\\? variables\" for valid options\n");
     294         [ #  # ]:           0 :         HELPN("  \\t [on|off]            show only rows (currently %s)\n",
     295                 :             :                   ON(pset.popt.topt.tuples_only));
     296                 :           0 :         HELP0("  \\T [STRING]            set HTML <table> tag attributes, or unset if none\n");
     297   [ #  #  #  # ]:           0 :         HELPN("  \\x [on|off|auto]       toggle expanded output (currently %s)\n",
     298                 :             :                   pset.popt.topt.expanded == 2 ? _("auto") : ON(pset.popt.topt.expanded));
     299                 :           0 :         HELP0("\n");
     300                 :             : 
     301                 :           0 :         HELP0("Connection\n");
     302         [ #  # ]:           0 :         if (currdb)
     303                 :           0 :                 HELPN("  \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n"
     304                 :             :                           "                         connect to new database (currently \"%s\")\n",
     305                 :             :                           currdb);
     306                 :             :         else
     307                 :           0 :                 HELP0("  \\c[onnect] {[DBNAME|- USER|- HOST|- PORT|-] | conninfo}\n"
     308                 :             :                           "                         connect to new database (currently no connection)\n");
     309                 :           0 :         HELP0("  \\conninfo              display information about current connection\n");
     310                 :           0 :         HELP0("  \\encoding [ENCODING]   show or set client encoding\n");
     311                 :           0 :         HELP0("  \\password [USERNAME]   securely change the password for a user\n");
     312                 :           0 :         HELP0("\n");
     313                 :             : 
     314                 :           0 :         HELP0("Operating System\n");
     315                 :           0 :         HELP0("  \\cd [DIR]              change the current working directory\n");
     316                 :           0 :         HELP0("  \\getenv PSQLVAR ENVVAR fetch environment variable\n");
     317                 :           0 :         HELP0("  \\setenv NAME [VALUE]   set or unset environment variable\n");
     318         [ #  # ]:           0 :         HELPN("  \\timing [on|off]       toggle timing of commands (currently %s)\n",
     319                 :             :                   ON(pset.timing));
     320                 :           0 :         HELP0("  \\! [COMMAND]           execute command in shell or start interactive shell\n");
     321                 :           0 :         HELP0("\n");
     322                 :             : 
     323                 :           0 :         HELP0("Variables\n");
     324                 :           0 :         HELP0("  \\prompt [TEXT] NAME    prompt user to set internal variable\n");
     325                 :           0 :         HELP0("  \\set [NAME [VALUE]]    set internal variable, or list all if no parameters\n");
     326                 :           0 :         HELP0("  \\unset NAME            unset (delete) internal variable\n");
     327                 :           0 :         HELP0("\n");
     328                 :             : 
     329                 :           0 :         HELP0("Extended Query Protocol\n");
     330                 :           0 :         HELP0("  \\bind [PARAM]...       set query parameters\n");
     331                 :           0 :         HELP0("  \\bind_named STMT_NAME [PARAM]...\n"
     332                 :             :                   "                         set query parameters for an existing prepared statement\n");
     333                 :           0 :         HELP0("  \\close_prepared STMT_NAME\n"
     334                 :             :                   "                         close an existing prepared statement\n");
     335                 :           0 :         HELP0("  \\endpipeline           exit pipeline mode\n");
     336                 :           0 :         HELP0("  \\flush                 flush output data to the server\n");
     337                 :           0 :         HELP0("  \\flushrequest          send request to the server to flush its output buffer\n");
     338                 :           0 :         HELP0("  \\getresults [NUM_RES]  read NUM_RES pending results, or all if no argument\n");
     339                 :           0 :         HELP0("  \\parse STMT_NAME       create a prepared statement\n");
     340                 :           0 :         HELP0("  \\sendpipeline          send an extended query to an ongoing pipeline\n");
     341                 :           0 :         HELP0("  \\startpipeline         enter pipeline mode\n");
     342                 :           0 :         HELP0("  \\syncpipeline          add a synchronisation point to an ongoing pipeline\n");
     343                 :             : 
     344                 :             :         /* Now we can count the lines. */
     345                 :           0 :         nlcount = 0;
     346         [ #  # ]:           0 :         for (const char *ptr = buf.data; *ptr; ptr++)
     347                 :             :         {
     348         [ #  # ]:           0 :                 if (*ptr == '\n')
     349                 :           0 :                         nlcount++;
     350                 :           0 :         }
     351                 :             : 
     352                 :             :         /* And dump the output, with appropriate pagination. */
     353                 :           0 :         output = PageOutput(nlcount, pager ? &(pset.popt.topt) : NULL);
     354                 :             : 
     355                 :           0 :         fputs(buf.data, output);
     356                 :             : 
     357                 :           0 :         ClosePager(output);
     358                 :             : 
     359                 :           0 :         termPQExpBuffer(&buf);
     360                 :           0 : }
     361                 :             : 
     362                 :             : 
     363                 :             : /*
     364                 :             :  * helpVariables
     365                 :             :  *
     366                 :             :  * show list of available variables (options) from command line
     367                 :             :  */
     368                 :             : void
     369                 :           0 : helpVariables(unsigned short int pager)
     370                 :             : {
     371                 :           0 :         PQExpBufferData buf;
     372                 :           0 :         int                     nlcount;
     373                 :           0 :         FILE       *output;
     374                 :             : 
     375                 :             :         /*
     376                 :             :          * To avoid counting the output lines manually, build the output in "buf"
     377                 :             :          * and then count them.
     378                 :             :          */
     379                 :           0 :         initPQExpBuffer(&buf);
     380                 :             : 
     381                 :           0 :         HELP0("List of specially treated variables\n\n");
     382                 :             : 
     383                 :           0 :         HELP0("psql variables:\n");
     384                 :           0 :         HELP0("Usage:\n");
     385                 :           0 :         HELP0("  psql --set=NAME=VALUE\n  or \\set NAME VALUE inside psql\n\n");
     386                 :             : 
     387                 :           0 :         HELP0("  AUTOCOMMIT\n"
     388                 :             :                   "    if set, successful SQL commands are automatically committed\n");
     389                 :           0 :         HELP0("  COMP_KEYWORD_CASE\n"
     390                 :             :                   "    determines the case used to complete SQL key words\n"
     391                 :             :                   "    [lower, upper, preserve-lower, preserve-upper]\n");
     392                 :           0 :         HELP0("  DBNAME\n"
     393                 :             :                   "    the currently connected database name\n");
     394                 :           0 :         HELP0("  ECHO\n"
     395                 :             :                   "    controls what input is written to standard output\n"
     396                 :             :                   "    [all, errors, none, queries]\n");
     397                 :           0 :         HELP0("  ECHO_HIDDEN\n"
     398                 :             :                   "    if set, display internal queries executed by backslash commands;\n"
     399                 :             :                   "    if set to \"noexec\", just show them without execution\n");
     400                 :           0 :         HELP0("  ENCODING\n"
     401                 :             :                   "    current client character set encoding\n");
     402                 :           0 :         HELP0("  ERROR\n"
     403                 :             :                   "    \"true\" if last query failed, else \"false\"\n");
     404                 :           0 :         HELP0("  FETCH_COUNT\n"
     405                 :             :                   "    the number of result rows to fetch and display at a time (0 = unlimited)\n");
     406                 :           0 :         HELP0("  HIDE_TABLEAM\n"
     407                 :             :                   "    if set, table access methods are not displayed\n");
     408                 :           0 :         HELP0("  HIDE_TOAST_COMPRESSION\n"
     409                 :             :                   "    if set, compression methods are not displayed\n");
     410                 :           0 :         HELP0("  HISTCONTROL\n"
     411                 :             :                   "    controls command history [ignorespace, ignoredups, ignoreboth]\n");
     412                 :           0 :         HELP0("  HISTFILE\n"
     413                 :             :                   "    file name used to store the command history\n");
     414                 :           0 :         HELP0("  HISTSIZE\n"
     415                 :             :                   "    maximum number of commands to store in the command history\n");
     416                 :           0 :         HELP0("  HOST\n"
     417                 :             :                   "    the currently connected database server host\n");
     418                 :           0 :         HELP0("  IGNOREEOF\n"
     419                 :             :                   "    number of EOFs needed to terminate an interactive session\n");
     420                 :           0 :         HELP0("  LASTOID\n"
     421                 :             :                   "    value of the last affected OID\n");
     422                 :           0 :         HELP0("  LAST_ERROR_MESSAGE\n"
     423                 :             :                   "  LAST_ERROR_SQLSTATE\n"
     424                 :             :                   "    message and SQLSTATE of last error, or empty string and \"00000\" if none\n");
     425                 :           0 :         HELP0("  ON_ERROR_ROLLBACK\n"
     426                 :             :                   "    if set, an error doesn't stop a transaction (uses implicit savepoints)\n");
     427                 :           0 :         HELP0("  ON_ERROR_STOP\n"
     428                 :             :                   "    stop batch execution after error\n");
     429                 :           0 :         HELP0("  PORT\n"
     430                 :             :                   "    server port of the current connection\n");
     431                 :           0 :         HELP0("  PROMPT1\n"
     432                 :             :                   "    specifies the standard psql prompt\n");
     433                 :           0 :         HELP0("  PROMPT2\n"
     434                 :             :                   "    specifies the prompt used when a statement continues from a previous line\n");
     435                 :           0 :         HELP0("  PROMPT3\n"
     436                 :             :                   "    specifies the prompt used during COPY ... FROM STDIN\n");
     437                 :           0 :         HELP0("  QUIET\n"
     438                 :             :                   "    run quietly (same as -q option)\n");
     439                 :           0 :         HELP0("  ROW_COUNT\n"
     440                 :             :                   "    number of rows returned or affected by last query, or 0\n");
     441                 :           0 :         HELP0("  SERVER_VERSION_NAME\n"
     442                 :             :                   "  SERVER_VERSION_NUM\n"
     443                 :             :                   "    server's version (in short string or numeric format)\n");
     444                 :           0 :         HELP0("  SHELL_ERROR\n"
     445                 :             :                   "    \"true\" if the last shell command failed, \"false\" if it succeeded\n");
     446                 :           0 :         HELP0("  SHELL_EXIT_CODE\n"
     447                 :             :                   "    exit status of the last shell command\n");
     448                 :           0 :         HELP0("  SHOW_ALL_RESULTS\n"
     449                 :             :                   "    show all results of a combined query (\\;) instead of only the last\n");
     450                 :           0 :         HELP0("  SHOW_CONTEXT\n"
     451                 :             :                   "    controls display of message context fields [never, errors, always]\n");
     452                 :           0 :         HELP0("  SINGLELINE\n"
     453                 :             :                   "    if set, end of line terminates SQL commands (same as -S option)\n");
     454                 :           0 :         HELP0("  SINGLESTEP\n"
     455                 :             :                   "    single-step mode (same as -s option)\n");
     456                 :           0 :         HELP0("  SQLSTATE\n"
     457                 :             :                   "    SQLSTATE of last query, or \"00000\" if no error\n");
     458                 :           0 :         HELP0("  USER\n"
     459                 :             :                   "    the currently connected database user\n");
     460                 :           0 :         HELP0("  VERBOSITY\n"
     461                 :             :                   "    controls verbosity of error reports [default, verbose, terse, sqlstate]\n");
     462                 :           0 :         HELP0("  VERSION\n"
     463                 :             :                   "  VERSION_NAME\n"
     464                 :             :                   "  VERSION_NUM\n"
     465                 :             :                   "    psql's version (in verbose string, short string, or numeric format)\n");
     466                 :           0 :         HELPN("  WATCH_INTERVAL\n"
     467                 :             :                   "    number of seconds \\watch waits between executions (default %s)\n",
     468                 :             :                   DEFAULT_WATCH_INTERVAL);
     469                 :             : 
     470                 :           0 :         HELP0("\nDisplay settings:\n");
     471                 :           0 :         HELP0("Usage:\n");
     472                 :           0 :         HELP0("  psql --pset=NAME[=VALUE]\n  or \\pset NAME [VALUE] inside psql\n\n");
     473                 :             : 
     474                 :           0 :         HELP0("  border\n"
     475                 :             :                   "    border style (number)\n");
     476                 :           0 :         HELP0("  columns\n"
     477                 :             :                   "    target width for the wrapped format\n");
     478                 :           0 :         HELPN("  csv_fieldsep\n"
     479                 :             :                   "    field separator for CSV output format (default \"%c\")\n",
     480                 :             :                   DEFAULT_CSV_FIELD_SEP);
     481                 :           0 :         HELP0("  display_false\n"
     482                 :             :                   "    set the string to be printed in place of a boolean 'false'\n");
     483                 :           0 :         HELP0("  display_true\n"
     484                 :             :                   "    set the string to be printed in place of a boolean 'true'\n");
     485                 :           0 :         HELP0("  expanded (or x)\n"
     486                 :             :                   "    expanded output [on, off, auto]\n");
     487                 :           0 :         HELPN("  fieldsep\n"
     488                 :             :                   "    field separator for unaligned output (default \"%s\")\n",
     489                 :             :                   DEFAULT_FIELD_SEP);
     490                 :           0 :         HELP0("  fieldsep_zero\n"
     491                 :             :                   "    set field separator for unaligned output to a zero byte\n");
     492                 :           0 :         HELP0("  footer\n"
     493                 :             :                   "    enable or disable display of the table footer [on, off]\n");
     494                 :           0 :         HELP0("  format\n"
     495                 :             :                   "    set output format [unaligned, aligned, wrapped, html, asciidoc, ...]\n");
     496                 :           0 :         HELP0("  linestyle\n"
     497                 :             :                   "    set the border line drawing style [ascii, old-ascii, unicode]\n");
     498                 :           0 :         HELP0("  null\n"
     499                 :             :                   "    set the string to be printed in place of a null value\n");
     500                 :           0 :         HELP0("  numericlocale\n"
     501                 :             :                   "    enable display of a locale-specific character to separate groups of digits\n");
     502                 :           0 :         HELP0("  pager\n"
     503                 :             :                   "    control when an external pager is used [yes, no, always]\n");
     504                 :           0 :         HELP0("  recordsep\n"
     505                 :             :                   "    record (line) separator for unaligned output\n");
     506                 :           0 :         HELP0("  recordsep_zero\n"
     507                 :             :                   "    set record separator for unaligned output to a zero byte\n");
     508                 :           0 :         HELP0("  tableattr (or T)\n"
     509                 :             :                   "    specify attributes for table tag in html format, or proportional\n"
     510                 :             :                   "    column widths for left-aligned data types in latex-longtable format\n");
     511                 :           0 :         HELP0("  title\n"
     512                 :             :                   "    set the table title for subsequently printed tables\n");
     513                 :           0 :         HELP0("  tuples_only\n"
     514                 :             :                   "    if set, only actual table data is shown\n");
     515                 :           0 :         HELP0("  unicode_border_linestyle\n"
     516                 :             :                   "  unicode_column_linestyle\n"
     517                 :             :                   "  unicode_header_linestyle\n"
     518                 :             :                   "    set the style of Unicode line drawing [single, double]\n");
     519                 :           0 :         HELP0("  xheader_width\n"
     520                 :             :                   "    set the maximum width of the header for expanded output\n"
     521                 :             :                   "    [full, column, page, integer value]\n");
     522                 :             : 
     523                 :           0 :         HELP0("\nEnvironment variables:\n");
     524                 :           0 :         HELP0("Usage:\n");
     525                 :             : 
     526                 :             : #ifndef WIN32
     527                 :           0 :         HELP0("  NAME=VALUE [NAME=VALUE] psql ...\n  or \\setenv NAME [VALUE] inside psql\n\n");
     528                 :             : #else
     529                 :             :         HELP0("  set NAME=VALUE\n  psql ...\n  or \\setenv NAME [VALUE] inside psql\n\n");
     530                 :             : #endif
     531                 :             : 
     532                 :           0 :         HELP0("  COLUMNS\n"
     533                 :             :                   "    number of columns for wrapped format\n");
     534                 :           0 :         HELP0("  PGAPPNAME\n"
     535                 :             :                   "    same as the application_name connection parameter\n");
     536                 :           0 :         HELP0("  PGDATABASE\n"
     537                 :             :                   "    same as the dbname connection parameter\n");
     538                 :           0 :         HELP0("  PGHOST\n"
     539                 :             :                   "    same as the host connection parameter\n");
     540                 :           0 :         HELP0("  PGPASSFILE\n"
     541                 :             :                   "    password file name\n");
     542                 :           0 :         HELP0("  PGPASSWORD\n"
     543                 :             :                   "    connection password (not recommended)\n");
     544                 :           0 :         HELP0("  PGPORT\n"
     545                 :             :                   "    same as the port connection parameter\n");
     546                 :           0 :         HELP0("  PGUSER\n"
     547                 :             :                   "    same as the user connection parameter\n");
     548                 :           0 :         HELP0("  PSQL_EDITOR, EDITOR, VISUAL\n"
     549                 :             :                   "    editor used by the \\e, \\ef, and \\ev commands\n");
     550                 :           0 :         HELP0("  PSQL_EDITOR_LINENUMBER_ARG\n"
     551                 :             :                   "    how to specify a line number when invoking the editor\n");
     552                 :           0 :         HELP0("  PSQL_HISTORY\n"
     553                 :             :                   "    alternative location for the command history file\n");
     554                 :           0 :         HELP0("  PSQL_PAGER, PAGER\n"
     555                 :             :                   "    name of external pager program\n");
     556                 :             : #ifndef WIN32
     557                 :           0 :         HELP0("  PSQL_WATCH_PAGER\n"
     558                 :             :                   "    name of external pager program used for \\watch\n");
     559                 :             : #endif
     560                 :           0 :         HELP0("  PSQLRC\n"
     561                 :             :                   "    alternative location for the user's .psqlrc file\n");
     562                 :           0 :         HELP0("  SHELL\n"
     563                 :             :                   "    shell used by the \\! command\n");
     564                 :           0 :         HELP0("  TMPDIR\n"
     565                 :             :                   "    directory for temporary files\n");
     566                 :             : 
     567                 :             :         /* Now we can count the lines. */
     568                 :           0 :         nlcount = 0;
     569         [ #  # ]:           0 :         for (const char *ptr = buf.data; *ptr; ptr++)
     570                 :             :         {
     571         [ #  # ]:           0 :                 if (*ptr == '\n')
     572                 :           0 :                         nlcount++;
     573                 :           0 :         }
     574                 :             : 
     575                 :             :         /* And dump the output, with appropriate pagination. */
     576                 :           0 :         output = PageOutput(nlcount, pager ? &(pset.popt.topt) : NULL);
     577                 :             : 
     578                 :           0 :         fputs(buf.data, output);
     579                 :             : 
     580                 :           0 :         ClosePager(output);
     581                 :             : 
     582                 :           0 :         termPQExpBuffer(&buf);
     583                 :           0 : }
     584                 :             : 
     585                 :             : 
     586                 :             : /*
     587                 :             :  * helpSQL -- help with SQL commands
     588                 :             :  *
     589                 :             :  * Note: we assume caller removed any trailing spaces in "topic".
     590                 :             :  */
     591                 :             : void
     592                 :           0 : helpSQL(const char *topic, unsigned short int pager)
     593                 :             : {
     594                 :             : #define VALUE_OR_NULL(a) ((a) ? (a) : "")
     595                 :             : 
     596   [ #  #  #  # ]:           0 :         if (!topic || strlen(topic) == 0)
     597                 :             :         {
     598                 :             :                 /* Print all the available command names */
     599                 :           0 :                 int                     screen_width;
     600                 :           0 :                 int                     ncolumns;
     601                 :           0 :                 int                     nrows;
     602                 :           0 :                 FILE       *output;
     603                 :           0 :                 int                     i;
     604                 :           0 :                 int                     j;
     605                 :             : 
     606                 :             :                 /* Find screen width to determine how many columns will fit */
     607                 :             : #ifdef TIOCGWINSZ
     608                 :           0 :                 struct winsize screen_size;
     609                 :             : 
     610         [ #  # ]:           0 :                 if (ioctl(fileno(stdout), TIOCGWINSZ, &screen_size) == -1)
     611                 :           0 :                         screen_width = 80;      /* ioctl failed, assume 80 */
     612                 :             :                 else
     613                 :           0 :                         screen_width = screen_size.ws_col;
     614                 :             : #else
     615                 :             :                 screen_width = 80;              /* default assumption */
     616                 :             : #endif
     617                 :             : 
     618                 :           0 :                 ncolumns = (screen_width - 3) / (QL_MAX_CMD_LEN + 1);
     619         [ #  # ]:           0 :                 ncolumns = Max(ncolumns, 1);
     620                 :           0 :                 nrows = (QL_HELP_COUNT + (ncolumns - 1)) / ncolumns;
     621                 :             : 
     622                 :           0 :                 output = PageOutput(nrows + 1, pager ? &(pset.popt.topt) : NULL);
     623                 :             : 
     624                 :           0 :                 fputs(_("Available help:\n"), output);
     625                 :             : 
     626         [ #  # ]:           0 :                 for (i = 0; i < nrows; i++)
     627                 :             :                 {
     628                 :           0 :                         fprintf(output, "  ");
     629         [ #  # ]:           0 :                         for (j = 0; j < ncolumns - 1; j++)
     630                 :           0 :                                 fprintf(output, "%-*s",
     631                 :             :                                                 QL_MAX_CMD_LEN + 1,
     632         [ #  # ]:           0 :                                                 VALUE_OR_NULL(QL_HELP[i + j * nrows].cmd));
     633         [ #  # ]:           0 :                         if (i + j * nrows < QL_HELP_COUNT)
     634                 :           0 :                                 fprintf(output, "%s",
     635         [ #  # ]:           0 :                                                 VALUE_OR_NULL(QL_HELP[i + j * nrows].cmd));
     636                 :           0 :                         fputc('\n', output);
     637                 :           0 :                 }
     638                 :             : 
     639                 :           0 :                 ClosePager(output);
     640                 :           0 :         }
     641                 :             :         else
     642                 :             :         {
     643                 :           0 :                 int                     i,
     644                 :             :                                         pass;
     645                 :           0 :                 FILE       *output = NULL;
     646                 :           0 :                 size_t          len,
     647                 :             :                                         wordlen,
     648                 :             :                                         j;
     649                 :           0 :                 int                     nl_count;
     650                 :             : 
     651                 :             :                 /*
     652                 :             :                  * len is the amount of the input to compare to the help topic names.
     653                 :             :                  * We first try exact match, then first + second words, then first
     654                 :             :                  * word only.
     655                 :             :                  */
     656                 :           0 :                 len = strlen(topic);
     657                 :             : 
     658         [ #  # ]:           0 :                 for (pass = 1; pass <= 3; pass++)
     659                 :             :                 {
     660         [ #  # ]:           0 :                         if (pass > 1)                /* Nothing on first pass - try the opening
     661                 :             :                                                                  * word(s) */
     662                 :             :                         {
     663                 :           0 :                                 wordlen = j = 1;
     664   [ #  #  #  # ]:           0 :                                 while (j < len && topic[j++] != ' ')
     665                 :           0 :                                         wordlen++;
     666   [ #  #  #  # ]:           0 :                                 if (pass == 2 && j < len)
     667                 :             :                                 {
     668                 :           0 :                                         wordlen++;
     669   [ #  #  #  # ]:           0 :                                         while (j < len && topic[j++] != ' ')
     670                 :           0 :                                                 wordlen++;
     671                 :           0 :                                 }
     672         [ #  # ]:           0 :                                 if (wordlen >= len)
     673                 :             :                                 {
     674                 :             :                                         /* Failed to shorten input, so try next pass if any */
     675                 :           0 :                                         continue;
     676                 :             :                                 }
     677                 :           0 :                                 len = wordlen;
     678                 :           0 :                         }
     679                 :             : 
     680                 :             :                         /*
     681                 :             :                          * Count newlines for pager.  This logic must agree with what the
     682                 :             :                          * following loop will do!
     683                 :             :                          */
     684                 :           0 :                         nl_count = 0;
     685         [ #  # ]:           0 :                         for (i = 0; QL_HELP[i].cmd; i++)
     686                 :             :                         {
     687   [ #  #  #  # ]:           0 :                                 if (pg_strncasecmp(topic, QL_HELP[i].cmd, len) == 0 ||
     688                 :           0 :                                         strcmp(topic, "*") == 0)
     689                 :             :                                 {
     690                 :             :                                         /* magic constant here must match format below! */
     691                 :           0 :                                         nl_count += 7 + QL_HELP[i].nl_count;
     692                 :             : 
     693                 :             :                                         /* If we have an exact match, exit.  Fixes \h SELECT */
     694         [ #  # ]:           0 :                                         if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0)
     695                 :           0 :                                                 break;
     696                 :           0 :                                 }
     697                 :           0 :                         }
     698                 :             :                         /* If no matches, don't open the output yet */
     699         [ #  # ]:           0 :                         if (nl_count == 0)
     700                 :           0 :                                 continue;
     701                 :             : 
     702         [ #  # ]:           0 :                         if (!output)
     703                 :           0 :                                 output = PageOutput(nl_count, pager ? &(pset.popt.topt) : NULL);
     704                 :             : 
     705         [ #  # ]:           0 :                         for (i = 0; QL_HELP[i].cmd; i++)
     706                 :             :                         {
     707   [ #  #  #  # ]:           0 :                                 if (pg_strncasecmp(topic, QL_HELP[i].cmd, len) == 0 ||
     708                 :           0 :                                         strcmp(topic, "*") == 0)
     709                 :             :                                 {
     710                 :           0 :                                         PQExpBufferData buffer;
     711                 :           0 :                                         char       *url;
     712                 :             : 
     713                 :           0 :                                         initPQExpBuffer(&buffer);
     714                 :           0 :                                         QL_HELP[i].syntaxfunc(&buffer);
     715                 :           0 :                                         url = psprintf("https://www.postgresql.org/docs/%s/%s.html",
     716                 :           0 :                                                                    strstr(PG_VERSION, "devel") ? "devel" : PG_MAJORVERSION,
     717                 :           0 :                                                                    QL_HELP[i].docbook_id);
     718                 :             :                                         /* # of newlines in format must match constant above! */
     719                 :           0 :                                         fprintf(output, _("Command:     %s\n"
     720                 :             :                                                                           "Description: %s\n"
     721                 :             :                                                                           "Syntax:\n%s\n\n"
     722                 :             :                                                                           "URL: %s\n\n"),
     723                 :           0 :                                                         QL_HELP[i].cmd,
     724                 :           0 :                                                         _(QL_HELP[i].help),
     725                 :           0 :                                                         buffer.data,
     726                 :           0 :                                                         url);
     727                 :           0 :                                         free(url);
     728                 :           0 :                                         termPQExpBuffer(&buffer);
     729                 :             : 
     730                 :             :                                         /* If we have an exact match, exit.  Fixes \h SELECT */
     731         [ #  # ]:           0 :                                         if (pg_strcasecmp(topic, QL_HELP[i].cmd) == 0)
     732                 :           0 :                                                 break;
     733      [ #  #  # ]:           0 :                                 }
     734                 :           0 :                         }
     735                 :           0 :                         break;
     736                 :             :                 }
     737                 :             : 
     738                 :             :                 /* If we never found anything, report that */
     739         [ #  # ]:           0 :                 if (!output)
     740                 :             :                 {
     741                 :           0 :                         output = PageOutput(2, pager ? &(pset.popt.topt) : NULL);
     742                 :           0 :                         fprintf(output, _("No help available for \"%s\".\n"
     743                 :             :                                                           "Try \\h with no arguments to see available help.\n"),
     744                 :           0 :                                         topic);
     745                 :           0 :                 }
     746                 :             : 
     747                 :           0 :                 ClosePager(output);
     748                 :           0 :         }
     749                 :           0 : }
     750                 :             : 
     751                 :             : 
     752                 :             : 
     753                 :             : void
     754                 :           0 : print_copyright(void)
     755                 :             : {
     756                 :           0 :         puts("PostgreSQL Database Management System\n"
     757                 :             :                  "(also known as Postgres, formerly known as Postgres95)\n\n"
     758                 :             :                  "Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group\n\n"
     759                 :             :                  "Portions Copyright (c) 1994, The Regents of the University of California\n\n"
     760                 :             :                  "Permission to use, copy, modify, and distribute this software and its\n"
     761                 :             :                  "documentation for any purpose, without fee, and without a written agreement\n"
     762                 :             :                  "is hereby granted, provided that the above copyright notice and this\n"
     763                 :             :                  "paragraph and the following two paragraphs appear in all copies.\n\n"
     764                 :             :                  "IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR\n"
     765                 :             :                  "DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING\n"
     766                 :             :                  "LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS\n"
     767                 :             :                  "DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE\n"
     768                 :             :                  "POSSIBILITY OF SUCH DAMAGE.\n\n"
     769                 :             :                  "THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,\n"
     770                 :             :                  "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\n"
     771                 :             :                  "AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS\n"
     772                 :             :                  "ON AN \"AS IS\" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO\n"
     773                 :             :                  "PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.\n");
     774                 :           0 : }
        

Generated by: LCOV version 2.3.2-1