mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	Moved mch_get_host_name and renamed it to os_get_hostanme
This commit is contained in:
		 Stefan Hoffmann
					Stefan Hoffmann
				
			
				
					committed by
					
						 Thiago de Arruda
						Thiago de Arruda
					
				
			
			
				
	
			
			
			 Thiago de Arruda
						Thiago de Arruda
					
				
			
						parent
						
							a8013f2bb1
						
					
				
				
					commit
					e76249c813
				
			| @@ -9,6 +9,7 @@ const char *os_getenv(const char *name); | ||||
| int os_setenv(const char *name, const char *value, int override); | ||||
| char *os_getenvname_at_index(size_t index); | ||||
| long os_get_pid(void); | ||||
| void os_get_hostname(char *hostname, size_t len); | ||||
| ]] | ||||
|  | ||||
| NULL = ffi.cast 'void*', 0 | ||||
| @@ -104,3 +105,13 @@ describe 'env function', -> | ||||
|         -- /proc is not avaliable on all systems, test if pid is nonzero. | ||||
|         eq true, (env.os_get_pid! > 0) | ||||
|  | ||||
|   describe 'os_get_hostname', -> | ||||
|  | ||||
|     it 'returns the hostname', -> | ||||
|       handle = io.popen 'hostname' | ||||
|       hostname = handle\read '*l' | ||||
|       handle\close! | ||||
|       hostname_buf = cstr 255, '' | ||||
|       env.os_get_hostname hostname_buf, 255 | ||||
|       eq hostname,  (ffi.string hostname_buf) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user