Subversion Repositories HelenOS

Rev

Rev 4156 | Rev 4296 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4156 Rev 4221
Line 128... Line 128...
128
 */
128
 */
129
SPINLOCK_INITIALIZE(sgcn_input_lock);
129
SPINLOCK_INITIALIZE(sgcn_input_lock);
130
 
130
 
131
 
131
 
132
/* functions referenced from definitions of I/O operations structures */
132
/* functions referenced from definitions of I/O operations structures */
133
static void sgcn_putchar(outdev_t *, const char, bool);
133
static void sgcn_putchar(outdev_t *, const wchar_t, bool);
134
 
134
 
135
/** SGCN output device operations */
135
/** SGCN output device operations */
136
static outdev_operations_t sgcnout_ops = {
136
static outdev_operations_t sgcnout_ops = {
137
    .write = sgcn_putchar
137
    .write = sgcn_putchar
138
};
138
};
Line 262... Line 262...
262
    *buf_ptr = c;
262
    *buf_ptr = c;
263
    *out_wrptr_ptr = new_wrptr;
263
    *out_wrptr_ptr = new_wrptr;
264
}
264
}
265
 
265
 
266
/**
266
/**
267
 * SGCN output operation. Prints a single character to the SGCN. If the line
267
 * SGCN output operation. Prints a single character to the SGCN. Newline
268
 * feed character is written ('\n'), the carriage return character ('\r') is
-
 
269
 * written straight away.
268
 * character is converted to CRLF.
270
 */
269
 */
271
static void sgcn_putchar(outdev_t *od, const char c, bool silent)
270
static void sgcn_putchar(outdev_t *od, const wchar_t ch, bool silent)
272
{
271
{
273
    if (!silent) {
272
    if (!silent) {
274
        spinlock_lock(&sgcn_output_lock);
273
        spinlock_lock(&sgcn_output_lock);
275
       
274
       
276
        sgcn_do_putchar(c);
275
        if (ascii_check(ch)) {
277
        if (c == '\n')
276
            if (ch == '\n')
278
            sgcn_do_putchar('\r');
277
                sgcn_do_putchar('\r');
-
 
278
            sgcn_do_putchar(ch);
-
 
279
        } else
-
 
280
            sgcn_do_putchar(invalch);
279
       
281
       
280
        spinlock_unlock(&sgcn_output_lock);
282
        spinlock_unlock(&sgcn_output_lock);
281
    }
283
    }
282
}
284
}
283
 
285