22 char* readPointer = text;
23 char* writePointer = text;
25 GArray* pairs = g_array_new(FALSE, FALSE,
sizeof(
pairPosOff));
26 for( iAmVisible = FALSE; *readPointer; readPointer++)
28 if(*readPointer == invisible){
36 pair.pos = writePointer-text;
38 g_array_append_val(pairs, pair);
41 *writePointer++ = *readPointer;
55 char* readPointer = text;
56 char* writePointer = text;
57 GArray* pairs = g_array_new(FALSE, FALSE,
sizeof(
pairPosOff));
58 for( cutOff=1; *readPointer; readPointer++)
60 if((*readPointer!=
' ') && (cutOff>0)){
63 pair.off = readPointer-writePointer;
64 g_array_append_val(pairs, pair);
66 if(*readPointer==
' '){
73 start = writePointer+1-text;
76 *writePointer++ = *readPointer;
83 inline pairPosOff* getPairPosOff(GArray* in,
int index)
88 int uncollapsePosition(
int collapsedPos, GArray* shifter)
92 for (shifterIndex = 1; shifterIndex < shifter->len; ++shifterIndex) {
93 thePoA = getPairPosOff(shifter, shifterIndex);
94 if (thePoA->pos > collapsedPos) {
98 thePoA = getPairPosOff(shifter, shifterIndex - 1);
99 return collapsedPos + thePoA->off;
GArray * collapseInvisible(char *text, char invisible)
GArray * collapseSpaces(char *text)
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>....