RELEASE/1.2debug-cidebug-ci-sanitisersfaster-cavernloglog-selectstereostereo-2025walls-datawalls-data-hanging-as-warningwarn-only-for-hanging-survey
|
Last change
on this file since bd2e33a was
bd2e33a,
checked in by Olly Betts <olly@…>, 12 years ago
|
|
src/: Make cad3d remap control characters and spaces in station
names when generating PLT output in the same way aven does.
|
-
Property mode set to
100644
|
|
File size:
1.3 KB
|
| Rev | Line | |
|---|
| [99d5754] | 1 | /* append a string */ |
|---|
| [bd2e33a] | 2 | /* Copyright (c) Olly Betts 1999, 2001, 2012, 2014 |
|---|
| [9286525] | 3 | * |
|---|
| [89231c4] | 4 | * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | * it under the terms of the GNU General Public License as published by |
|---|
| 6 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | * (at your option) any later version. |
|---|
| [846746e] | 8 | * |
|---|
| 9 | * This program is distributed in the hope that it will be useful, |
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| [89231c4] | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | * GNU General Public License for more details. |
|---|
| [846746e] | 13 | * |
|---|
| [89231c4] | 14 | * You should have received a copy of the GNU General Public License |
|---|
| 15 | * along with this program; if not, write to the Free Software |
|---|
| [ecbc6c18] | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| [846746e] | 17 | */ |
|---|
| [30d80d2] | 18 | |
|---|
| 19 | #include "osalloc.h" |
|---|
| 20 | |
|---|
| [99d5754] | 21 | void s_cat(char **pstr, int *plen, char *s); |
|---|
| 22 | |
|---|
| [bd2e33a] | 23 | void s_cat_len(char **pstr, int *plen, char *s, int s_len); |
|---|
| 24 | |
|---|
| [99d5754] | 25 | /* append a character */ |
|---|
| [eb18f4d] | 26 | void s_catchar(char **pstr, int *plen, char /*ch*/); |
|---|
| [99d5754] | 27 | |
|---|
| 28 | /* truncate string to zero length */ |
|---|
| [30d80d2] | 29 | #define s_zero(P) do { \ |
|---|
| 30 | char **s_zero__P = (P); \ |
|---|
| 31 | if (*s_zero__P) **s_zero__P = '\0'; \ |
|---|
| 32 | } while (0) |
|---|
| [99d5754] | 33 | |
|---|
| [30d80d2] | 34 | #define s_free(P) do { \ |
|---|
| 35 | char **s_free__P = (P); \ |
|---|
| 36 | if (*s_free__P) { \ |
|---|
| 37 | osfree(*s_free__P); \ |
|---|
| 38 | *s_free__P = NULL; \ |
|---|
| 39 | } \ |
|---|
| 40 | } while (0) |
|---|
Note: See
TracBrowser
for help on using the repository browser.