Jspice3
quote.c File Reference
#include "spice.h"
#include "cpdefs.h"
#include "suffix.h"
Include dependency graph for quote.c:

Go to the source code of this file.

Functions

void cp_wstrip (char *str)
 
void cp_quoteword (char *str)
 
void cp_printword (char *string, FILE *fp)
 
void cp_striplist (wordlist *wlist)
 
void cp_unquote (char *string)
 

Function Documentation

void cp_printword ( char *  string,
FILE *  fp 
)

Definition at line 54 of file quote.c.

58 {
59  char *s;
60 
61  if (string)
62  for (s = string; *s; s++)
63  (void) putc((strip(*s)), fp);
64  return;
65 }
#define strip(c)
Definition: cpdefs.h:75
Definition: cddefs.h:119
void cp_quoteword ( char *  str)

Definition at line 38 of file quote.c.

41 {
42  if (str)
43  while (*str) {
44  *str = quote(*str);
45  str++;
46  }
47  return;
48 }
#define quote(c)
Definition: cpdefs.h:74
void cp_striplist ( wordlist wlist)

Definition at line 71 of file quote.c.

74 {
75  wordlist *wl;
76 
77  for (wl = wlist; wl; wl = wl->wl_next)
78  cp_wstrip(wl->wl_word);
79  return;
80 }
void cp_wstrip(char *str)
Definition: quote.c:22
Definition: library.c:18
Definition: cpstd.h:21
struct wordlist * wl_next
Definition: cpstd.h:23
char * wl_word
Definition: cpstd.h:22
void cp_unquote ( char *  string)

Definition at line 86 of file quote.c.

89 {
90  char *s;
91  int l;
92 
93  if (string == NULL) return;
94  s = string;
95  if (*s == '"')
96  while (*s) {
97  *(s) = *(s+1);
98  s++;
99  }
100  l = strlen(string) - 1;
101 
102  if (string[l] == '"')
103  string[l] = '\0';
104 
105  return;
106 }
Definition: cddefs.h:119
Definition: cddefs.h:312
#define NULL
Definition: spdefs.h:121
void cp_wstrip ( char *  str)

Definition at line 22 of file quote.c.

25 {
26  if (str)
27  while (*str) {
28  *str = strip(*str);
29  str++;
30  }
31  return;
32 }
#define strip(c)
Definition: cpdefs.h:75