|
|
#include "mit-copyright.h"
#include "text_operations.h"
#include "char_stack.h"
Go to the source code of this file.
Functions | |
string | lany (string *text_ptr, string str) |
string | lbreak (string *text_ptr, character_class set) |
string | lspan (string *text_ptr, character_class set) |
string | rany (string *text_ptr, string str) |
string | rbreak (string *text_ptr, character_class set) |
string | rspan (string *text_ptr, character_class set) |
string | paragraph (string *text_ptr, int width) |
|
Definition at line 15 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00018 { 00019 string result, whats_left; 00020 char *p = *text_ptr; 00021 00022 while (*p && *str) 00023 p++, str++; 00024 00025 result = string_CreateFromData(*text_ptr, p - *text_ptr); 00026 whats_left = string_Copy(p); 00027 free(*text_ptr); 00028 *text_ptr = whats_left; 00029 00030 return (result); 00031 }
|
|
Definition at line 34 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00037 { 00038 string result, whats_left; 00039 char *p = *text_ptr; 00040 00041 while (*p && !set[(int) *p]) 00042 p++; 00043 00044 result = string_CreateFromData(*text_ptr, p - *text_ptr); 00045 whats_left = string_Copy(p); 00046 free(*text_ptr); 00047 *text_ptr = whats_left; 00048 00049 return (result); 00050 }
|
|
Definition at line 53 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00056 { 00057 string result, whats_left; 00058 char *p = *text_ptr; 00059 00060 while (*p && set[(int) *p]) 00061 p++; 00062 00063 result = string_CreateFromData(*text_ptr, p - *text_ptr); 00064 whats_left = string_Copy(p); 00065 free(*text_ptr); 00066 *text_ptr = whats_left; 00067 00068 return (result); 00069 }
|
|
Definition at line 132 of file text_operations.c. References string, and string_Copy. 00135 { 00136 string result; 00137 char *p, *back, *s, *t; 00138 00139 result = string_Copy(*text_ptr); 00140 00141 p = result; 00142 s = result; 00143 t = result; 00144 while (1) { 00145 if (strlen(p) > width) { 00146 p = p + width; 00147 t = p; 00148 back = p; 00149 while (*back != ' ' && *back != '\n' && 00150 *back != '\t' && back != s) { 00151 back--; 00152 } 00153 if (back != s && *back != '\n') { 00154 *back = '\n'; 00155 } 00156 else { 00157 back = t; 00158 while (*back != ' ' && *back != '\n' && 00159 *back != '\t' && *back != '\0') { 00160 back++; 00161 } 00162 if (*back != '\0' && *back != '\n') { 00163 *back = '\n'; 00164 } 00165 if (*back == '\0') { 00166 break; 00167 } 00168 } 00169 p = back + 1; 00170 if (*p == '\0') { 00171 break; 00172 } 00173 } 00174 else { 00175 break; 00176 } 00177 } 00178 00179 return (result); 00180 }
|
|
Definition at line 72 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00075 { 00076 string result, whats_left; 00077 string text = *text_ptr; 00078 char *p = text + strlen(text); 00079 00080 while (text < p && *str) 00081 p--, str++; 00082 00083 result = string_Copy(p); 00084 whats_left = string_CreateFromData(text, p - text); 00085 free(text); 00086 *text_ptr = whats_left; 00087 00088 return (result); 00089 }
|
|
Definition at line 92 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00095 { 00096 string result, whats_left; 00097 string text = *text_ptr; 00098 char *p = text + strlen(text); 00099 00100 while (text < p && !set[(int) p[-1]]) 00101 p--; 00102 00103 result = string_Copy(p); 00104 whats_left = string_CreateFromData(text, p - text); 00105 free(text); 00106 *text_ptr = whats_left; 00107 00108 return (result); 00109 }
|
|
Definition at line 112 of file text_operations.c. References string, string_Copy, and string_CreateFromData. 00115 { 00116 string result, whats_left; 00117 string text = *text_ptr; 00118 char *p = text + strlen(text); 00119 00120 while (text < p && set[(int) p[-1]]) 00121 p--; 00122 00123 result = string_Copy(p); 00124 whats_left = string_CreateFromData(text, p - text); 00125 free(text); 00126 *text_ptr = whats_left; 00127 00128 return (result); 00129 }
|
Last updated at Tue Dec 18 21:07:42 PST 2007. | This site and project hosted by... |