Changeset: d86ce85e9b5a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d86ce85e9b5a
Modified Files:
        
Branch: default
Log Message:

Merge with Oct2010 branch.


diffs (81 lines):

diff -r e16ff2ece465 -r d86ce85e9b5a clients/src/mapiclient/prompt.c
--- a/clients/src/mapiclient/prompt.c   Mon Sep 20 15:23:01 2010 +0200
+++ b/clients/src/mapiclient/prompt.c   Mon Sep 20 16:19:44 2010 +0200
@@ -24,13 +24,16 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <string.h>
+#ifndef _MSC_VER
 #ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #endif
+#endif
 #include "mprompt.h"
 
 #ifdef _MSC_VER
 #define fileno _fileno
+#include <conio.h>
 #endif
 
 #ifndef HAVE_GETLOGIN
@@ -56,6 +59,46 @@
 #endif
 }
 
+#ifdef _MSC_VER
+char *
+simple_prompt(const char *prompt, int maxlen, int echo, const char *def)
+{
+       size_t length = 0;
+       char *destination = NULL;
+
+       destination = (char *) malloc(maxlen + 2);
+       if (!destination)
+               return NULL;
+
+       if (prompt) {
+               _cputs(prompt);
+               if (def) {
+                       _cputs("(");
+                       _cputs(def);
+                       _cputs(")");
+               }
+               _cputs(":");
+       }
+       if (echo) {
+               _cgets_s(destination, maxlen, &length);
+               while (length > 0 &&
+                      (destination[length - 1] == '\n' ||
+                       destination[length - 1] == '\r'))
+                       destination[--length] = 0;
+       } else {
+               int c;
+
+               while ((c = _getch()) != '\r' && c != '\n') {
+                       if (length < (size_t) maxlen)
+                               destination[length++] = c;
+               }
+               destination[length] = 0;
+       }
+       if (length == 0 && def)
+               strcpy(destination, def);
+       return destination;
+}
+#else
 char *
 simple_prompt(const char *prompt, int maxlen, int echo, const char *def)
 {
@@ -132,3 +175,4 @@
                strcpy(destination, def);
        return destination;
 }
+#endif /* _MSC_VER */
diff -r e16ff2ece465 -r d86ce85e9b5a python/setup.py
--- a/python/setup.py   Mon Sep 20 15:23:01 2010 +0200
+++ b/python/setup.py   Mon Sep 20 16:19:44 2010 +0200
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
 # The contents of this file are subject to the MonetDB Public License
 # Version 1.1 (the "License"); you may not use this file except in
 # compliance with the License. You may obtain a copy of the License at
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to