18 #include "nomos_gap.h" 33 char* readPointer = text;
34 char* writePointer = text;
36 GArray* pairs = g_array_new(FALSE, FALSE,
sizeof(
pairPosOff));
37 for( iAmVisible = FALSE; *readPointer; readPointer++)
39 if(*readPointer == invisible){
47 pair.pos = writePointer-text;
49 g_array_append_val(pairs, pair);
52 *writePointer++ = *readPointer;
66 char* readPointer = text;
67 char* writePointer = text;
68 GArray* pairs = g_array_new(FALSE, FALSE,
sizeof(
pairPosOff));
69 for( cutOff=1; *readPointer; readPointer++)
71 if((*readPointer!=
' ') && (cutOff>0)){
74 pair.off = readPointer-writePointer;
75 g_array_append_val(pairs, pair);
77 if(*readPointer==
' '){
84 start = writePointer+1-text;
87 *writePointer++ = *readPointer;
94 inline pairPosOff* getPairPosOff(GArray* in,
int index)
99 int uncollapsePosition(
int collapsedPos, GArray* shifter)
103 for (shifterIndex = 1; shifterIndex < shifter->len; ++shifterIndex) {
104 thePoA = getPairPosOff(shifter, shifterIndex);
105 if (thePoA->pos > collapsedPos) {
109 thePoA = getPairPosOff(shifter, shifterIndex - 1);
110 return collapsedPos + thePoA->off;
GArray * collapseInvisible(char *text, char invisible)
start($application)
start the application Assumes application is restartable via /etc/init.d/<script>. The application passed in should match the script name in /etc/init.d
GArray * collapseSpaces(char *text)