+static const char *
+cmd_imode_emoji_color(
+ cmd_parms *cmd,
+ void *mconfig,
+ const char *arg)
+{
+ mod_chxj_config *dconf;
+
+ if (strlen(arg) > 256)
+ return "imode emoji color is too long.";
+
+ dconf = (mod_chxj_config *)mconfig;
+ if (strcasecmp("ON", arg) == 0) {
+ dconf->imode_emoji_color = CHXJ_IMODE_EMOJI_COLOR_ON;
+ }
+ else if(strcasecmp("AUTO",arg) == 0) {
+ dconf->imode_emoji_color = CHXJ_IMODE_EMOJI_COLOR_AUTO;
+ }
+ else {
+ dconf->imode_emoji_color = CHXJ_IMODE_EMOJI_COLOR_OFF;
+ }
+
+ return NULL;
+}
+
+static const char *
+cmd_add_device_data_tsv(cmd_parms *parms, void *mconfig, const char *arg)
+{
+ mod_chxj_config *conf;
+
+ if (strlen(arg) > 256)
+ return "mod_chxj: device tsv filename too long.";
+
+ conf = (mod_chxj_config *)mconfig;
+
+ conf->detect_device_type = CHXJ_ADD_DETECT_DEVICE_TYPE_TSV;
+
+ apr_finfo_t info;
+ apr_status_t res = apr_stat(&info,arg,APR_FINFO_TYPE,parms->pool);
+ if(res != APR_SUCCESS){
+ return apr_psprintf(parms->pool,"ChxjDeviceTSV [%s]: not found ",arg);
+ }
+ else{
+ if(info.filetype != APR_REG ){
+ return apr_psprintf(parms->pool,"ChxjDeviceTSV [%s]: is not file ",arg);
+ }
+ }
+ apr_file_t *fp;
+ apr_file_open(&fp, arg, APR_READ|APR_BUFFERED, APR_OS_DEFAULT, parms->pool);
+
+ chxj_load_device_tsv_data(fp,parms->pool,conf);
+
+ apr_file_close(fp);
+ return NULL;
+}
+
+static const char *
+cmd_image_rewrite(cmd_parms *parms, void *mconfig, const char *arg)
+{
+ mod_chxj_config *conf;
+ if (strlen(arg) > 256){
+ return "mod_chxj: set rewrite too long.";
+ }
+ conf = (mod_chxj_config *)mconfig;
+ if (strcasecmp("ON", arg) == 0) {
+ conf->image_rewrite = CHXJ_IMG_REWRITE_ON;
+ }
+ else if(strcasecmp("OFF",arg) == 0) {
+ conf->image_rewrite = CHXJ_IMG_REWRITE_OFF;
+ }
+ else {
+ conf->image_rewrite = CHXJ_IMG_REWRITE_NONE;
+ }
+ return NULL;
+}
+
+static const char *
+cmd_image_rewrite_url(cmd_parms *parms, void *mconfig, const char *arg)
+{
+ mod_chxj_config *conf;
+ if (strlen(arg) > 256){
+ return "mod_chxj: set rewrite url too long.";
+ }
+ conf = (mod_chxj_config *)mconfig;
+ conf->image_rewrite_url = apr_pstrdup(parms->pool, arg);;
+ return NULL;
+}
+
+static const char *
+cmd_image_rewrite_mode(cmd_parms *parms, void *mconfig, const char *arg)
+{
+ mod_chxj_config *conf;
+ if (strlen(arg) > 256){
+ return "mod_chxj: set rewrite mode is too long.";
+ }
+
+ conf = (mod_chxj_config *)mconfig;
+ if (strcasecmp("all",arg) == 0) {
+ conf->image_rewrite_mode = CHXJ_IMG_REWRITE_MODE_ALL;
+ }
+ else if (strcasecmp("user",arg) == 0) {
+ conf->image_rewrite_mode = CHXJ_IMG_REWRITE_MODE_USER;
+ }
+ else if (strcasecmp("tag",arg) == 0) {
+ conf->image_rewrite_mode = CHXJ_IMG_REWRITE_MODE_TAG;
+ }
+ else{
+ conf->image_rewrite_mode = CHXJ_IMG_REWRITE_MODE_NONE;
+ }
+ return NULL;
+}