Mercurial > vim
comparison src/structs.h @ 7957:b74549818500 v7.4.1274
commit https://github.com/vim/vim/commit/835dc636a5350f610b62f110227d2363b5b2880a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 7 14:27:38 2016 +0100
patch 7.4.1274
Problem: Cannot run a job.
Solution: Add job_start(), job_status() and job_stop(). Currently only works
for Unix.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 07 Feb 2016 14:30:04 +0100 |
parents | e875f0fbd9c0 |
children | 45ea5ebf3a98 |
comparison
equal
deleted
inserted
replaced
7956:31dfe91e5016 | 7957:b74549818500 |
---|---|
1108 #endif | 1108 #endif |
1109 typedef double float_T; | 1109 typedef double float_T; |
1110 | 1110 |
1111 typedef struct listvar_S list_T; | 1111 typedef struct listvar_S list_T; |
1112 typedef struct dictvar_S dict_T; | 1112 typedef struct dictvar_S dict_T; |
1113 typedef struct jobvar_S job_T; | |
1113 | 1114 |
1114 typedef enum | 1115 typedef enum |
1115 { | 1116 { |
1116 VAR_UNKNOWN = 0, | 1117 VAR_UNKNOWN = 0, |
1117 VAR_NUMBER, /* "v_number" is used */ | 1118 VAR_NUMBER, /* "v_number" is used */ |
1118 VAR_STRING, /* "v_string" is used */ | 1119 VAR_STRING, /* "v_string" is used */ |
1119 VAR_FUNC, /* "v_string" is function name */ | 1120 VAR_FUNC, /* "v_string" is function name */ |
1120 VAR_LIST, /* "v_list" is used */ | 1121 VAR_LIST, /* "v_list" is used */ |
1121 VAR_DICT, /* "v_dict" is used */ | 1122 VAR_DICT, /* "v_dict" is used */ |
1122 VAR_FLOAT, /* "v_float" is used */ | 1123 VAR_FLOAT, /* "v_float" is used */ |
1123 VAR_SPECIAL /* "v_number" is used */ | 1124 VAR_SPECIAL, /* "v_number" is used */ |
1125 VAR_JOB /* "v_job" is used */ | |
1124 } vartype_T; | 1126 } vartype_T; |
1125 | 1127 |
1126 /* | 1128 /* |
1127 * Structure to hold an internal variable without a name. | 1129 * Structure to hold an internal variable without a name. |
1128 */ | 1130 */ |
1137 float_T v_float; /* floating number value */ | 1139 float_T v_float; /* floating number value */ |
1138 #endif | 1140 #endif |
1139 char_u *v_string; /* string value (can be NULL!) */ | 1141 char_u *v_string; /* string value (can be NULL!) */ |
1140 list_T *v_list; /* list value (can be NULL!) */ | 1142 list_T *v_list; /* list value (can be NULL!) */ |
1141 dict_T *v_dict; /* dict value (can be NULL!) */ | 1143 dict_T *v_dict; /* dict value (can be NULL!) */ |
1144 #ifdef FEAT_JOB | |
1145 job_T *v_job; /* job value (can be NULL!) */ | |
1146 #endif | |
1142 } vval; | 1147 } vval; |
1143 } typval_T; | 1148 } typval_T; |
1144 | 1149 |
1145 /* Values for "dv_scope". */ | 1150 /* Values for "dv_scope". */ |
1146 #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ | 1151 #define VAR_SCOPE 1 /* a:, v:, s:, etc. scope dictionaries */ |
1202 { | 1207 { |
1203 typval_T di_tv; /* type and value of the variable */ | 1208 typval_T di_tv; /* type and value of the variable */ |
1204 char_u di_flags; /* flags (only used for variable) */ | 1209 char_u di_flags; /* flags (only used for variable) */ |
1205 char_u di_key[1]; /* key (actually longer!) */ | 1210 char_u di_key[1]; /* key (actually longer!) */ |
1206 }; | 1211 }; |
1207 | |
1208 typedef struct dictitem_S dictitem_T; | 1212 typedef struct dictitem_S dictitem_T; |
1209 | 1213 |
1210 #define DI_FLAGS_RO 1 /* "di_flags" value: read-only variable */ | 1214 #define DI_FLAGS_RO 1 /* "di_flags" value: read-only variable */ |
1211 #define DI_FLAGS_RO_SBX 2 /* "di_flags" value: read-only in the sandbox */ | 1215 #define DI_FLAGS_RO_SBX 2 /* "di_flags" value: read-only in the sandbox */ |
1212 #define DI_FLAGS_FIX 4 /* "di_flags" value: fixed: no :unlet or remove() */ | 1216 #define DI_FLAGS_FIX 4 /* "di_flags" value: fixed: no :unlet or remove() */ |
1224 int dv_copyID; /* ID used by deepcopy() */ | 1228 int dv_copyID; /* ID used by deepcopy() */ |
1225 hashtab_T dv_hashtab; /* hashtab that refers to the items */ | 1229 hashtab_T dv_hashtab; /* hashtab that refers to the items */ |
1226 dict_T *dv_copydict; /* copied dict used by deepcopy() */ | 1230 dict_T *dv_copydict; /* copied dict used by deepcopy() */ |
1227 dict_T *dv_used_next; /* next dict in used dicts list */ | 1231 dict_T *dv_used_next; /* next dict in used dicts list */ |
1228 dict_T *dv_used_prev; /* previous dict in used dicts list */ | 1232 dict_T *dv_used_prev; /* previous dict in used dicts list */ |
1233 }; | |
1234 | |
1235 typedef enum | |
1236 { | |
1237 JOB_FAILED, | |
1238 JOB_STARTED, | |
1239 JOB_ENDED | |
1240 } jobstatus_T; | |
1241 | |
1242 /* | |
1243 * Structure to hold info about a Job. | |
1244 */ | |
1245 struct jobvar_S | |
1246 { | |
1247 #ifdef UNIX | |
1248 pid_t jv_pid; | |
1249 int jv_exitval; | |
1250 #endif | |
1251 #ifdef WIN32 | |
1252 PROCESS_INFORMATION jf_pi; | |
1253 #endif | |
1254 jobstatus_T jv_status; | |
1255 | |
1256 int jv_refcount; /* reference count */ | |
1229 }; | 1257 }; |
1230 | 1258 |
1231 /* structure used for explicit stack while garbage collecting hash tables */ | 1259 /* structure used for explicit stack while garbage collecting hash tables */ |
1232 typedef struct ht_stack_S | 1260 typedef struct ht_stack_S |
1233 { | 1261 { |