Mercurial > hg > nnchat
comparison nnchat.c @ 405:b4ed5d574edc
Add some empty lines.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 24 May 2012 05:31:18 +0300 |
parents | d11a68f214eb |
children | 8a5a81c465f0 |
comparison
equal
deleted
inserted
replaced
404:d11a68f214eb | 405:b4ed5d574edc |
---|---|
1130 th_free(tmpStr); | 1130 th_free(tmpStr); |
1131 | 1131 |
1132 return result ? 0 : -1; | 1132 return result ? 0 : -1; |
1133 } | 1133 } |
1134 | 1134 |
1135 | |
1135 void closeWindows(void) | 1136 void closeWindows(void) |
1136 { | 1137 { |
1137 if (mainWin) delwin(mainWin); | 1138 if (mainWin) delwin(mainWin); |
1138 if (statusWin) delwin(statusWin); | 1139 if (statusWin) delwin(statusWin); |
1139 if (editWin) delwin(editWin); | 1140 if (editWin) delwin(editWin); |
1140 } | 1141 } |
1141 | 1142 |
1143 | |
1142 BOOL initializeWindows(void) | 1144 BOOL initializeWindows(void) |
1143 { | 1145 { |
1144 int w, h; | 1146 int w, h; |
1145 | 1147 |
1146 getmaxyx(stdscr, h, w); | 1148 getmaxyx(stdscr, h, w); |
1155 return FALSE; | 1157 return FALSE; |
1156 | 1158 |
1157 return TRUE; | 1159 return TRUE; |
1158 } | 1160 } |
1159 | 1161 |
1162 | |
1160 void updateWindows(void) | 1163 void updateWindows(void) |
1161 { | 1164 { |
1162 if (mainWin) redrawwin(mainWin); | 1165 if (mainWin) redrawwin(mainWin); |
1163 if (statusWin) redrawwin(statusWin); | 1166 if (statusWin) redrawwin(statusWin); |
1164 if (editWin) redrawwin(editWin); | 1167 if (editWin) redrawwin(editWin); |
1165 } | 1168 } |
1169 | |
1166 | 1170 |
1167 BOOL performTabCompletion(nn_editbuf_t *buf) | 1171 BOOL performTabCompletion(nn_editbuf_t *buf) |
1168 { | 1172 { |
1169 static char *previous = NULL, *pattern = NULL; | 1173 static char *previous = NULL, *pattern = NULL; |
1170 BOOL again = FALSE, hasSeparator = FALSE, newPattern = FALSE, hasSpace = FALSE; | 1174 BOOL again = FALSE, hasSeparator = FALSE, newPattern = FALSE, hasSpace = FALSE; |
1288 } | 1292 } |
1289 | 1293 |
1290 return FALSE; | 1294 return FALSE; |
1291 } | 1295 } |
1292 | 1296 |
1297 | |
1293 #define VPUTCH(CH) th_vputch(&bufData, &bufSize, &bufLen, CH) | 1298 #define VPUTCH(CH) th_vputch(&bufData, &bufSize, &bufLen, CH) |
1294 #define VPUTS(STR) th_vputs(&bufData, &bufSize, &bufLen, STR) | 1299 #define VPUTS(STR) th_vputs(&bufData, &bufSize, &bufLen, STR) |
1295 | 1300 |
1296 char *logParseFilename(const char *fmt, int id) | 1301 char *logParseFilename(const char *fmt, int id) |
1297 { | 1302 { |
1354 th_free(filename); | 1359 th_free(filename); |
1355 | 1360 |
1356 return TRUE; | 1361 return TRUE; |
1357 } | 1362 } |
1358 | 1363 |
1364 | |
1359 void logFileClose(void) | 1365 void logFileClose(void) |
1360 { | 1366 { |
1361 if (optLogFile) | 1367 if (optLogFile) |
1362 { | 1368 { |
1363 fclose(optLogFile); | 1369 fclose(optLogFile); |
1364 optLogFile = NULL; | 1370 optLogFile = NULL; |
1365 } | 1371 } |
1366 } | 1372 } |
1373 | |
1367 | 1374 |
1368 char *promptRequester(WINDOW *win, const char *info, BOOL allowEmpty) | 1375 char *promptRequester(WINDOW *win, const char *info, BOOL allowEmpty) |
1369 { | 1376 { |
1370 char tmpBuf[512], *ptr; | 1377 char tmpBuf[512], *ptr; |
1371 ssize_t pos; | 1378 ssize_t pos; |
1386 if (allowEmpty || strlen(ptr) > 0) | 1393 if (allowEmpty || strlen(ptr) > 0) |
1387 return th_strdup(ptr); | 1394 return th_strdup(ptr); |
1388 else | 1395 else |
1389 return NULL; | 1396 return NULL; |
1390 } | 1397 } |
1398 | |
1391 | 1399 |
1392 void printHelp(void) | 1400 void printHelp(void) |
1393 { | 1401 { |
1394 printMsgQ(currWin, "\n" | 1402 printMsgQ(currWin, "\n" |
1395 "NNChat Help\n" | 1403 "NNChat Help\n" |
1397 "\n" | 1405 "\n" |
1398 "F1 This help.\n" | 1406 "F1 This help.\n" |
1399 "F2 \n" | 1407 "F2 \n" |
1400 ); | 1408 ); |
1401 } | 1409 } |
1410 | |
1402 | 1411 |
1403 int main(int argc, char *argv[]) | 1412 int main(int argc, char *argv[]) |
1404 { | 1413 { |
1405 nn_conn_t *conn = NULL; | 1414 nn_conn_t *conn = NULL; |
1406 int curVis = ERR, updateCount = 0; | 1415 int curVis = ERR, updateCount = 0; |